├── History.md ├── index.less ├── .gitignore ├── web ├── setup.js ├── font-awesome │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── less │ │ ├── fixed-width.less │ │ ├── core.less │ │ ├── bordered-pulled.less │ │ ├── rotated-flipped.less │ │ ├── larger.less │ │ ├── list.less │ │ ├── font-awesome.less │ │ ├── stacked.less │ │ ├── path.less │ │ ├── mixins.less │ │ ├── spinning.less │ │ └── variables.less │ └── scss │ │ ├── _fixed-width.scss │ │ ├── _core.scss │ │ ├── _bordered-pulled.scss │ │ ├── _larger.scss │ │ ├── _rotated-flipped.scss │ │ ├── _list.scss │ │ ├── font-awesome.scss │ │ ├── _stacked.scss │ │ ├── _path.scss │ │ ├── _mixins.scss │ │ ├── _spinning.scss │ │ └── _variables.scss ├── bootstrap │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ ├── less │ │ ├── breadcrumbs.less │ │ ├── component-animations.less │ │ ├── wells.less │ │ ├── close.less │ │ ├── thumbnails.less │ │ ├── utilities.less │ │ ├── media.less │ │ ├── pager.less │ │ ├── jumbotron.less │ │ ├── badges.less │ │ ├── bootstrap.less │ │ ├── code.less │ │ ├── labels.less │ │ ├── alerts.less │ │ ├── progress-bars.less │ │ ├── grid.less │ │ ├── print.less │ │ ├── pagination.less │ │ ├── list-group.less │ │ ├── scaffolding.less │ │ ├── tooltip.less │ │ ├── modals.less │ │ ├── popovers.less │ │ ├── input-groups.less │ │ ├── buttons.less │ │ ├── dropdowns.less │ │ ├── panels.less │ │ ├── tables.less │ │ ├── carousel.less │ │ ├── responsive-utilities.less │ │ ├── button-groups.less │ │ ├── navs.less │ │ ├── type.less │ │ ├── theme.less │ │ ├── normalize.less │ │ └── forms.less │ └── css │ │ └── bootstrap-theme.min.css └── index.html ├── docs └── screenshot.png ├── less ├── components │ ├── comments.less │ ├── labels.less │ ├── comment.less │ ├── repo-input.less │ ├── issue.less │ └── pager.less ├── pages │ ├── all-issues.less │ └── issue.less ├── mixins.less └── app.less ├── index.js ├── lib ├── router.js ├── components │ ├── label.js │ ├── labels.js │ ├── recent-time.js │ ├── comment.js │ ├── issue.js │ ├── issue.jsx │ ├── repo-input.js │ ├── comments.js │ └── pager.js ├── pages │ ├── all-issues.js │ ├── issue.js │ └── issue.jsx ├── utils.js ├── app.js └── view.js ├── .jshintrc ├── package.json ├── Makefile ├── component.json ├── test └── test_utils.js └── Readme.md /History.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.less: -------------------------------------------------------------------------------- 1 | 2 | @import "less/app"; 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /components 2 | build 3 | *.swp 4 | node_modules 5 | -------------------------------------------------------------------------------- /web/setup.js: -------------------------------------------------------------------------------- 1 | 2 | twitterAudition(document.getElementById('main')) 3 | 4 | -------------------------------------------------------------------------------- /docs/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredly/github-issues-viewer/HEAD/docs/screenshot.png -------------------------------------------------------------------------------- /web/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredly/github-issues-viewer/HEAD/web/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /less/components/comments.less: -------------------------------------------------------------------------------- 1 | /** comments **/ 2 | 3 | .comments { 4 | margin: 0; 5 | padding: 0; 6 | list-style: none; 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /web/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredly/github-issues-viewer/HEAD/web/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /web/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredly/github-issues-viewer/HEAD/web/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /web/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredly/github-issues-viewer/HEAD/web/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /less/pages/all-issues.less: -------------------------------------------------------------------------------- 1 | /* all issues page */ 2 | 3 | .issue-list { 4 | list-style: none; 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /web/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredly/github-issues-viewer/HEAD/web/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /web/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredly/github-issues-viewer/HEAD/web/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | window.$ = require('jquery') 3 | var App = require('./lib/app') 4 | 5 | module.exports = function (el) { 6 | React.renderComponent(App(), el) 7 | } 8 | 9 | -------------------------------------------------------------------------------- /web/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredly/github-issues-viewer/HEAD/web/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /web/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /less/components/labels.less: -------------------------------------------------------------------------------- 1 | 2 | .labels { 3 | margin: 0; 4 | padding: 0; 5 | list-style: none; 6 | } 7 | 8 | .labels__label { 9 | float: left; 10 | margin-left: 5px; 11 | } 12 | 13 | .labels--vertical .labels__label { 14 | float: none; 15 | display: block; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/router.js: -------------------------------------------------------------------------------- 1 | var Backbone = require('backbone'); 2 | 3 | module.exports = Backbone.Router.extend({ 4 | routes: { 5 | ":owner/:repo": "allIssues", 6 | ":owner/:repo/:start": "allIssues", 7 | ":owner/:repo/issue/:number": "issue", 8 | "*splat": "default" 9 | } 10 | }); 11 | 12 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "strict": false, 3 | "laxcomma": true, 4 | "undef": true, 5 | "node": true, 6 | "globals": { 7 | "React": false 8 | }, 9 | "-W033": false, 10 | "-W024": false, 11 | "-W030": false, 12 | "-W069": false, 13 | "-W089": false, 14 | "-W098": false, 15 | "-W116": false, 16 | "-W065": false 17 | } 18 | -------------------------------------------------------------------------------- /web/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font-family: FontAwesome; 7 | font-style: normal; 8 | font-weight: normal; 9 | line-height: 1; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font-family: FontAwesome; 7 | font-style: normal; 8 | font-weight: normal; 9 | line-height: 1; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | -------------------------------------------------------------------------------- /lib/components/label.js: -------------------------------------------------------------------------------- 1 | 2 | var d = React.DOM 3 | 4 | /* A single label */ 5 | var Label = module.exports = React.createClass({ 6 | render: function () { 7 | var label = this.props.model 8 | return d.a({ 9 | className: 'label', 10 | href: label.url, 11 | style: { 12 | backgroundColor: '#' + label.color, 13 | } 14 | }, label.name) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twitter-audition", 3 | "version": "0.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "make test" 11 | }, 12 | "author": "Jared Forsyth", 13 | "license": "Apache v2", 14 | "devDependencies": { 15 | "expect.js": "~0.2.0", 16 | "marked": "~0.3.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/components/labels.js: -------------------------------------------------------------------------------- 1 | 2 | var d = React.DOM 3 | , Label = require('./label') 4 | 5 | /* List of labels */ 6 | var Labels = module.exports = React.createClass({ 7 | render: function () { 8 | return d.ul({ 9 | className: 'labels ' + this.props.className 10 | }, this.props.labels.map(function (label) { 11 | return d.li({className: 'labels__label'}, Label({model: label})) 12 | })) 13 | } 14 | }) 15 | -------------------------------------------------------------------------------- /web/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .@{fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /web/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /web/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /web/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: -@fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /web/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "spinning"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /web/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "spinning"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /lib/components/recent-time.js: -------------------------------------------------------------------------------- 1 | 2 | var moment = require('moment') 3 | 4 | function formatRecentTime(time) { 5 | return moment(time).fromNow() 6 | } 7 | 8 | /* 9 | * Show the time as "2 hours ago" etc using moment.js 10 | */ 11 | var RecentTime = module.exports = React.createClass({ 12 | render: function () { 13 | return React.DOM.time({ 14 | title: new Date(this.props.time) + '', 15 | dateTime: this.props.time, 16 | className: this.props.className + ' recent-time' 17 | }, formatRecentTime(this.props.time)) 18 | } 19 | }) 20 | 21 | -------------------------------------------------------------------------------- /less/mixins.less: -------------------------------------------------------------------------------- 1 | 2 | .grey-name { 3 | color: #555; 4 | font-weight: bold; 5 | } 6 | 7 | .l-body { 8 | width: 700px; 9 | margin: 50px auto; 10 | } 11 | 12 | .shadowed { 13 | box-shadow: 0 0 5px #777; 14 | } 15 | 16 | .very-round { 17 | border-radius: 5px; 18 | } 19 | 20 | .issue-viewer { 21 | .shadowed; 22 | .very-round; 23 | .l-body; 24 | 25 | padding: 20px; 26 | } 27 | 28 | .l-space-below { 29 | margin-bottom: 15px; 30 | } 31 | 32 | .l-space-left { 33 | margin-left: 15px; 34 | } 35 | 36 | .avatar-image { 37 | width: 50px; 38 | height: 50px; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /web/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /less/components/comment.less: -------------------------------------------------------------------------------- 1 | 2 | .comment { 3 | border-top: 1px solid #eee; 4 | padding-top: 15px; 5 | } 6 | 7 | .comment__header { 8 | color: #777; 9 | } 10 | 11 | .comment__commenter { 12 | .grey-name; 13 | } 14 | 15 | .comment__id { 16 | color: #ccc; 17 | margin: 0 5px; 18 | } 19 | 20 | .comment__id::before { 21 | content: @fa-var-comment; 22 | font-family: FontAwesome; 23 | } 24 | 25 | .comment__time::before { 26 | content: 'commented'; 27 | margin: 0 5px; 28 | } 29 | 30 | .comment__body { 31 | margin-left: 65px; 32 | margin-bottom: -10px; 33 | 34 | position: relative; 35 | top: -10px; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /web/bootstrap/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: 8px 15px; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | > li { 13 | display: inline-block; 14 | + li:before { 15 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 16 | padding: 0 5px; 17 | color: @breadcrumb-color; 18 | } 19 | } 20 | > .active { 21 | color: @breadcrumb-active-color; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /web/bootstrap/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | &.in { 21 | display: block; 22 | } 23 | } 24 | .collapsing { 25 | position: relative; 26 | height: 0; 27 | overflow: hidden; 28 | .transition(height .35s ease); 29 | } 30 | -------------------------------------------------------------------------------- /web/bootstrap/less/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid darken(@well-bg, 7%); 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /web/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 9 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 10 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 11 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /less/components/repo-input.less: -------------------------------------------------------------------------------- 1 | 2 | .repo-input { 3 | input { 4 | border: 1px solid white; 5 | border-radius: 3px; 6 | vertical-align: middle; 7 | font-size: 18px; 8 | padding: 2px 5px; 9 | font-weight: bold; 10 | margin-right: 10px; 11 | margin-left: 10px; 12 | cursor: pointer; 13 | 14 | &:focus { 15 | outline: none; 16 | box-shadow: 0 0 3px #777; 17 | cursor: text; 18 | } 19 | 20 | } 21 | 22 | button { 23 | .btn; 24 | .btn-default; 25 | 26 | &[disabled], 27 | &.disabled { 28 | background-color: #ebebeb; 29 | } 30 | } 31 | } 32 | 33 | .repo-input__title { 34 | color: #777; 35 | font-size: 18px; 36 | font-weight: bold; 37 | vertical-align: middle; 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 9 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 10 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 11 | //src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Github Issues 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Fork me on GitHub 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /web/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon-rotate(@degrees, @rotation) { 5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 6 | -webkit-transform: rotate(@degrees); 7 | -moz-transform: rotate(@degrees); 8 | -ms-transform: rotate(@degrees); 9 | -o-transform: rotate(@degrees); 10 | transform: rotate(@degrees); 11 | } 12 | 13 | .fa-icon-flip(@horiz, @vert, @rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 15 | -webkit-transform: scale(@horiz, @vert); 16 | -moz-transform: scale(@horiz, @vert); 17 | -ms-transform: scale(@horiz, @vert); 18 | -o-transform: scale(@horiz, @vert); 19 | transform: scale(@horiz, @vert); 20 | } 21 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon-rotate($degrees, $rotation) { 5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation); 6 | -webkit-transform: rotate($degrees); 7 | -moz-transform: rotate($degrees); 8 | -ms-transform: rotate($degrees); 9 | -o-transform: rotate($degrees); 10 | transform: rotate($degrees); 11 | } 12 | 13 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation); 15 | -webkit-transform: scale($horiz, $vert); 16 | -moz-transform: scale($horiz, $vert); 17 | -ms-transform: scale($horiz, $vert); 18 | -o-transform: scale($horiz, $vert); 19 | transform: scale($horiz, $vert); 20 | } 21 | -------------------------------------------------------------------------------- /web/bootstrap/less/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /web/font-awesome/less/spinning.less: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: spin 2s infinite linear; 6 | -moz-animation: spin 2s infinite linear; 7 | -o-animation: spin 2s infinite linear; 8 | animation: spin 2s infinite linear; 9 | } 10 | 11 | @-moz-keyframes spin { 12 | 0% { -moz-transform: rotate(0deg); } 13 | 100% { -moz-transform: rotate(359deg); } 14 | } 15 | @-webkit-keyframes spin { 16 | 0% { -webkit-transform: rotate(0deg); } 17 | 100% { -webkit-transform: rotate(359deg); } 18 | } 19 | @-o-keyframes spin { 20 | 0% { -o-transform: rotate(0deg); } 21 | 100% { -o-transform: rotate(359deg); } 22 | } 23 | @-ms-keyframes spin { 24 | 0% { -ms-transform: rotate(0deg); } 25 | 100% { -ms-transform: rotate(359deg); } 26 | } 27 | @keyframes spin { 28 | 0% { transform: rotate(0deg); } 29 | 100% { transform: rotate(359deg); } 30 | } 31 | -------------------------------------------------------------------------------- /web/font-awesome/scss/_spinning.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: spin 2s infinite linear; 6 | -moz-animation: spin 2s infinite linear; 7 | -o-animation: spin 2s infinite linear; 8 | animation: spin 2s infinite linear; 9 | } 10 | 11 | @-moz-keyframes spin { 12 | 0% { -moz-transform: rotate(0deg); } 13 | 100% { -moz-transform: rotate(359deg); } 14 | } 15 | @-webkit-keyframes spin { 16 | 0% { -webkit-transform: rotate(0deg); } 17 | 100% { -webkit-transform: rotate(359deg); } 18 | } 19 | @-o-keyframes spin { 20 | 0% { -o-transform: rotate(0deg); } 21 | 100% { -o-transform: rotate(359deg); } 22 | } 23 | @-ms-keyframes spin { 24 | 0% { -ms-transform: rotate(0deg); } 25 | 100% { -ms-transform: rotate(359deg); } 26 | } 27 | @keyframes spin { 28 | 0% { transform: rotate(0deg); } 29 | 100% { transform: rotate(359deg); } 30 | } 31 | -------------------------------------------------------------------------------- /web/bootstrap/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(all .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | .img-responsive(); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | PAGES = $(patsubst %.jsx, %.js, $(wildcard lib/pages/*.jsx)) 3 | COMPONENTS = $(patsubst %.jsx, %.js, $(wildcard lib/components/*.jsx)) 4 | COMPILED = $(PAGES) $(COMPONENTS) 5 | 6 | build: components index.js twitter-audition.css lib $(COMPILED) 7 | @component build --dev -s twitterAudition -o web -n build 8 | 9 | twitter-audition.css: index.less less 10 | @lessc index.less > $@ 11 | 12 | lib/pages/%.js: lib/pages/%.jsx 13 | @jsx $< > $@ 14 | 15 | lib/components/%.js: lib/components/%.jsx 16 | @jsx $< > $@ 17 | 18 | components: component.json 19 | @component install --dev 20 | 21 | clean: 22 | rm -fr build components template.js 23 | 24 | view: 25 | @xdg-open web/index.html 26 | 27 | test: lint test-only 28 | 29 | lint: 30 | jshint *.js lib test 31 | 32 | test-only: 33 | mocha -R spec 34 | 35 | gh-pages: build 36 | cp -r web w 37 | git co gh-pages 38 | rm -rf bootstrap font-awesome 39 | mv w/* ./ 40 | rmdir w 41 | 42 | .PHONY: clean test test-only lint gh-pages 43 | -------------------------------------------------------------------------------- /component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twitter-audition", 3 | "repo": "jaredly/twitter-audition", 4 | "description": "", 5 | "version": "0.0.1", 6 | "keywords": [], 7 | "dependencies": { 8 | "components/backbone": "*", 9 | "component/jquery": "*", 10 | "lodash/lodash": "*", 11 | "component/moment": "*", 12 | "chjj/marked": "*" 13 | }, 14 | "development": {}, 15 | "license": "MIT", 16 | "main": "index.js", 17 | "scripts": [ 18 | "index.js", 19 | "lib/app.js", 20 | "lib/view.js", 21 | "lib/router.js", 22 | "lib/utils.js", 23 | "lib/pages/issue.js", 24 | "lib/pages/all-issues.js", 25 | "lib/components/issue.js", 26 | "lib/components/pager.js", 27 | "lib/components/comment.js", 28 | "lib/components/comments.js", 29 | "lib/components/labels.js", 30 | "lib/components/label.js", 31 | "lib/components/repo-input.js", 32 | "lib/components/recent-time.js" 33 | ], 34 | "styles": [ 35 | "twitter-audition.css" 36 | ], 37 | "remotes": [] 38 | } 39 | -------------------------------------------------------------------------------- /less/components/issue.less: -------------------------------------------------------------------------------- 1 | /** issue **/ 2 | 3 | .issue { 4 | display: flex; 5 | flex-wrap: nowrap; 6 | color: #555; 7 | cursor: pointer; 8 | padding: 5px; 9 | margin-bottom: 20px; 10 | 11 | &:hover { 12 | background-color: #f7f7f7; 13 | border-radius: 5px; 14 | } 15 | } 16 | 17 | .issue__left { 18 | flex: 1; 19 | padding-right: 10px; 20 | } 21 | 22 | .issue__right { 23 | text-align: right; 24 | } 25 | 26 | .issue__header { 27 | font-size: 18px; 28 | font-weight: bold; 29 | color: #555; 30 | } 31 | 32 | .issue__id::before { 33 | content: '#'; 34 | } 35 | 36 | .issue__id { 37 | margin-right: 10px; 38 | } 39 | 40 | .issue__body { 41 | color: #999; 42 | } 43 | 44 | .issue__labels { 45 | text-align: right; 46 | } 47 | 48 | .issue__user .user__login { 49 | display: block; 50 | color: #777; 51 | font-size: 10px; 52 | margin-top: 5px; 53 | 54 | &:hover { 55 | color: #333; 56 | } 57 | } 58 | 59 | .issue__user .user__login::before { 60 | content: '@'; 61 | } 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /web/bootstrap/less/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /less/pages/issue.less: -------------------------------------------------------------------------------- 1 | /* issue page */ 2 | 3 | /** top header **/ 4 | .issue-page__back { 5 | .btn; 6 | .btn-default; 7 | .btn-sm; 8 | 9 | margin-bottom: 5px; 10 | } 11 | 12 | .issue-header__main { 13 | margin-top: 0; 14 | } 15 | 16 | .issue-page__header, 17 | .issue-header__sub, 18 | .issue-header__main { 19 | .l-space-below; 20 | } 21 | 22 | .issue-page__header__title { 23 | margin-left: 10px; 24 | color: #555; 25 | font-weight: bold; 26 | } 27 | 28 | .issue-page__state { 29 | .pull-right; 30 | .label; 31 | 32 | margin-top: 5px; 33 | margin-left: 10px; 34 | } 35 | 36 | .issue-state--open { 37 | .label-success; 38 | } 39 | 40 | .issue-state--closed { 41 | .label-warning; 42 | } 43 | 44 | .issue-page__body { 45 | margin-bottom: 15px; 46 | } 47 | 48 | /** sub header **/ 49 | 50 | .issue-header__sub { 51 | color: #999; 52 | } 53 | .issue-page__user { 54 | .grey-name; 55 | } 56 | 57 | .issue__time::before { 58 | content: 'opened this issue'; 59 | margin: 0 5px; 60 | } 61 | 62 | .issue-header__labels { 63 | float: right; 64 | margin-top: 13px; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /web/bootstrap/less/media.less: -------------------------------------------------------------------------------- 1 | // Media objects 2 | // Source: http://stubbornella.org/content/?p=497 3 | // -------------------------------------------------- 4 | 5 | 6 | // Common styles 7 | // ------------------------- 8 | 9 | // Clear the floats 10 | .media, 11 | .media-body { 12 | overflow: hidden; 13 | zoom: 1; 14 | } 15 | 16 | // Proper spacing between instances of .media 17 | .media, 18 | .media .media { 19 | margin-top: 15px; 20 | } 21 | .media:first-child { 22 | margin-top: 0; 23 | } 24 | 25 | // For images and videos, set to block 26 | .media-object { 27 | display: block; 28 | } 29 | 30 | // Reset margins on headings for tighter default spacing 31 | .media-heading { 32 | margin: 0 0 5px; 33 | } 34 | 35 | 36 | // Media image alignment 37 | // ------------------------- 38 | 39 | .media { 40 | > .pull-left { 41 | margin-right: 10px; 42 | } 43 | > .pull-right { 44 | margin-left: 10px; 45 | } 46 | } 47 | 48 | 49 | // Media list variation 50 | // ------------------------- 51 | 52 | // Undo default ul/ol styles 53 | .media-list { 54 | padding-left: 0; 55 | list-style: none; 56 | } 57 | -------------------------------------------------------------------------------- /web/bootstrap/less/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | .clearfix(); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pagination-bg; 19 | border: 1px solid @pagination-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pagination-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pagination-bg; 51 | cursor: not-allowed; 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /web/bootstrap/less/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding; 8 | margin-bottom: @jumbotron-padding; 9 | font-size: @jumbotron-font-size; 10 | font-weight: 200; 11 | line-height: (@line-height-base * 1.5); 12 | color: @jumbotron-color; 13 | background-color: @jumbotron-bg; 14 | 15 | h1, 16 | .h1 { 17 | line-height: 1; 18 | color: @jumbotron-heading-color; 19 | } 20 | p { 21 | line-height: 1.4; 22 | } 23 | 24 | .container & { 25 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 26 | } 27 | 28 | .container { 29 | max-width: 100%; 30 | } 31 | 32 | @media screen and (min-width: @screen-sm-min) { 33 | padding-top: (@jumbotron-padding * 1.6); 34 | padding-bottom: (@jumbotron-padding * 1.6); 35 | 36 | .container & { 37 | padding-left: (@jumbotron-padding * 2); 38 | padding-right: (@jumbotron-padding * 2); 39 | } 40 | 41 | h1, 42 | .h1 { 43 | font-size: (@font-size-base * 4.5); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/components/comment.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | var RecentTime = require('./recent-time') 3 | , utils = require('../utils') 4 | 5 | var Comment = module.exports = React.createClass({ 6 | displayName: 'Comment', 7 | getDefaultProps: function () { 8 | model: {} 9 | }, 10 | render: function () { 11 | var comment = this.props.model 12 | , commenter = comment.user 13 | return ( 14 | React.DOM.div( {className:"comment"}, 15 | React.DOM.header( {className:"comment__header"}, 16 | React.DOM.a( {className:"comment__commenter", href:commenter.html_url}, 17 | React.DOM.img( {className:"user__avatar", 18 | src:commenter.avatar_url}), 19 | React.DOM.span( {className:"user__login user__login--avatar-left"}, commenter.login) 20 | ), 21 | RecentTime( {className:"comment__time", time:comment.created_at}), 22 | React.DOM.a( {'data-id':comment.id, className:"comment__id", href:comment.html_url}) 23 | ), 24 | React.DOM.div( {className:"comment__body"}, 25 | utils.processBody(comment.body) 26 | ) 27 | ) 28 | ) 29 | } 30 | }) 31 | 32 | -------------------------------------------------------------------------------- /less/components/pager.less: -------------------------------------------------------------------------------- 1 | 2 | /** pager **/ 3 | 4 | .mypager { 5 | text-align: center; 6 | margin-bottom: 10px; 7 | } 8 | 9 | .mypager__load-more, 10 | .mypager__button { 11 | .btn; 12 | .btn-default; 13 | .btn-sm; 14 | font-family: FontAwesome; 15 | 16 | &.disabled { 17 | background-color: #ebebeb; 18 | } 19 | } 20 | .mypager__button--start::before { 21 | content: @fa-var-angle-double-left; 22 | } 23 | .mypager__button--end::before { 24 | content: @fa-var-angle-double-right; 25 | } 26 | .mypager__button--prev::before { 27 | content: @fa-var-angle-left; 28 | } 29 | .mypager__button--next::before { 30 | content: @fa-var-angle-right; 31 | } 32 | .mypager__button--start { 33 | margin-right: 5px; 34 | } 35 | .mypager__button--end { 36 | margin-left: 5px; 37 | } 38 | 39 | .mypager__load-more { 40 | margin-left: 10px; 41 | } 42 | 43 | .mypager__page { 44 | padding: 5px 10px; 45 | display: inline-block; 46 | width: 36px; 47 | cursor: pointer; 48 | color: #999; 49 | vertical-align: middle; 50 | 51 | &:hover { 52 | color: black; 53 | } 54 | } 55 | 56 | .mypager__page.disabled { 57 | color: black; 58 | font-weight: bold; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /web/bootstrap/less/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base classes 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | } 32 | 33 | // Hover state, but only for links 34 | a.badge { 35 | &:hover, 36 | &:focus { 37 | color: @badge-link-hover-color; 38 | text-decoration: none; 39 | cursor: pointer; 40 | } 41 | } 42 | 43 | // Account for counters in navs 44 | a.list-group-item.active > .badge, 45 | .nav-pills > .active > a > .badge { 46 | color: @badge-active-color; 47 | background-color: @badge-active-bg; 48 | } 49 | .nav-pills > li > a > .badge { 50 | margin-left: 3px; 51 | } 52 | -------------------------------------------------------------------------------- /web/bootstrap/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | 9 | // Core CSS 10 | @import "scaffolding.less"; 11 | @import "type.less"; 12 | @import "code.less"; 13 | @import "grid.less"; 14 | @import "tables.less"; 15 | @import "forms.less"; 16 | @import "buttons.less"; 17 | 18 | // Components 19 | @import "component-animations.less"; 20 | @import "glyphicons.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "wells.less"; 39 | @import "close.less"; 40 | 41 | // Components w/ JavaScript 42 | @import "modals.less"; 43 | @import "tooltip.less"; 44 | @import "popovers.less"; 45 | @import "carousel.less"; 46 | 47 | // Utility classes 48 | @import "utilities.less"; 49 | @import "responsive-utilities.less"; 50 | -------------------------------------------------------------------------------- /web/bootstrap/less/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | white-space: nowrap; 21 | border-radius: @border-radius-base; 22 | } 23 | 24 | // Blocks of code 25 | pre { 26 | display: block; 27 | padding: ((@line-height-computed - 1) / 2); 28 | margin: 0 0 (@line-height-computed / 2); 29 | font-size: (@font-size-base - 1); // 14px to 13px 30 | line-height: @line-height-base; 31 | word-break: break-all; 32 | word-wrap: break-word; 33 | color: @pre-color; 34 | background-color: @pre-bg; 35 | border: 1px solid @pre-border-color; 36 | border-radius: @border-radius-base; 37 | 38 | // Account for some code outputs that place code tags in pre tags 39 | code { 40 | padding: 0; 41 | font-size: inherit; 42 | color: inherit; 43 | white-space: pre-wrap; 44 | background-color: transparent; 45 | border-radius: 0; 46 | } 47 | } 48 | 49 | // Enable scrollable blocks of code 50 | .pre-scrollable { 51 | max-height: @pre-scrollable-max-height; 52 | overflow-y: scroll; 53 | } 54 | -------------------------------------------------------------------------------- /web/bootstrap/less/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | &[href] { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /less/app.less: -------------------------------------------------------------------------------- 1 | 2 | @import "../web/bootstrap/less/variables"; 3 | @import "../web/bootstrap/less/utilities"; 4 | @import "../web/bootstrap/less/scaffolding"; 5 | @import "../web/bootstrap/less/mixins"; 6 | @import "../web/bootstrap/less/buttons"; 7 | @import "../web/bootstrap/less/labels"; 8 | 9 | @import "../web/font-awesome/less/font-awesome"; 10 | 11 | @import "mixins"; 12 | 13 | @import "components/repo-input"; 14 | @import "components/comments"; 15 | @import "components/comment"; 16 | @import "components/labels"; 17 | @import "components/pager"; 18 | @import "components/issue"; 19 | @import "pages/all-issues"; 20 | @import "pages/issue"; 21 | 22 | a:hover { 23 | text-decoration: none; 24 | } 25 | 26 | /* User things */ 27 | 28 | .user__avatar { 29 | .avatar-image; 30 | } 31 | 32 | .user__login { 33 | margin-left: 5px; 34 | } 35 | 36 | /* 37 | .user__login--avatar-right::after { 38 | content: @fa-var-play; 39 | position: relative; 40 | left: -6px; 41 | font-family: FontAwesome; 42 | color: #ccc; 43 | } 44 | */ 45 | 46 | .user__login--avatar-left::before { 47 | content: @fa-var-play; 48 | position: relative; 49 | left: -6px; 50 | font-family: FontAwesome; 51 | color: #ccc; 52 | } 53 | 54 | .user__avatar { 55 | border: 1px solid #ccc; 56 | border-radius: 4px; 57 | } 58 | 59 | 60 | /* main app */ 61 | 62 | .main-view { 63 | margin-top: 20px; 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /lib/components/issue.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | 3 | var Labels = require('./labels') 4 | , utils = require('../utils') 5 | 6 | module.exports = React.createClass({ 7 | displayName: 'Issue', 8 | onClick: function () { 9 | window.location = this.props.href; 10 | }, 11 | render: function () { 12 | var issue = this.props.model 13 | return ( 14 | React.DOM.div( {className:"issue", onClick:this.onClick}, 15 | React.DOM.div( {className:"issue__left"}, 16 | React.DOM.a( {className:"issue__header", href:this.props.href}, 17 | React.DOM.span( {className:"issue__id"}, issue.number), 18 | React.DOM.span( {className:"issue__title"}, issue.title) 19 | ), 20 | React.DOM.div( {className:"issue__body"}, 21 | utils.teaserProcessed(issue.body) 22 | ) 23 | ), 24 | React.DOM.div( {className:"issue__right"}, 25 | React.DOM.a( {className:"issue__user", href:issue.user.html_url}, 26 | React.DOM.img( {className:"user__avatar", src:issue.user.avatar_url}), 27 | React.DOM.span( {className:"user__login user__login--avatar-right"}, issue.user.login) 28 | ), 29 | Labels( {className:"issue__labels labels--vertical", labels:issue.labels}) 30 | ) 31 | ) 32 | ) 33 | /**/ 34 | } 35 | }) 36 | -------------------------------------------------------------------------------- /lib/components/issue.jsx: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | 3 | var Labels = require('./labels') 4 | , utils = require('../utils') 5 | 6 | /** 7 | * An Issue in the list of Issues 8 | * 9 | * Child components: 10 | * - Labels 11 | */ 12 | module.exports = React.createClass({ 13 | displayName: 'Issue', 14 | onClick: function () { 15 | window.location = this.props.href; 16 | }, 17 | render: function () { 18 | var issue = this.props.model 19 | return ( 20 |
21 |
22 | 23 | {issue.number} 24 | {issue.title} 25 | 26 |
27 | {utils.teaserProcessed(issue.body)} 28 |
29 |
30 |
31 | 32 | 33 | {issue.user.login} 34 | 35 | 36 |
37 |
38 | ) 39 | /**/ 40 | } 41 | }) 42 | -------------------------------------------------------------------------------- /test/test_utils.js: -------------------------------------------------------------------------------- 1 | 2 | var expect = require('expect.js') 3 | , utils = require('../lib/utils') 4 | 5 | describe('linkProfiles', function () { 6 | it('should find a profile', function () { 7 | expect(utils.linkProfiles('@jaredly')).to.equal('@jaredly') 8 | }) 9 | it('should ignore non-profiles', function () { 10 | var text = 'no profiles here or out@there.' 11 | expect(utils.linkProfiles(text)).to.equal(text) 12 | }) 13 | it('should find one at the start of a pre', function () { 14 | expect(utils.linkProfiles('

@jaredly man')).to.equal('

@jaredly man') 15 | }) 16 | }) 17 | 18 | describe('teaser', function () { 19 | it('should work for a simple case', function () { 20 | var line = 'here is a sentence that goes for a little while. But then it gets longer and longer. And eventually we get past 140 characters. It kind of takes a while.' 21 | , shorter = 'here is a sentence that goes for a little while. But then it gets longer and longer. And eventually we get past 140 characters. It kind of…' 22 | expect(utils.teaser(line)).to.equal(shorter); 23 | }) 24 | }) 25 | 26 | /* 27 | describe('fixTrailingMarkdown', function () { 28 | it('should preserve valid markdown', function () { 29 | var samples = [ 30 | '*one*', 31 | '**two**', 32 | '_three_ *four* something*here.', 33 | 'some `url`s' 34 | ] 35 | }) 36 | }) 37 | */ 38 | 39 | -------------------------------------------------------------------------------- /web/bootstrap/less/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissable alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable { 41 | padding-right: (@alert-padding + 20); 42 | 43 | // Adjust close link position 44 | .close { 45 | position: relative; 46 | top: -2px; 47 | right: -21px; 48 | color: inherit; 49 | } 50 | } 51 | 52 | // Alternate styles 53 | // 54 | // Generate contextual modifier classes for colorizing the alert. 55 | 56 | .alert-success { 57 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 58 | } 59 | .alert-info { 60 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 61 | } 62 | .alert-warning { 63 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 64 | } 65 | .alert-danger { 66 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 67 | } 68 | -------------------------------------------------------------------------------- /lib/pages/all-issues.js: -------------------------------------------------------------------------------- 1 | var d = React.DOM 2 | , Issue = require('../components/issue') 3 | , Pager = require('../components/pager') 4 | 5 | /* 6 | * Display all the issues, with paging. 7 | * 8 | * Child components: 9 | * - Pager 10 | * - list of 'Issue's 11 | */ 12 | module.exports = React.createClass({ 13 | displayName: 'AllIssues', 14 | getDefaultProps: function () { 15 | return { 16 | start: 0, 17 | issues: [], 18 | issueHref: function () {}, 19 | onPage: function () { 20 | console.error('parent component must manage page state') 21 | } 22 | } 23 | }, 24 | render: function () { 25 | var props = {className: 'page all-issues-page'} 26 | /* 27 | if (this.props.start >= this.props.issues.length) { 28 | return d.div(props, 'No issues here') 29 | } 30 | */ 31 | var issues = this.props.issues.slice(this.props.start, this.props.start + 25) 32 | , message = false 33 | if (!issues.length) { 34 | message = d.h4({className:'no-issues'}, this.props.loading ? 'Loading...' : 'No Issues') 35 | } 36 | return d.div( 37 | props, 38 | Pager({ 39 | step: 25, 40 | at: this.props.start, 41 | max: this.props.issues.length, 42 | onPage: this.props.onPage 43 | }), 44 | message, 45 | d.ul( 46 | { 47 | className: 'issue-list' 48 | }, 49 | issues.map(function (issue) { 50 | return d.li({className: 'issue-list__item'}, Issue({ 51 | href: this.props.issueHref(issue.id), 52 | model: issue, 53 | key: issue.id 54 | })) 55 | }.bind(this)) 56 | ), 57 | Pager({ 58 | step: 25, 59 | at: this.props.start, 60 | max: this.props.issues.length, 61 | onPage: this.props.onPage 62 | }) 63 | ) 64 | } 65 | }) 66 | 67 | -------------------------------------------------------------------------------- /lib/components/repo-input.js: -------------------------------------------------------------------------------- 1 | 2 | var d = React.DOM 3 | 4 | /** 5 | * An input box + load button. 6 | * Validates the input. 7 | * Used by ../view.js 8 | */ 9 | var RepoInput = module.exports = React.createClass({ 10 | getDefaultProps: function () { 11 | return { 12 | initialValue: 'jaredly/github-issues', 13 | onChange: function () {} 14 | } 15 | }, 16 | getInitialState: function () { 17 | return { 18 | value: '' 19 | } 20 | }, 21 | onChange: function (e) { 22 | var value = e.target.value 23 | if (value === this.props.initialValue) value = '' 24 | this.setState({value: value}) 25 | }, 26 | onKeyDown: function (e) { 27 | // on return 28 | if (e.keyCode === 13) { 29 | if (this.canSubmit()) { 30 | e.preventDefault() 31 | e.stopPropagation() 32 | this.submit() 33 | } 34 | } 35 | }, 36 | submit: function () { 37 | this.props.onChange(this.state.value) 38 | this.setState({value: ''}) 39 | }, 40 | canSubmit: function () { 41 | if (this.state.value.trim() === this.props.initialValue.trim()) { 42 | return false 43 | } 44 | var parts = this.state.value.trim().split('/') 45 | if (parts.length !== 2) return false 46 | if (parts[0].length === 0 || parts[1].length === 0) { 47 | return false 48 | } 49 | return true 50 | }, 51 | render: function () { 52 | var disabled = !this.canSubmit() 53 | return d.div( 54 | {className: 'repo-input'}, 55 | this.props.title ? d.span({className: 'repo-input__title'}, this.props.title) : false, 56 | d.input({ 57 | placeholder: 'owner/repo', 58 | onKeyDown: this.onKeyDown, 59 | value: this.state.value || this.props.initialValue, 60 | onChange: this.onChange 61 | }), 62 | d.button({ 63 | disabled: disabled, 64 | onClick: disabled ? null : this.submit 65 | }, 'load') 66 | ) 67 | } 68 | }) 69 | 70 | -------------------------------------------------------------------------------- /web/bootstrap/less/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | 23 | // Bar itself 24 | // ------------------------- 25 | 26 | // Outer container 27 | .progress { 28 | overflow: hidden; 29 | height: @line-height-computed; 30 | margin-bottom: @line-height-computed; 31 | background-color: @progress-bg; 32 | border-radius: @border-radius-base; 33 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 34 | } 35 | 36 | // Bar of progress 37 | .progress-bar { 38 | float: left; 39 | width: 0%; 40 | height: 100%; 41 | font-size: @font-size-small; 42 | line-height: @line-height-computed; 43 | color: @progress-bar-color; 44 | text-align: center; 45 | background-color: @progress-bar-bg; 46 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 47 | .transition(width .6s ease); 48 | } 49 | 50 | // Striped bars 51 | .progress-striped .progress-bar { 52 | #gradient > .striped(); 53 | background-size: 40px 40px; 54 | } 55 | 56 | // Call animation for the active one 57 | .progress.active .progress-bar { 58 | .animation(progress-bar-stripes 2s linear infinite); 59 | } 60 | 61 | 62 | 63 | // Variations 64 | // ------------------------- 65 | 66 | .progress-bar-success { 67 | .progress-bar-variant(@progress-bar-success-bg); 68 | } 69 | 70 | .progress-bar-info { 71 | .progress-bar-variant(@progress-bar-info-bg); 72 | } 73 | 74 | .progress-bar-warning { 75 | .progress-bar-variant(@progress-bar-warning-bg); 76 | } 77 | 78 | .progress-bar-danger { 79 | .progress-bar-variant(@progress-bar-danger-bg); 80 | } 81 | -------------------------------------------------------------------------------- /lib/components/comments.js: -------------------------------------------------------------------------------- 1 | 2 | var Comment = require('./comment') 3 | , d = React.DOM 4 | 5 | /* 6 | * Loads the comments from github. 7 | * 8 | * Child components: 9 | * - list of 'Comment's 10 | */ 11 | var Comments = module.exports = React.createClass({ 12 | // react api 13 | getDefaultProps: function () { 14 | return { 15 | url: null, 16 | count: 0 17 | } 18 | }, 19 | getInitialState: function () { 20 | return { 21 | comments: [], 22 | loading: false, 23 | error: false 24 | } 25 | }, 26 | componentWillMount: function () { 27 | if (this.props.url) this.load() 28 | }, 29 | componentDidUpdate: function (oldprops, oldstate) { 30 | if (oldprops.url !== this.props.url) this.load() 31 | }, 32 | 33 | // loading data 34 | load: function () { 35 | if (this.props.count === 0) { 36 | this.setState({error: false, comments: []}) 37 | return // no comments to load 38 | } 39 | // XXX I don't handle cancelling a request that may still be in 40 | // progress... 41 | this.setState({error: false, loading: true, comments: []}) 42 | $.get(this.props.url, this.gotData, 'json').fail(this.fail) 43 | }, 44 | gotData: function (data) { 45 | this.setState({comments: data, loading: false, error: false}) 46 | }, 47 | fail: function (reason) { 48 | console.error('Comment load fail', this.props.url, reason) 49 | this.setState({error: reason || true, loading: false}) 50 | }, 51 | 52 | render: function () { 53 | if (this.state.error) { 54 | return d.div({className: 'comments'}, 'Failed to load comments!') 55 | } 56 | if (this.state.loading) { 57 | return d.div({className: 'comments loading'}, 'Loading ' + this.props.count + ' comments...') 58 | } 59 | if (!this.state.comments.length) { 60 | return d.div({className: 'comments'}) 61 | } 62 | return d.ul( 63 | {className: 'comments'}, 64 | this.state.comments.map(function (comment) { 65 | return Comment({ 66 | model: comment, 67 | key: comment.id 68 | }) 69 | }) 70 | ) 71 | } 72 | }) 73 | -------------------------------------------------------------------------------- /web/bootstrap/less/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | // Set the container width, and override it for fixed navbars in media queries 6 | .container { 7 | .container-fixed(); 8 | 9 | @media (min-width: @screen-sm) { 10 | width: @container-sm; 11 | } 12 | @media (min-width: @screen-md) { 13 | width: @container-md; 14 | } 15 | @media (min-width: @screen-lg-min) { 16 | width: @container-lg; 17 | } 18 | } 19 | 20 | // mobile first defaults 21 | .row { 22 | .make-row(); 23 | } 24 | 25 | // Common styles for small and large grid columns 26 | .make-grid-columns(); 27 | 28 | 29 | // Extra small grid 30 | // 31 | // Columns, offsets, pushes, and pulls for extra small devices like 32 | // smartphones. 33 | 34 | .make-grid-columns-float(xs); 35 | .make-grid(@grid-columns, xs, width); 36 | .make-grid(@grid-columns, xs, pull); 37 | .make-grid(@grid-columns, xs, push); 38 | .make-grid(@grid-columns, xs, offset); 39 | 40 | 41 | // Small grid 42 | // 43 | // Columns, offsets, pushes, and pulls for the small device range, from phones 44 | // to tablets. 45 | 46 | @media (min-width: @screen-sm-min) { 47 | .make-grid-columns-float(sm); 48 | .make-grid(@grid-columns, sm, width); 49 | .make-grid(@grid-columns, sm, pull); 50 | .make-grid(@grid-columns, sm, push); 51 | .make-grid(@grid-columns, sm, offset); 52 | } 53 | 54 | 55 | // Medium grid 56 | // 57 | // Columns, offsets, pushes, and pulls for the desktop device range. 58 | 59 | @media (min-width: @screen-md-min) { 60 | .make-grid-columns-float(md); 61 | .make-grid(@grid-columns, md, width); 62 | .make-grid(@grid-columns, md, pull); 63 | .make-grid(@grid-columns, md, push); 64 | .make-grid(@grid-columns, md, offset); 65 | } 66 | 67 | 68 | // Large grid 69 | // 70 | // Columns, offsets, pushes, and pulls for the large desktop device range. 71 | 72 | @media (min-width: @screen-lg-min) { 73 | .make-grid-columns-float(lg); 74 | .make-grid(@grid-columns, lg, width); 75 | .make-grid(@grid-columns, lg, pull); 76 | .make-grid(@grid-columns, lg, push); 77 | .make-grid(@grid-columns, lg, offset); 78 | } 79 | 80 | -------------------------------------------------------------------------------- /lib/pages/issue.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | var Comments = require('../components/comments') 3 | , Labels = require('../components/labels') 4 | , RecentTime = require('../components/recent-time') 5 | , utils = require('../utils') 6 | 7 | var Issue = module.exports = React.createClass({ 8 | getDefaultProps: function () { 9 | return { 10 | issue: null 11 | } 12 | }, 13 | render: function () { 14 | if (!this.props.issue) { 15 | return ( 16 | React.DOM.div( {className:"page issue-page"}, 17 | React.DOM.h1(null, this.props.loading ? 'Loading...' : 'Issue not found'), 18 | React.DOM.a( {className:"issue-page__back", href:this.props.backLink}, "Back") 19 | ) 20 | ) 21 | } 22 | var issue = this.props.issue 23 | , user = issue.user 24 | 25 | return ( 26 | React.DOM.div( {className:"page issue-page"}, 27 | React.DOM.header( {className:"issue-page__header"}, 28 | React.DOM.h4( {className:"issue-header__main"}, 29 | React.DOM.span( {className:"issue-page__state issue-state issue-state--" + issue.state}, 30 | issue.state/* TODO capitalize? */ 31 | ), 32 | React.DOM.a( {className:"issue-page__back", href:this.props.backLink}, "Back"), 33 | React.DOM.a( {href:issue.html_url, className:"issue-page__header__title"}, '#' + issue.number + ' ' + issue.title) 34 | ), 35 | React.DOM.div( {className:"issue-header__sub"}, 36 | Labels( {className:"issue-header__labels", labels:issue.labels}), 37 | React.DOM.a( {className:"issue-page__user", href:user.html_url}, 38 | React.DOM.img( {className:"user__avatar", 39 | src:user.avatar_url}), 40 | React.DOM.span( {className:"user__login user__login--avatar-left"}, user.login) 41 | ), 42 | RecentTime( {className:"issue__time", time:issue.created_at}) 43 | ) 44 | ), 45 | React.DOM.section( {className:"issue-page__body"}, 46 | utils.processBody(issue.body) 47 | ), 48 | Comments( {url:issue.comments_url, count:issue.comments}) 49 | ) 50 | ) 51 | } 52 | }) 53 | -------------------------------------------------------------------------------- /web/bootstrap/less/print.less: -------------------------------------------------------------------------------- 1 | // 2 | // Basic print styles 3 | // -------------------------------------------------- 4 | // Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css 5 | 6 | @media print { 7 | 8 | * { 9 | text-shadow: none !important; 10 | color: #000 !important; // Black prints faster: h5bp.com/s 11 | background: transparent !important; 12 | box-shadow: none !important; 13 | } 14 | 15 | a, 16 | a:visited { 17 | text-decoration: underline; 18 | } 19 | 20 | a[href]:after { 21 | content: " (" attr(href) ")"; 22 | } 23 | 24 | abbr[title]:after { 25 | content: " (" attr(title) ")"; 26 | } 27 | 28 | // Don't show links for images, or javascript/internal links 29 | a[href^="javascript:"]:after, 30 | a[href^="#"]:after { 31 | content: ""; 32 | } 33 | 34 | pre, 35 | blockquote { 36 | border: 1px solid #999; 37 | page-break-inside: avoid; 38 | } 39 | 40 | thead { 41 | display: table-header-group; // h5bp.com/t 42 | } 43 | 44 | tr, 45 | img { 46 | page-break-inside: avoid; 47 | } 48 | 49 | img { 50 | max-width: 100% !important; 51 | } 52 | 53 | @page { 54 | margin: 2cm .5cm; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 70 | // Once fixed, we can just straight up remove this. 71 | select { 72 | background: #fff !important; 73 | } 74 | 75 | // Bootstrap components 76 | .navbar { 77 | display: none; 78 | } 79 | .table { 80 | td, 81 | th { 82 | background-color: #fff !important; 83 | } 84 | } 85 | .btn, 86 | .dropup > .btn { 87 | > .caret { 88 | border-top-color: #000 !important; 89 | } 90 | } 91 | .label { 92 | border: 1px solid #000; 93 | } 94 | 95 | .table { 96 | border-collapse: collapse !important; 97 | } 98 | .table-bordered { 99 | th, 100 | td { 101 | border: 1px solid #ddd !important; 102 | } 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /web/bootstrap/less/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | background-color: @pagination-bg; 20 | border: 1px solid @pagination-border; 21 | margin-left: -1px; 22 | } 23 | &:first-child { 24 | > a, 25 | > span { 26 | margin-left: 0; 27 | .border-left-radius(@border-radius-base); 28 | } 29 | } 30 | &:last-child { 31 | > a, 32 | > span { 33 | .border-right-radius(@border-radius-base); 34 | } 35 | } 36 | } 37 | 38 | > li > a, 39 | > li > span { 40 | &:hover, 41 | &:focus { 42 | background-color: @pagination-hover-bg; 43 | } 44 | } 45 | 46 | > .active > a, 47 | > .active > span { 48 | &, 49 | &:hover, 50 | &:focus { 51 | z-index: 2; 52 | color: @pagination-active-color; 53 | background-color: @pagination-active-bg; 54 | border-color: @pagination-active-bg; 55 | cursor: default; 56 | } 57 | } 58 | 59 | > .disabled { 60 | > span, 61 | > span:hover, 62 | > span:focus, 63 | > a, 64 | > a:hover, 65 | > a:focus { 66 | color: @pagination-disabled-color; 67 | background-color: @pagination-bg; 68 | border-color: @pagination-border; 69 | cursor: not-allowed; 70 | } 71 | } 72 | } 73 | 74 | // Sizing 75 | // -------------------------------------------------- 76 | 77 | // Large 78 | .pagination-lg { 79 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 80 | } 81 | 82 | // Small 83 | .pagination-sm { 84 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 85 | } 86 | -------------------------------------------------------------------------------- /lib/pages/issue.jsx: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | var Comments = require('../components/comments') 3 | , Labels = require('../components/labels') 4 | , RecentTime = require('../components/recent-time') 5 | , utils = require('../utils') 6 | 7 | /** 8 | * Display a single issue 9 | * 10 | * Child components: 11 | * - RecentTime (display time in a "2 hours ago" fashion) 12 | * - Comments (load & display the comments) 13 | */ 14 | var Issue = module.exports = React.createClass({ 15 | getDefaultProps: function () { 16 | return { 17 | issue: null 18 | } 19 | }, 20 | render: function () { 21 | if (!this.props.issue) { 22 | return ( 23 |

24 |

{this.props.loading ? 'Loading...' : 'Issue not found'}

25 | Back 26 |
27 | ) 28 | } 29 | var issue = this.props.issue 30 | , user = issue.user 31 | 32 | return ( 33 |
34 |
35 |

36 | 37 | {issue.state/* TODO capitalize? */} 38 | 39 | Back 40 | {'#' + issue.number + ' ' + issue.title} 41 |

42 |
43 | 44 | 45 | 47 | {user.login} 48 | 49 | 50 |
51 |
52 |
53 | {utils.processBody(issue.body)} 54 |
55 | 56 |
57 | ) 58 | } 59 | }) 60 | -------------------------------------------------------------------------------- /web/bootstrap/less/list-group.less: -------------------------------------------------------------------------------- 1 | // 2 | // List groups 3 | // -------------------------------------------------- 4 | 5 | // Base class 6 | // 7 | // Easily usable on