houston-core 0.8.4 → 0.9.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +72 -78
  4. data/app/assets/javascripts/houston/app/models/role.coffee +4 -0
  5. data/app/assets/javascripts/houston/app/views/nested_resources.coffee +44 -0
  6. data/app/assets/javascripts/houston/app/views/team_roles_view.coffee +10 -0
  7. data/app/assets/javascripts/houston/application.js +3 -1
  8. data/app/assets/javascripts/houston/core/ajax_helpers.coffee +26 -0
  9. data/app/assets/javascripts/houston/core/app.coffee +0 -45
  10. data/app/assets/javascripts/houston/core/errors.coffee +1 -12
  11. data/app/assets/javascripts/houston/core/handlebars_helpers.coffee +8 -70
  12. data/app/assets/javascripts/houston/core/jquery_extensions.coffee +0 -138
  13. data/app/assets/javascripts/houston/core/timeline_helpers.coffee +44 -0
  14. data/app/assets/javascripts/houston/core/uploader_helpers.coffee +99 -0
  15. data/app/assets/javascripts/houston/vendor.js +26 -9
  16. data/app/assets/stylesheets/houston/application/actions.scss +22 -0
  17. data/app/assets/stylesheets/houston/application/navigation.scss +2 -2
  18. data/app/assets/stylesheets/houston/application/{freight_train.css.scss → nested_resources.scss} +1 -0
  19. data/app/assets/stylesheets/houston/core/alerts.scss +0 -4
  20. data/app/assets/stylesheets/houston/core/timeline.scss +204 -0
  21. data/app/assets/templates/houston/teams/roles/index.hbs +1 -0
  22. data/app/assets/templates/houston/teams/roles/show.hbs +19 -0
  23. data/app/channels/events_channel.rb +1 -1
  24. data/app/concerns/houston/props.rb +3 -2
  25. data/app/controllers/actions_controller.rb +8 -3
  26. data/app/controllers/application_controller.rb +9 -12
  27. data/app/controllers/authorizations_controller.rb +41 -14
  28. data/app/controllers/errors_controller.rb +3 -3
  29. data/app/controllers/project_follows_controller.rb +23 -0
  30. data/app/controllers/project_options_controller.rb +1 -1
  31. data/app/controllers/user_options_controller.rb +1 -1
  32. data/app/helpers/actions_helper.rb +12 -0
  33. data/app/helpers/application_helper.rb +0 -10
  34. data/app/helpers/layout_helper.rb +20 -0
  35. data/app/helpers/markdown_helper.rb +2 -10
  36. data/app/helpers/navigation_helper.rb +5 -5
  37. data/app/helpers/project_helper.rb +6 -0
  38. data/app/helpers/url_helper.rb +4 -4
  39. data/app/helpers/view_extensions_helper.rb +20 -0
  40. data/app/models/action.rb +61 -44
  41. data/app/models/authorization.rb +55 -10
  42. data/app/models/follow.rb +6 -0
  43. data/app/models/persistent_trigger.rb +11 -1
  44. data/app/models/project.rb +5 -27
  45. data/app/models/user.rb +15 -59
  46. data/app/presenters/project_presenter.rb +2 -2
  47. data/app/views/actions/_actions.html.erb +8 -5
  48. data/app/views/actions/index.html.erb +1 -1
  49. data/app/views/actions/running.html.erb +9 -15
  50. data/app/views/actions/show.html.erb +6 -3
  51. data/app/views/actions/unqueued.html.erb +41 -0
  52. data/app/views/authorizations/_form.html.erb +28 -16
  53. data/app/views/authorizations/index.html.erb +9 -4
  54. data/app/views/{oauth/providers/edit.html.erb → authorizations/oauth2_callback.html.erb} +3 -2
  55. data/app/views/devise/sessions/new.html.erb +0 -8
  56. data/app/views/errors/index.html.erb +9 -5
  57. data/app/views/layouts/_navigation.html.erb +9 -0
  58. data/app/views/layouts/application.html.erb +11 -6
  59. data/app/views/layouts/dashboard.html.erb +9 -0
  60. data/app/views/projects/_form.html.erb +7 -18
  61. data/app/views/projects/_header.html.erb +2 -6
  62. data/app/views/projects/index.html.erb +4 -4
  63. data/app/views/teams/_form.html.erb +7 -17
  64. data/app/views/teams/index.html.erb +1 -1
  65. data/app/views/users/_form.html.erb +1 -38
  66. data/config/application.rb +8 -5
  67. data/config/initializers/devise.rb +0 -14
  68. data/config/initializers/secret_token.rb +8 -13
  69. data/config/routes.rb +12 -28
  70. data/db/migrate/20130706141443_drop_deprecated_project_roles.rb +5 -1
  71. data/db/migrate/20170118005958_remove_antecedents_from_versions_of_tickets.rb +1 -1
  72. data/db/migrate/20170130011016_drop_users_environments_subscribed_to.rb +9 -0
  73. data/db/migrate/20170205004452_drop_settings.rb +12 -0
  74. data/db/migrate/20170206002030_drop_extension_hstore.rb +9 -0
  75. data/db/migrate/20170206002732_drop_legacy_columns_from_users.rb +10 -0
  76. data/db/migrate/20170209022159_rename_projects_color_to_color_name.rb +5 -0
  77. data/db/migrate/20170213001453_change_providers_from_models_to_extensions.rb +27 -0
  78. data/db/migrate/20170215012012_add_props_to_authorizations.rb +5 -0
  79. data/db/migrate/20170216041034_add_user_to_persistent_triggers.rb +5 -0
  80. data/db/migrate/20170226201504_create_follows.rb +20 -0
  81. data/db/migrate/20170301014051_drop_name_from_authorizations.rb +9 -0
  82. data/db/migrate/20170307032041_add_created_at_to_actions.rb +11 -0
  83. data/db/migrate/20170307035755_allow_actions_started_at_to_be_null.rb +5 -0
  84. data/db/migrate/20170310024505_replace_authorizations_provider_name_with_type.rb +12 -0
  85. data/db/migrate/20170329030329_drop_consumer_tokens.rb +9 -0
  86. data/db/structure.sql +187 -212
  87. data/houston-core.gemspec +10 -13
  88. data/lib/houston/boot.rb +1 -4
  89. data/lib/houston/boot/actions.rb +24 -21
  90. data/lib/houston/boot/configuration.rb +46 -113
  91. data/lib/houston/boot/extensions.rb +54 -341
  92. data/lib/houston/boot/extensions/deprecated.rb +194 -0
  93. data/lib/houston/boot/extensions/dsl.rb +99 -0
  94. data/lib/houston/boot/extensions/events.rb +81 -0
  95. data/lib/houston/boot/extensions/features.rb +42 -0
  96. data/lib/houston/boot/extensions/layout.rb +70 -0
  97. data/lib/houston/boot/extensions/navigation.rb +42 -0
  98. data/lib/houston/boot/extensions/oauth.rb +62 -0
  99. data/lib/houston/boot/extensions/serializers.rb +29 -0
  100. data/lib/houston/boot/extensions/view.rb +34 -0
  101. data/lib/houston/boot/observer.rb +10 -5
  102. data/{app/models/oauth → lib/houston/boot}/provider.rb +7 -5
  103. data/lib/houston/boot/running_as.rb +0 -5
  104. data/lib/houston/boot/serializer.rb +12 -6
  105. data/lib/houston/boot/{active_record_serializer.rb → serializers/active_record_serializer.rb} +0 -2
  106. data/lib/houston/boot/{readonly_hash_serializer.rb → serializers/readonly_hash_serializer.rb} +0 -2
  107. data/lib/houston/boot/timer.rb +10 -0
  108. data/lib/houston/boot/triggers.rb +27 -8
  109. data/lib/houston/version.rb +1 -1
  110. data/templates/new-instance/.gitignore +0 -4
  111. data/templates/new-instance/config/main.rb +8 -10
  112. data/templates/new-module/test/dummy/houston.rb +1 -0
  113. data/test/acceptance/layout_test.rb +58 -0
  114. data/test/acceptance/updating_props_test.rb +72 -0
  115. data/test/support/config.rb +1 -0
  116. data/test/unit/extensions/events_extension_test.rb +33 -0
  117. data/test/unit/extensions/layout_extension_test.rb +74 -0
  118. data/test/unit/extensions/navigation_extension_test.rb +62 -0
  119. data/test/unit/extensions/oauth_extension_test.rb +91 -0
  120. data/test/unit/extensions/project_features_extension_test.rb +79 -0
  121. data/test/unit/extensions/serializers_extension_test.rb +47 -0
  122. data/test/unit/extensions/view_extension_test.rb +98 -0
  123. data/test/unit/models/actions_test.rb +11 -5
  124. data/test/unit/models/configuration_test.rb +0 -8
  125. data/test/unit/models/observer_test.rb +16 -0
  126. data/test/unit/models/persistent_trigger_test.rb +29 -2
  127. data/test/unit/models/serializer_test.rb +6 -0
  128. data/test/unit/models/timer_test.rb +88 -0
  129. metadata +87 -168
  130. data/app/assets/font/octicons.eot +0 -0
  131. data/app/assets/font/octicons.svg +0 -198
  132. data/app/assets/font/octicons.ttf +0 -0
  133. data/app/assets/font/octicons.woff +0 -0
  134. data/app/assets/font/roboto-black-webfont.eot +0 -0
  135. data/app/assets/font/roboto-black-webfont.svg +0 -675
  136. data/app/assets/font/roboto-black-webfont.ttf +0 -0
  137. data/app/assets/font/roboto-black-webfont.woff +0 -0
  138. data/app/assets/font/roboto-blackitalic-webfont.eot +0 -0
  139. data/app/assets/font/roboto-blackitalic-webfont.svg +0 -677
  140. data/app/assets/font/roboto-blackitalic-webfont.ttf +0 -0
  141. data/app/assets/font/roboto-blackitalic-webfont.woff +0 -0
  142. data/app/assets/font/roboto-bold-webfont.eot +0 -0
  143. data/app/assets/font/roboto-bold-webfont.svg +0 -675
  144. data/app/assets/font/roboto-bold-webfont.ttf +0 -0
  145. data/app/assets/font/roboto-bold-webfont.woff +0 -0
  146. data/app/assets/font/roboto-bolditalic-webfont.eot +0 -0
  147. data/app/assets/font/roboto-bolditalic-webfont.svg +0 -677
  148. data/app/assets/font/roboto-bolditalic-webfont.ttf +0 -0
  149. data/app/assets/font/roboto-bolditalic-webfont.woff +0 -0
  150. data/app/assets/font/roboto-italic-webfont.eot +0 -0
  151. data/app/assets/font/roboto-italic-webfont.svg +0 -668
  152. data/app/assets/font/roboto-italic-webfont.ttf +0 -0
  153. data/app/assets/font/roboto-italic-webfont.woff +0 -0
  154. data/app/assets/font/roboto-light-webfont.eot +0 -0
  155. data/app/assets/font/roboto-light-webfont.svg +0 -666
  156. data/app/assets/font/roboto-light-webfont.ttf +0 -0
  157. data/app/assets/font/roboto-light-webfont.woff +0 -0
  158. data/app/assets/font/roboto-lightitalic-webfont.eot +0 -0
  159. data/app/assets/font/roboto-lightitalic-webfont.svg +0 -668
  160. data/app/assets/font/roboto-lightitalic-webfont.ttf +0 -0
  161. data/app/assets/font/roboto-lightitalic-webfont.woff +0 -0
  162. data/app/assets/font/roboto-medium-webfont.eot +0 -0
  163. data/app/assets/font/roboto-medium-webfont.svg +0 -675
  164. data/app/assets/font/roboto-medium-webfont.ttf +0 -0
  165. data/app/assets/font/roboto-medium-webfont.woff +0 -0
  166. data/app/assets/font/roboto-mediumitalic-webfont.eot +0 -0
  167. data/app/assets/font/roboto-mediumitalic-webfont.svg +0 -677
  168. data/app/assets/font/roboto-mediumitalic-webfont.ttf +0 -0
  169. data/app/assets/font/roboto-mediumitalic-webfont.woff +0 -0
  170. data/app/assets/font/roboto-regular-webfont.eot +0 -0
  171. data/app/assets/font/roboto-regular-webfont.svg +0 -666
  172. data/app/assets/font/roboto-regular-webfont.ttf +0 -0
  173. data/app/assets/font/roboto-regular-webfont.woff +0 -0
  174. data/app/assets/font/roboto-thin-webfont.eot +0 -0
  175. data/app/assets/font/roboto-thin-webfont.svg +0 -666
  176. data/app/assets/font/roboto-thin-webfont.ttf +0 -0
  177. data/app/assets/font/roboto-thin-webfont.woff +0 -0
  178. data/app/assets/font/roboto-thinitalic-webfont.eot +0 -0
  179. data/app/assets/font/roboto-thinitalic-webfont.svg +0 -668
  180. data/app/assets/font/roboto-thinitalic-webfont.ttf +0 -0
  181. data/app/assets/font/roboto-thinitalic-webfont.woff +0 -0
  182. data/app/assets/images/bug-fixed-128.png +0 -0
  183. data/app/assets/images/bug-fixed-32.png +0 -0
  184. data/app/assets/images/bug-fixed-48.png +0 -0
  185. data/app/assets/images/bug-new-128.png +0 -0
  186. data/app/assets/images/bug-new-32.png +0 -0
  187. data/app/assets/images/bug-new-48.png +0 -0
  188. data/app/assets/images/bug-open-32.png +0 -0
  189. data/app/assets/images/bug-zero-128.png +0 -0
  190. data/app/assets/images/bug-zero-48.png +0 -0
  191. data/app/assets/images/drag-grip.png +0 -0
  192. data/app/assets/javascripts/houston/core/burndown_chart.coffee +0 -111
  193. data/app/assets/javascripts/houston/core/stacked_area_graph.coffee +0 -113
  194. data/app/assets/javascripts/houston/core/stacked_bar_graph.coffee +0 -108
  195. data/app/assets/stylesheets/houston/application/project_tiles.scss +0 -26
  196. data/app/assets/stylesheets/houston/application/tips.scss +0 -5
  197. data/app/assets/stylesheets/houston/core/octicons-icons.scss +0 -221
  198. data/app/assets/stylesheets/houston/core/octicons.scss.erb +0 -9
  199. data/app/assets/stylesheets/houston/core/roboto.scss.erb +0 -131
  200. data/app/concerns/historical_weekly_stats.rb +0 -15
  201. data/app/concerns/nosync.rb +0 -21
  202. data/app/controllers/oauth/providers_controller.rb +0 -45
  203. data/app/controllers/project_roles_controller.rb +0 -22
  204. data/app/controllers/settings_controller.rb +0 -14
  205. data/app/controllers/tester_bar_controller.rb +0 -12
  206. data/app/controllers/user_credentials_controller.rb +0 -24
  207. data/app/models/role.rb +0 -33
  208. data/app/models/setting.rb +0 -10
  209. data/app/models/settings.rb +0 -38
  210. data/app/models/slackdown.rb +0 -23
  211. data/app/models/user_credentials.rb +0 -27
  212. data/app/views/errors/_actions.html.erb +0 -17
  213. data/app/views/layouts/_tester_bar.html.erb +0 -6
  214. data/app/views/layouts/minimal.html.erb +0 -50
  215. data/app/views/layouts/naked.html.erb +0 -47
  216. data/app/views/layouts/naked_dashboard.html.erb +0 -50
  217. data/app/views/oauth/providers/_form.html.erb +0 -54
  218. data/app/views/oauth/providers/index.html.erb +0 -41
  219. data/app/views/oauth/providers/new.html.erb +0 -7
  220. data/config/initializers/add_navigation_renderers.rb +0 -5
  221. data/config/initializers/vestal_versions.rb +0 -9
  222. data/db/migrate/20130519163615_create_user_credentials.rb +0 -18
  223. data/lib/houston/boot/events.rb +0 -10
  224. data/lib/tasks/keypair.rake +0 -17
  225. data/vendor/assets/javascripts/jquery.pjax.js +0 -817
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,111 +0,0 @@
1
- class Houston.BurndownChart
2
-
3
- constructor: ->
4
- @_margin = {top: 40, right: 0, bottom: 24, left: 50}
5
- @_selector = '#graph'
6
- @_height = 260
7
- @$el = $(@_selector)
8
- @_totalEffort = 0
9
- @_lines = {}
10
- @_regressions = {}
11
- $(window).resize (e)=>
12
- @render() if e.target is window
13
-
14
- margin: (@_margin)-> @
15
- height: (@_height)-> @
16
- selector: (@_selector)-> @$el = $(@_selector); @
17
- dateFormat: (@_dateFormat)-> @
18
- days: (@days)-> @
19
- totalEffort: (@_totalEffort)-> @
20
- addLine: (slug, data)-> @_lines[slug] = data; @
21
- addRegression: (slug, data)-> @_regressions[slug] = data; @
22
-
23
- render: ->
24
- width = @$el.width() || 960
25
- height = @_height
26
- graphWidth = width - @_margin.left - @_margin.right
27
- graphHeight = height - @_margin.top - @_margin.bottom
28
-
29
- totalEffort = @_totalEffort
30
- unless totalEffort
31
- for slug, data of @_lines
32
- totalEffort = data[0].effort if data[0] and data[0].effort > totalEffort
33
-
34
- formatDate = @_dateFormat || d3.time.format('%A')
35
-
36
- [min, max] = d3.extent(@days)
37
- x = d3.scale.ordinal().rangePoints([0, graphWidth], 0.75).domain(@days)
38
- y = d3.scale.linear().range([graphHeight, 0]).domain([0, totalEffort])
39
- rx = d3.scale.linear().range([x(min), x(max)]).domain([min, max])
40
-
41
- xAxis = d3.svg.axis()
42
- .scale(x)
43
- .orient('bottom')
44
- .tickFormat((d)=> formatDate(new Date(d)))
45
-
46
- yAxis = d3.svg.axis()
47
- .scale(y)
48
- .orient('left')
49
-
50
- line = d3.svg.line()
51
- .interpolate('linear')
52
- .x((d)-> x(d.day))
53
- .y((d)-> y(d.effort))
54
-
55
- @$el.empty()
56
- svg = d3.select(@_selector).append('svg')
57
- .attr('width', width)
58
- .attr('height', height)
59
- .append('g')
60
- .attr('transform', "translate(#{@_margin.left},#{@_margin.top})")
61
-
62
- svg.append('g')
63
- .attr('class', 'x axis')
64
- .attr('transform', "translate(0,#{graphHeight})")
65
- .call(xAxis)
66
-
67
- svg.append('g')
68
- .attr('class', 'y axis')
69
- .call(yAxis)
70
- .append('text')
71
- .attr('transform', 'rotate(-90)')
72
- .attr('y', -45)
73
- .attr('x', 160 - height)
74
- .attr('dy', '.71em')
75
- .attr('class', 'legend')
76
- .style('text-anchor', 'end')
77
- .text('Points Remaining')
78
-
79
-
80
-
81
- for slug, data of @_regressions
82
- svg.append('line')
83
- .attr('class', "regression regression-#{slug}")
84
- .attr('x1', rx(data.x1))
85
- .attr('y1', y(data.y1))
86
- .attr('x2', rx(data.x2))
87
- .attr('y2', y(data.y2))
88
-
89
-
90
-
91
- for slug, data of @_lines
92
- svg.append('path')
93
- .attr('class', "line line-#{slug}")
94
- .attr('d', line(data))
95
-
96
- svg.selectAll("circle.circle-#{slug}")
97
- .data(data)
98
- .enter()
99
- .append('circle')
100
- .attr('class', "circle-#{slug}")
101
- .attr('r', 5)
102
- .attr('cx', (d)-> x(d.day))
103
- .attr('cy', (d)-> y(d.effort))
104
-
105
- svg.selectAll(".effort-remaining.effort-#{slug}")
106
- .data(data)
107
- .enter()
108
- .append('text')
109
- .text((d) -> d.effort)
110
- .attr('class', "effort-remaining effort-#{slug}")
111
- .attr('transform', (d)-> "translate(#{x(d.day) + 5.5}, #{y(d.effort) - 10}) rotate(-75)")
@@ -1,113 +0,0 @@
1
- class Houston.StackedAreaGraph
2
-
3
- constructor: ->
4
- @_margin = {top: 10, right: 10, bottom: 25, left: 50}
5
- @_width = 960
6
- @_height = 260
7
- @_data = []
8
- @_labels = []
9
- @_lines = []
10
- @_colors = ['rgb(31, 119, 180)', 'rgb(174, 199, 232)', 'rgb(255, 127, 14)', 'rgb(255, 187, 120)', 'rgb(44, 160, 44)']
11
- @_axes = ['x', 'y']
12
-
13
- margin: (@_margin)-> @
14
- width: (@_width)-> @
15
- height: (@_height)-> @
16
- selector: (@_selector)-> @
17
- data: (@_data)-> @
18
- labels: (@_labels)-> @
19
- colors: (@_colors)-> @
20
- addLine: (line)-> @_lines.push(line); @
21
- axes: (@_axes)-> @
22
- domain: (@_domain)-> @
23
-
24
-
25
- render: ->
26
- graphWidth = @_width - @_margin.left - @_margin.right
27
- graphHeight = @_height - @_margin.top - @_margin.bottom
28
-
29
- formatDate = d3.time.format('%A')
30
-
31
- @x = x = d3.time.scale().range([0, graphWidth])
32
- @y = y = d3.scale.linear().range([graphHeight, 0])
33
-
34
- xAxis = d3.svg.axis()
35
- .scale(x)
36
- .orient('bottom')
37
-
38
- yAxis = d3.svg.axis()
39
- .scale(y)
40
- .orient('left')
41
-
42
- color = d3.scale.ordinal().range(@_colors).domain(@_labels)
43
-
44
- area = d3.svg.area()
45
- .interpolate('linear')
46
- .x((d)-> x(d.date))
47
- .y0((d)-> y(d.y0))
48
- .y1((d)-> y(d.y0 + d.y))
49
-
50
- line = d3.svg.area()
51
- .interpolate('linear')
52
- .x((d)-> x(d.date))
53
- .y((d)-> y(d.y))
54
-
55
- stack = d3.layout.stack()
56
- .values((d)-> d.values)
57
-
58
- data = stack [0...@_labels.length].map (i)=>
59
- name: @_labels[i]
60
- values: @_data.map (d)->
61
- date: new Date(d[0])
62
- y: d[i + 1]
63
-
64
- x.domain d3.extent(data[0].values, (d)-> d.date)
65
- y.domain @_domain or [0, d3.max(data[@_labels.length - 1].values, (d)-> d.y + d.y0)]
66
-
67
- $(@_selector).empty()
68
- svg = d3.select(@_selector).append('svg')
69
- .attr('width', @_width)
70
- .attr('height', @_height)
71
- .append('g')
72
- .attr('transform', "translate(#{@_margin.left},#{@_margin.top})")
73
-
74
- if 'x' in @_axes
75
- svg.append('g')
76
- .attr('class', 'x axis')
77
- .attr('transform', "translate(0,#{graphHeight})")
78
- .call(xAxis)
79
-
80
- if 'y' in @_axes
81
- svg.append('g')
82
- .attr('class', 'y axis')
83
- .call(yAxis)
84
-
85
- section = svg.selectAll('.section').data(data)
86
-
87
- section.enter()
88
- .append('g')
89
- .attr('class', 'section')
90
-
91
- section.append('path')
92
- .attr('class', 'area')
93
- .attr('d', (d)-> area(d.values))
94
- .style('fill', (d)-> color(d.name))
95
-
96
- for data in @_lines
97
- point.date = new Date(point.date) for point in data
98
- svg.append('path')
99
- .attr('class', 'line')
100
- .attr('d', line(data))
101
- .attr('style', 'stroke: #f00; stroke-width: 2px')
102
-
103
- $legend = $('<dl class="legend"></dl>').appendTo(@_selector)
104
- for i in [0...@_labels.length]
105
- label = @_labels[i]
106
- color = @_colors[i]
107
- $legend.append "<dt class=\"circle\" style=\"background: #{color}\"></dt><dd>#{label}</dd>"
108
-
109
- # legend = svg.append("g")
110
- # .attr("class","legend")
111
- # .attr("transform","translate(50,30)")
112
- # .style("font-size","12px")
113
- # .call(d3.legend)
@@ -1,108 +0,0 @@
1
- class Houston.StackedBarGraph
2
-
3
- constructor: ->
4
- @_margin = {top: 0, right: 80, bottom: 40, left: 50}
5
- @_width = 960
6
- @_height = 260
7
- @_data = []
8
- @_legend = true
9
- @_labels = []
10
- @_colors = ['rgb(31, 119, 180)', 'rgb(174, 199, 232)', 'rgb(255, 127, 14)', 'rgb(255, 187, 120)', 'rgb(44, 160, 44)']
11
- @_axes = ['x', 'y']
12
-
13
- legend: (@_legend)-> @
14
- margin: (@_margin)-> @
15
- width: (@_width)-> @
16
- height: (@_height)-> @
17
- selector: (@_selector)-> @
18
- data: (@_data)-> @
19
- labels: (@_labels)-> @
20
- colors: (@_colors)-> @
21
- range: (@_range)-> @
22
- axes: (@_axes)-> @
23
- yTicks: (@_yTicks)-> @
24
-
25
- render: ->
26
- graphWidth = @_width - @_margin.left - @_margin.right
27
- graphHeight = @_height - @_margin.top - @_margin.bottom
28
-
29
- formatDate = d3.time.format('%A')
30
-
31
- x = d3.scale.ordinal().rangeRoundBands([0, graphWidth], 0.15)
32
- y = d3.scale.linear().range([graphHeight, 0])
33
-
34
- xAxis = d3.svg.axis()
35
- .scale(x)
36
- .orient('bottom')
37
- .tickFormat(d3.time.format('%b %-d'))
38
-
39
- yAxis = d3.svg.axis()
40
- .scale(y)
41
- .orient('left')
42
- yAxis.tickValues(@_yTicks) if @_yTicks
43
-
44
- color = d3.scale.ordinal().range(@_colors).domain(@_labels)
45
-
46
- stack = d3.layout.stack()
47
- .values((d)-> d.values)
48
-
49
- data = stack [0...@_labels.length].map (i)=>
50
- name: @_labels[i]
51
- values: @_data.map (d)=>
52
- name: @_labels[i]
53
- date: new Date(d[0])
54
- y: d[i + 1] ? 0
55
-
56
- x.domain _.map(data[0].values, (d)-> d.date)
57
- max = d3.max(data[@_labels.length - 1].values, (d)-> d.y + d.y0)
58
- max = d3.max([max, @_range[1]]) if @_range
59
- y.domain [0, max]
60
-
61
- $(@_selector).empty()
62
- svg = d3.select(@_selector).append('svg')
63
- .attr('width', @_width)
64
- .attr('height', @_height)
65
- .append('g')
66
- .attr('transform', "translate(#{@_margin.left},#{@_margin.top})")
67
-
68
- if 'x' in @_axes
69
- svg.append('g')
70
- .attr('class', 'x axis')
71
- .attr('transform', "translate(0,#{graphHeight})")
72
- .call(xAxis)
73
-
74
- if 'y' in @_axes
75
- svg.append('g')
76
- .attr('class', 'y axis')
77
- .call(yAxis)
78
-
79
- section = svg.selectAll('.section')
80
- .data(x.domain())
81
-
82
- section.enter()
83
- .append('g')
84
- .attr('class', 'section')
85
- .attr('transform', (date)-> "translate(#{x(date)},0)")
86
-
87
- section.selectAll('rect')
88
- .data (date, i)->
89
- for bar in data
90
- name: bar.name
91
- y1: bar.values[i].y0 + bar.values[i].y
92
- y0: bar.values[i].y0
93
- .enter()
94
- .append('rect')
95
- .attr('class', 'bar')
96
- .attr('width', x.rangeBand())
97
- .attr('y', (d)-> y(d.y1))
98
- .attr('height', (d)-> y(d.y0) - y(d.y1))
99
- .style('fill', (d)-> color(d.name))
100
-
101
- if @_legend
102
- $legend = $('<dl class="legend"></dl>').appendTo(@_selector)
103
- for i in [0...@_labels.length]
104
- label = @_labels[i]
105
- color = @_colors[i]
106
- $legend.append "<dt class=\"circle\" style=\"background: #{color}\"></dt><dd>#{label}</dd>"
107
-
108
- @
@@ -1,26 +0,0 @@
1
- .project-tiles {
2
- .project-tile {
3
- display: inline-block;
4
- border-radius: 0.25em;
5
- padding: 1.5em 2em;
6
- width: 8em;
7
- height: 1em;
8
- line-height: 1em;
9
- text-align: center;
10
- margin: 0.25em;
11
- font-size: 1.25em;
12
- font-weight: 200;
13
- color: black;
14
- background-color: #efefef;
15
-
16
- transition-property: background-color;
17
- transition-duration: 0.5s;
18
- transition-timing-function: cubic-bezier(0,1,.96,.64);
19
-
20
- &:hover {
21
- color: white;
22
- text-decoration: none;
23
- transition-property: none;
24
- }
25
- }
26
- }
@@ -1,5 +0,0 @@
1
- .tip {
2
- margin: 2em 0.25em 0;
3
-
4
- h6 { margin: 0; padding: 0; }
5
- }
@@ -1,221 +0,0 @@
1
-
2
- // .octicon is optimized for 16px.
3
- // .mega-octicon is optimized for 32px but can be used larger.
4
- .octicon, .mega-octicon {
5
- font: normal normal normal 16px/1 octicons;
6
- display: inline-block;
7
- text-decoration: none;
8
- text-rendering: auto;
9
- -webkit-font-smoothing: antialiased;
10
- -moz-osx-font-smoothing: grayscale;
11
- -webkit-user-select: none;
12
- -moz-user-select: none;
13
- -ms-user-select: none;
14
- user-select: none;
15
- }
16
- .mega-octicon { font-size: 32px; }
17
-
18
- .octicon-alert:before { content: '\f02d'} /*  */
19
- .octicon-alignment-align:before { content: '\f08a'} /*  */
20
- .octicon-alignment-aligned-to:before { content: '\f08e'} /*  */
21
- .octicon-alignment-unalign:before { content: '\f08b'} /*  */
22
- .octicon-arrow-down:before { content: '\f03f'} /*  */
23
- .octicon-arrow-left:before { content: '\f040'} /*  */
24
- .octicon-arrow-right:before { content: '\f03e'} /*  */
25
- .octicon-arrow-small-down:before { content: '\f0a0'} /*  */
26
- .octicon-arrow-small-left:before { content: '\f0a1'} /*  */
27
- .octicon-arrow-small-right:before { content: '\f071'} /*  */
28
- .octicon-arrow-small-up:before { content: '\f09f'} /*  */
29
- .octicon-arrow-up:before { content: '\f03d'} /*  */
30
- .octicon-beer:before { content: '\f069'} /*  */
31
- .octicon-book:before { content: '\f007'} /*  */
32
- .octicon-bookmark:before { content: '\f07b'} /*  */
33
- .octicon-briefcase:before { content: '\f0d3'} /*  */
34
- .octicon-broadcast:before { content: '\f048'} /*  */
35
- .octicon-browser:before { content: '\f0c5'} /*  */
36
- .octicon-bug:before { content: '\f091'} /*  */
37
- .octicon-calendar:before { content: '\f068'} /*  */
38
- .octicon-check:before { content: '\f03a'} /*  */
39
- .octicon-checklist:before { content: '\f076'} /*  */
40
- .octicon-chevron-down:before { content: '\f0a3'} /*  */
41
- .octicon-chevron-left:before { content: '\f0a4'} /*  */
42
- .octicon-chevron-right:before { content: '\f078'} /*  */
43
- .octicon-chevron-up:before { content: '\f0a2'} /*  */
44
- .octicon-circle-slash:before { content: '\f084'} /*  */
45
- .octicon-circuit-board:before { content: '\f0d6'} /*  */
46
- .octicon-clippy:before { content: '\f035'} /*  */
47
- .octicon-clock:before { content: '\f046'} /*  */
48
- .octicon-cloud-download:before { content: '\f00b'} /*  */
49
- .octicon-cloud-upload:before { content: '\f00c'} /*  */
50
- .octicon-code:before { content: '\f05f'} /*  */
51
- .octicon-color-mode:before { content: '\f065'} /*  */
52
- .octicon-comment-add:before,
53
- .octicon-comment:before { content: '\f02b'} /*  */
54
- .octicon-comment-discussion:before { content: '\f04f'} /*  */
55
- .octicon-credit-card:before { content: '\f045'} /*  */
56
- .octicon-dash:before { content: '\f0ca'} /*  */
57
- .octicon-dashboard:before { content: '\f07d'} /*  */
58
- .octicon-database:before { content: '\f096'} /*  */
59
- .octicon-device-camera:before { content: '\f056'} /*  */
60
- .octicon-device-camera-video:before { content: '\f057'} /*  */
61
- .octicon-device-desktop:before { content: '\f27c'} /*  */
62
- .octicon-device-mobile:before { content: '\f038'} /*  */
63
- .octicon-diff:before { content: '\f04d'} /*  */
64
- .octicon-diff-added:before { content: '\f06b'} /*  */
65
- .octicon-diff-ignored:before { content: '\f099'} /*  */
66
- .octicon-diff-modified:before { content: '\f06d'} /*  */
67
- .octicon-diff-removed:before { content: '\f06c'} /*  */
68
- .octicon-diff-renamed:before { content: '\f06e'} /*  */
69
- .octicon-ellipsis:before { content: '\f09a'} /*  */
70
- .octicon-eye-unwatch:before,
71
- .octicon-eye-watch:before,
72
- .octicon-eye:before { content: '\f04e'} /*  */
73
- .octicon-file-binary:before { content: '\f094'} /*  */
74
- .octicon-file-code:before { content: '\f010'} /*  */
75
- .octicon-file-directory:before { content: '\f016'} /*  */
76
- .octicon-file-media:before { content: '\f012'} /*  */
77
- .octicon-file-pdf:before { content: '\f014'} /*  */
78
- .octicon-file-submodule:before { content: '\f017'} /*  */
79
- .octicon-file-symlink-directory:before { content: '\f0b1'} /*  */
80
- .octicon-file-symlink-file:before { content: '\f0b0'} /*  */
81
- .octicon-file-text:before { content: '\f011'} /*  */
82
- .octicon-file-zip:before { content: '\f013'} /*  */
83
- .octicon-flame:before { content: '\f0d2'} /*  */
84
- .octicon-fold:before { content: '\f0cc'} /*  */
85
- .octicon-gear:before { content: '\f02f'} /*  */
86
- .octicon-gift:before { content: '\f042'} /*  */
87
- .octicon-gist:before { content: '\f00e'} /*  */
88
- .octicon-gist-secret:before { content: '\f08c'} /*  */
89
- .octicon-git-branch-create:before,
90
- .octicon-git-branch-delete:before,
91
- .octicon-git-branch:before { content: '\f020'} /*  */
92
- .octicon-git-commit:before { content: '\f01f'} /*  */
93
- .octicon-git-compare:before { content: '\f0ac'} /*  */
94
- .octicon-git-merge:before { content: '\f023'} /*  */
95
- .octicon-git-pull-request-abandoned:before,
96
- .octicon-git-pull-request:before { content: '\f009'} /*  */
97
- .octicon-globe:before { content: '\f0b6'} /*  */
98
- .octicon-graph:before { content: '\f043'} /*  */
99
- .octicon-heart:before { content: '\2665'} /* ♥ */
100
- .octicon-history:before { content: '\f07e'} /*  */
101
- .octicon-home:before { content: '\f08d'} /*  */
102
- .octicon-horizontal-rule:before { content: '\f070'} /*  */
103
- .octicon-hourglass:before { content: '\f09e'} /*  */
104
- .octicon-hubot:before { content: '\f09d'} /*  */
105
- .octicon-inbox:before { content: '\f0cf'} /*  */
106
- .octicon-info:before { content: '\f059'} /*  */
107
- .octicon-issue-closed:before { content: '\f028'} /*  */
108
- .octicon-issue-opened:before { content: '\f026'} /*  */
109
- .octicon-issue-reopened:before { content: '\f027'} /*  */
110
- .octicon-jersey:before { content: '\f019'} /*  */
111
- .octicon-jump-down:before { content: '\f072'} /*  */
112
- .octicon-jump-left:before { content: '\f0a5'} /*  */
113
- .octicon-jump-right:before { content: '\f0a6'} /*  */
114
- .octicon-jump-up:before { content: '\f073'} /*  */
115
- .octicon-key:before { content: '\f049'} /*  */
116
- .octicon-keyboard:before { content: '\f00d'} /*  */
117
- .octicon-law:before { content: '\f0d8'} /* */
118
- .octicon-light-bulb:before { content: '\f000'} /*  */
119
- .octicon-link:before { content: '\f05c'} /*  */
120
- .octicon-link-external:before { content: '\f07f'} /*  */
121
- .octicon-list-ordered:before { content: '\f062'} /*  */
122
- .octicon-list-unordered:before { content: '\f061'} /*  */
123
- .octicon-location:before { content: '\f060'} /*  */
124
- .octicon-gist-private:before,
125
- .octicon-mirror-private:before,
126
- .octicon-git-fork-private:before,
127
- .octicon-lock:before { content: '\f06a'} /*  */
128
- .octicon-logo-github:before { content: '\f092'} /*  */
129
- .octicon-mail:before { content: '\f03b'} /*  */
130
- .octicon-mail-read:before { content: '\f03c'} /*  */
131
- .octicon-mail-reply:before { content: '\f051'} /*  */
132
- .octicon-mark-github:before { content: '\f00a'} /*  */
133
- .octicon-markdown:before { content: '\f0c9'} /*  */
134
- .octicon-megaphone:before { content: '\f077'} /*  */
135
- .octicon-mention:before { content: '\f0be'} /*  */
136
- .octicon-microscope:before { content: '\f089'} /*  */
137
- .octicon-milestone:before { content: '\f075'} /*  */
138
- .octicon-mirror-public:before,
139
- .octicon-mirror:before { content: '\f024'} /*  */
140
- .octicon-mortar-board:before { content: '\f0d7'} /* */
141
- .octicon-move-down:before { content: '\f0a8'} /*  */
142
- .octicon-move-left:before { content: '\f074'} /*  */
143
- .octicon-move-right:before { content: '\f0a9'} /*  */
144
- .octicon-move-up:before { content: '\f0a7'} /*  */
145
- .octicon-mute:before { content: '\f080'} /*  */
146
- .octicon-no-newline:before { content: '\f09c'} /*  */
147
- .octicon-octoface:before { content: '\f008'} /*  */
148
- .octicon-organization:before { content: '\f037'} /*  */
149
- .octicon-package:before { content: '\f0c4'} /*  */
150
- .octicon-paintcan:before { content: '\f0d1'} /*  */
151
- .octicon-pencil:before { content: '\f058'} /*  */
152
- .octicon-person-add:before,
153
- .octicon-person-follow:before,
154
- .octicon-person:before { content: '\f018'} /*  */
155
- .octicon-pin:before { content: '\f041'} /*  */
156
- .octicon-playback-fast-forward:before { content: '\f0bd'} /*  */
157
- .octicon-playback-pause:before { content: '\f0bb'} /*  */
158
- .octicon-playback-play:before { content: '\f0bf'} /*  */
159
- .octicon-playback-rewind:before { content: '\f0bc'} /*  */
160
- .octicon-plug:before { content: '\f0d4'} /*  */
161
- .octicon-repo-create:before,
162
- .octicon-gist-new:before,
163
- .octicon-file-directory-create:before,
164
- .octicon-file-add:before,
165
- .octicon-plus:before { content: '\f05d'} /*  */
166
- .octicon-podium:before { content: '\f0af'} /*  */
167
- .octicon-primitive-dot:before { content: '\f052'} /*  */
168
- .octicon-primitive-square:before { content: '\f053'} /*  */
169
- .octicon-pulse:before { content: '\f085'} /*  */
170
- .octicon-puzzle:before { content: '\f0c0'} /*  */
171
- .octicon-question:before { content: '\f02c'} /*  */
172
- .octicon-quote:before { content: '\f063'} /*  */
173
- .octicon-radio-tower:before { content: '\f030'} /*  */
174
- .octicon-repo-delete:before,
175
- .octicon-repo:before { content: '\f001'} /*  */
176
- .octicon-repo-clone:before { content: '\f04c'} /*  */
177
- .octicon-repo-force-push:before { content: '\f04a'} /*  */
178
- .octicon-gist-fork:before,
179
- .octicon-repo-forked:before { content: '\f002'} /*  */
180
- .octicon-repo-pull:before { content: '\f006'} /*  */
181
- .octicon-repo-push:before { content: '\f005'} /*  */
182
- .octicon-rocket:before { content: '\f033'} /*  */
183
- .octicon-rss:before { content: '\f034'} /*  */
184
- .octicon-ruby:before { content: '\f047'} /*  */
185
- .octicon-screen-full:before { content: '\f066'} /*  */
186
- .octicon-screen-normal:before { content: '\f067'} /*  */
187
- .octicon-search-save:before,
188
- .octicon-search:before { content: '\f02e'} /*  */
189
- .octicon-server:before { content: '\f097'} /*  */
190
- .octicon-settings:before { content: '\f07c'} /*  */
191
- .octicon-log-in:before,
192
- .octicon-sign-in:before { content: '\f036'} /*  */
193
- .octicon-log-out:before,
194
- .octicon-sign-out:before { content: '\f032'} /*  */
195
- .octicon-split:before { content: '\f0c6'} /*  */
196
- .octicon-squirrel:before { content: '\f0b2'} /*  */
197
- .octicon-star-add:before,
198
- .octicon-star-delete:before,
199
- .octicon-star:before { content: '\f02a'} /*  */
200
- .octicon-steps:before { content: '\f0c7'} /*  */
201
- .octicon-stop:before { content: '\f08f'} /*  */
202
- .octicon-repo-sync:before,
203
- .octicon-sync:before { content: '\f087'} /*  */
204
- .octicon-tag-remove:before,
205
- .octicon-tag-add:before,
206
- .octicon-tag:before { content: '\f015'} /*  */
207
- .octicon-telescope:before { content: '\f088'} /*  */
208
- .octicon-terminal:before { content: '\f0c8'} /*  */
209
- .octicon-three-bars:before { content: '\f05e'} /*  */
210
- .octicon-tools:before { content: '\f031'} /*  */
211
- .octicon-trashcan:before { content: '\f0d0'} /*  */
212
- .octicon-triangle-down:before { content: '\f05b'} /*  */
213
- .octicon-triangle-left:before { content: '\f044'} /*  */
214
- .octicon-triangle-right:before { content: '\f05a'} /*  */
215
- .octicon-triangle-up:before { content: '\f0aa'} /*  */
216
- .octicon-unfold:before { content: '\f039'} /*  */
217
- .octicon-unmute:before { content: '\f0ba'} /*  */
218
- .octicon-versions:before { content: '\f064'} /*  */
219
- .octicon-remove-close:before,
220
- .octicon-x:before { content: '\f081'} /*  */
221
- .octicon-zap:before { content: '\26A1'} /* ⚡ */