houston-roadmaps 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +358 -0
- data/MIT-LICENSE +20 -0
- data/README.md +31 -0
- data/Rakefile +25 -0
- data/app/assets/images/houston/roadmaps/.gitkeep +0 -0
- data/app/assets/javascripts/houston/roadmaps/app.coffee +2 -0
- data/app/assets/javascripts/houston/roadmaps/application.js +14 -0
- data/app/assets/javascripts/houston/roadmaps/handlebars_helpers.coffee +22 -0
- data/app/assets/javascripts/houston/roadmaps/jquery_extensions.coffee +4 -0
- data/app/assets/javascripts/houston/roadmaps/models/goal.coffee +11 -0
- data/app/assets/javascripts/houston/roadmaps/models/milestone.coffee +124 -0
- data/app/assets/javascripts/houston/roadmaps/models/roadmap.coffee +16 -0
- data/app/assets/javascripts/houston/roadmaps/models/viewport.coffee +3 -0
- data/app/assets/javascripts/houston/roadmaps/resize_listener.js +67 -0
- data/app/assets/javascripts/houston/roadmaps/views/_gantt_chart.coffee +224 -0
- data/app/assets/javascripts/houston/roadmaps/views/_show_milestone_view.coffee +204 -0
- data/app/assets/javascripts/houston/roadmaps/views/edit_gantt_chart.coffee +405 -0
- data/app/assets/javascripts/houston/roadmaps/views/edit_milestone_view.coffee +97 -0
- data/app/assets/javascripts/houston/roadmaps/views/edit_roadmap_view.coffee +80 -0
- data/app/assets/javascripts/houston/roadmaps/views/gantt_thumbnail_view.coffee +173 -0
- data/app/assets/javascripts/houston/roadmaps/views/goal_view.coffee +18 -0
- data/app/assets/javascripts/houston/roadmaps/views/project_goals_view.coffee +30 -0
- data/app/assets/javascripts/houston/roadmaps/views/roadmap_history_view.coffee +67 -0
- data/app/assets/javascripts/houston/roadmaps/views/roadmap_view.coffee +12 -0
- data/app/assets/javascripts/houston/roadmaps/views/roadmaps_view.coffee +29 -0
- data/app/assets/stylesheets/houston/roadmaps/application.css +13 -0
- data/app/assets/stylesheets/houston/roadmaps/colors.scss.erb +41 -0
- data/app/assets/stylesheets/houston/roadmaps/goals.scss +20 -0
- data/app/assets/stylesheets/houston/roadmaps/milestone.scss +58 -0
- data/app/assets/stylesheets/houston/roadmaps/roadmap.scss +276 -0
- data/app/assets/stylesheets/houston/roadmaps/roadmap_history.scss +42 -0
- data/app/assets/stylesheets/houston/roadmaps/roadmaps.scss +89 -0
- data/app/assets/templates/houston/roadmaps/goals/edit.hbs +6 -0
- data/app/assets/templates/houston/roadmaps/goals/index.hbs +9 -0
- data/app/assets/templates/houston/roadmaps/goals/new.hbs +27 -0
- data/app/assets/templates/houston/roadmaps/goals/show.hbs +6 -0
- data/app/assets/templates/houston/roadmaps/milestone/edit.hbs +67 -0
- data/app/assets/templates/houston/roadmaps/milestone/show.hbs +53 -0
- data/app/assets/templates/houston/roadmaps/milestone/ticket.hbs +28 -0
- data/app/assets/templates/houston/roadmaps/roadmap/goal.hbs +6 -0
- data/app/assets/templates/houston/roadmaps/roadmap/history.hbs +22 -0
- data/app/assets/templates/houston/roadmaps/roadmap/show.hbs +12 -0
- data/app/assets/templates/houston/roadmaps/roadmaps/index.hbs +2 -0
- data/app/assets/templates/houston/roadmaps/roadmaps/show.hbs +11 -0
- data/app/controllers/houston/roadmaps/api/v1/roadmap_controller.rb +20 -0
- data/app/controllers/houston/roadmaps/dashboard_controller.rb +34 -0
- data/app/controllers/houston/roadmaps/milestones_controller.rb +118 -0
- data/app/controllers/houston/roadmaps/project_goals_controller.rb +24 -0
- data/app/controllers/houston/roadmaps/roadmap_milestones_controller.rb +36 -0
- data/app/controllers/houston/roadmaps/roadmaps_controller.rb +77 -0
- data/app/helpers/houston/roadmaps/application_helper.rb +4 -0
- data/app/models/roadmap.rb +9 -0
- data/app/models/roadmap_commit.rb +35 -0
- data/app/models/roadmap_milestone.rb +29 -0
- data/app/models/roadmap_milestone_version.rb +8 -0
- data/app/presenters/houston/roadmaps/milestone_api_presenter.rb +27 -0
- data/app/presenters/houston/roadmaps/milestone_presenter.rb +74 -0
- data/app/presenters/houston/roadmaps/roadmap_milestone_presenter.rb +70 -0
- data/app/presenters/houston/roadmaps/roadmap_presenter.rb +37 -0
- data/app/presenters/houston/roadmaps/ticket_presenter.rb +20 -0
- data/app/views/houston/roadmaps/dashboard/show.html.erb +42 -0
- data/app/views/houston/roadmaps/milestones/show.html.erb +40 -0
- data/app/views/houston/roadmaps/project_goals/index.html.erb +42 -0
- data/app/views/houston/roadmaps/roadmaps/_form.html.erb +29 -0
- data/app/views/houston/roadmaps/roadmaps/edit.html.erb +8 -0
- data/app/views/houston/roadmaps/roadmaps/history.html.erb +41 -0
- data/app/views/houston/roadmaps/roadmaps/index.html.erb +24 -0
- data/app/views/houston/roadmaps/roadmaps/new.html.erb +7 -0
- data/app/views/houston/roadmaps/roadmaps/show.html.erb +27 -0
- data/app/views/houston/roadmaps/roadmaps/show_editable.html.erb +35 -0
- data/app/views/layouts/houston/roadmaps/application.html.erb +10 -0
- data/app/views/layouts/houston/roadmaps/dashboard.html.erb +9 -0
- data/bin/rails +8 -0
- data/config/database.yml +13 -0
- data/config/initializers/add_navigation_renderer.rb +13 -0
- data/config/routes.rb +37 -0
- data/db/.keep +0 -0
- data/db/migrate/20140831210254_add_band_to_milestones.rb +5 -0
- data/db/migrate/20140907212311_add_end_date_to_milestones.rb +19 -0
- data/db/migrate/20140916230539_add_locked_to_milestone.rb +5 -0
- data/db/migrate/20140927154728_add_closed_ticket_count_to_milestones.rb +11 -0
- data/db/migrate/20140929024130_create_roadmap_commits.rb +29 -0
- data/db/migrate/20141012023628_add_user_id_to_milestone_versions.rb +11 -0
- data/db/migrate/20150102192805_add_lanes_to_milestones.rb +5 -0
- data/db/migrate/20150119155145_add_goal_and_feedback_query_to_milestones.rb +6 -0
- data/db/migrate/20150524203903_add_project_id_to_roadmap_commits.rb +17 -0
- data/db/migrate/20150603203744_add_timestamps_to_roadmap_commits.rb +20 -0
- data/db/migrate/20160206214746_rename_roadmap_feature_to_milestones.rb +25 -0
- data/db/migrate/20160207154530_create_roadmaps.rb +125 -0
- data/db/structure.sql +2557 -0
- data/houston-roadmaps.gemspec +29 -0
- data/lib/houston-roadmaps.rb +1 -0
- data/lib/houston/roadmaps.rb +15 -0
- data/lib/houston/roadmaps/configuration.rb +14 -0
- data/lib/houston/roadmaps/engine.rb +27 -0
- data/lib/houston/roadmaps/milestone_ext.rb +14 -0
- data/lib/houston/roadmaps/project_ext.rb +20 -0
- data/lib/houston/roadmaps/railtie.rb +17 -0
- data/lib/houston/roadmaps/version.rb +5 -0
- data/lib/tasks/roadmap_tasks.rake +4 -0
- data/test/acceptance/houston_dummy_test.rb +17 -0
- data/test/dummy/houston.rb +23 -0
- data/test/fixtures/projects.yml +3 -0
- data/test/fixtures/users.yml +10 -0
- data/test/test_helper.rb +43 -0
- data/test/unit/fixtures_test.rb +11 -0
- metadata +227 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
class Houston::Roadmaps::RoadmapMilestonePresenter
|
2
|
+
|
3
|
+
def initialize(milestones)
|
4
|
+
@milestones = OneOrMany.new(milestones)
|
5
|
+
end
|
6
|
+
|
7
|
+
def as_json(*args)
|
8
|
+
@milestones.map(&method(:to_hash))
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_hash(milestone)
|
12
|
+
project = milestone.project
|
13
|
+
{ id: milestone.id,
|
14
|
+
name: milestone.name,
|
15
|
+
milestoneId: milestone.milestone_id,
|
16
|
+
projectId: project.id,
|
17
|
+
projectColor: project.color,
|
18
|
+
percentComplete: percent_complete(milestone),
|
19
|
+
completed: milestone.completed?,
|
20
|
+
band: milestone.band,
|
21
|
+
lanes: milestone.lanes,
|
22
|
+
startDate: milestone.start_date,
|
23
|
+
endDate: milestone.end_date,
|
24
|
+
removed: milestone.destroyed_at.present? }
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def percent_complete(milestone)
|
30
|
+
percent_complete_by_ticket.fetch(milestone.milestone_id, 0)
|
31
|
+
end
|
32
|
+
|
33
|
+
def percent_complete_by_ticket
|
34
|
+
@percent_complete_by_ticket ||= Hash[Milestone.connection.select_rows(<<-SQL)
|
35
|
+
SELECT
|
36
|
+
tickets.milestone_id,
|
37
|
+
tickets.id,
|
38
|
+
tickets.closed_at IS NOT NULL "closed",
|
39
|
+
all_tasks.count,
|
40
|
+
completed_tasks.count
|
41
|
+
FROM tickets
|
42
|
+
LEFT OUTER JOIN (
|
43
|
+
SELECT ticket_id, COUNT(id) "count"
|
44
|
+
FROM tasks
|
45
|
+
GROUP BY ticket_id)
|
46
|
+
AS all_tasks
|
47
|
+
ON all_tasks.ticket_id=tickets.id
|
48
|
+
LEFT OUTER JOIN (
|
49
|
+
SELECT ticket_id, COUNT(id) "count"
|
50
|
+
FROM tasks
|
51
|
+
WHERE tasks.completed_at IS NOT NULL
|
52
|
+
GROUP BY ticket_id)
|
53
|
+
AS completed_tasks
|
54
|
+
ON completed_tasks.ticket_id=tickets.id
|
55
|
+
WHERE tickets.destroyed_at IS NULL
|
56
|
+
AND tickets.milestone_id IN (#{milestone_ids.join(", ")})
|
57
|
+
SQL
|
58
|
+
.map { |milestone_id, _, closed, tasks, completed_tasks|
|
59
|
+
[ milestone_id.to_i,
|
60
|
+
closed == "t" ? 1.0 : (completed_tasks.to_f / (tasks.to_i + 1)) ] }
|
61
|
+
.group_by { |(milestone_id, _)| milestone_id }
|
62
|
+
.map { |(milestone_id, tickets)|
|
63
|
+
[milestone_id, (tickets.sum { |(_, percent)| percent } / tickets.length)] }]
|
64
|
+
end
|
65
|
+
|
66
|
+
def milestone_ids
|
67
|
+
@milestone_ids ||= Array(@milestones.map(&:milestone_id))
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class Houston::Roadmaps::RoadmapPresenter
|
2
|
+
|
3
|
+
def initialize(roadmaps)
|
4
|
+
@roadmaps = OneOrMany.new(roadmaps)
|
5
|
+
end
|
6
|
+
|
7
|
+
def as_json(*args)
|
8
|
+
@roadmaps.map(&method(:to_hash))
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_hash(roadmap)
|
12
|
+
{ id: roadmap.id,
|
13
|
+
name: roadmap.name,
|
14
|
+
projects: roadmap.projects.map { |project| {
|
15
|
+
id: project.id,
|
16
|
+
name: project.name,
|
17
|
+
color: project.color } },
|
18
|
+
milestones: present_milestones(roadmap.milestones) }
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def present_milestones(milestones)
|
24
|
+
milestones.map do |milestone|
|
25
|
+
project = milestone.project
|
26
|
+
{ id: milestone.id,
|
27
|
+
name: milestone.name,
|
28
|
+
projectId: project.id,
|
29
|
+
projectColor: project.color,
|
30
|
+
band: milestone.band,
|
31
|
+
lanes: milestone.lanes,
|
32
|
+
startDate: milestone.start_date,
|
33
|
+
endDate: milestone.end_date }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class Houston::Roadmaps::TicketPresenter < TicketPresenter
|
2
|
+
include MarkdownHelper
|
3
|
+
|
4
|
+
def ticket_to_json(ticket)
|
5
|
+
reporter = ticket.reporter
|
6
|
+
super.merge(
|
7
|
+
tasks: ticket.tasks.map { |task| task.ticket = ticket; {
|
8
|
+
id: task.id,
|
9
|
+
description: task.description,
|
10
|
+
completedAt: task.completed_at,
|
11
|
+
number: task.number,
|
12
|
+
letter: task.letter,
|
13
|
+
effort: task.effort } },
|
14
|
+
reporter: reporter && {
|
15
|
+
email: reporter.email,
|
16
|
+
name: reporter.name },
|
17
|
+
firstReleaseAt: ticket.first_release_at)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<h1>Roadmap</h1>
|
2
|
+
|
3
|
+
<div id="roadmap" class="roadmap-dashboard"></div>
|
4
|
+
|
5
|
+
<% content_for :javascripts do %>
|
6
|
+
<script type="text/javascript">
|
7
|
+
$(function() {
|
8
|
+
Roadmaps.milestones = new Roadmaps.Milestones(
|
9
|
+
<%= raw Houston::Roadmaps::RoadmapMilestonePresenter.new(@milestones).to_json %>,
|
10
|
+
{parse: true});
|
11
|
+
|
12
|
+
var viewport = new Roadmaps.Viewport({
|
13
|
+
start: new Date(<%=raw @range.begin.to_json %>),
|
14
|
+
end: new Date(<%=raw @range.end.to_json %>)
|
15
|
+
});
|
16
|
+
|
17
|
+
view = new Roadmaps.RoadmapView({
|
18
|
+
milestones: Roadmaps.milestones,
|
19
|
+
showToday: <%= @show_today %>,
|
20
|
+
showThumbnail: false,
|
21
|
+
showProgress: true,
|
22
|
+
linkMilestones: true,
|
23
|
+
viewport: viewport
|
24
|
+
});
|
25
|
+
|
26
|
+
view.render();
|
27
|
+
|
28
|
+
new Refresher()
|
29
|
+
.container('#container')
|
30
|
+
.interval(45 * Duration.MINUTE)
|
31
|
+
.callback(function() {
|
32
|
+
$.getJSON(window.location.path, function(response) {
|
33
|
+
Roadmaps.milestones.reset(response.milestones, {parse: true});
|
34
|
+
viewport.set({
|
35
|
+
start: new Date(response.range.start),
|
36
|
+
end: new Date(response.range.end)
|
37
|
+
});
|
38
|
+
});
|
39
|
+
}).render();
|
40
|
+
});
|
41
|
+
</script>
|
42
|
+
<% end %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<%= render partial: "projects/header", locals: {project: @project, postfix: @milestone.name} %>
|
2
|
+
|
3
|
+
<div id="milestone_view" class="hide-completed <%= can?(:update_tickets, @milestone) ? "editable" : "readonly" %>"><div>
|
4
|
+
|
5
|
+
<% content_for :javascripts do %>
|
6
|
+
<script type="text/javascript">
|
7
|
+
$(function() {
|
8
|
+
var tickets = <%=raw Houston::Roadmaps::TicketPresenter.new(@tickets).to_json %>;
|
9
|
+
tickets = new Tickets(tickets, {parse: true});
|
10
|
+
|
11
|
+
var milestone = {
|
12
|
+
id: <%= @milestone.id %>,
|
13
|
+
goal: <%=raw @milestone.goal.to_json %> };
|
14
|
+
<% if defined?(Houston::Feedback) -%>
|
15
|
+
milestone.feedbackQuery = <%=raw @milestone.feedback_query.to_json %>;
|
16
|
+
<% end -%>
|
17
|
+
|
18
|
+
<% if can?(:update_tickets, @milestone) %>
|
19
|
+
new Roadmaps.EditMilestoneView({
|
20
|
+
el: $('#milestone_view')[0],
|
21
|
+
milestone: milestone,
|
22
|
+
project: <%=raw @project.slug.to_json %>,
|
23
|
+
projectTicketTracker: <%=raw @project.ticket_tracker_name.to_json %>,
|
24
|
+
tickets: tickets,
|
25
|
+
usesFeedback: <%= !!defined?(Houston::Feedback) %>,
|
26
|
+
openTickets: <%=raw Houston::Roadmaps::TicketPresenter.new(@open_tickets).to_json %>
|
27
|
+
}).render();
|
28
|
+
<% else %>
|
29
|
+
new Roadmaps.ShowMilestoneView({
|
30
|
+
el: $('#milestone_view')[0],
|
31
|
+
milestone: milestone,
|
32
|
+
project: <%=raw @project.slug.to_json %>,
|
33
|
+
projectTicketTracker: <%=raw @project.ticket_tracker_name.to_json %>,
|
34
|
+
tickets: tickets,
|
35
|
+
usesFeedback: <%= !!defined?(Houston::Feedback) %>,
|
36
|
+
}).render();
|
37
|
+
<% end %>
|
38
|
+
});
|
39
|
+
</script>
|
40
|
+
<% end %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h1 class="project-banner <%= @project.color %> space-below" data-project-slug="<%= @project.slug %>" data-project-color="<%= @project.color %>">
|
3
|
+
<small>Goals for</small>
|
4
|
+
<%= @project.name %>
|
5
|
+
|
6
|
+
<%= render partial: "projects/keyboard_shortcuts" %>
|
7
|
+
|
8
|
+
<%= link_to "#", id: "new_goal_button", class: "project-banner-btn" do %>
|
9
|
+
<i class="fa fa-flag-o"></i>
|
10
|
+
|
11
|
+
<span>
|
12
|
+
Add<br />
|
13
|
+
Goal
|
14
|
+
</span>
|
15
|
+
<% end %>
|
16
|
+
</h1>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<div id="project_goals_view"></div>
|
20
|
+
|
21
|
+
<% content_for :javascripts do %>
|
22
|
+
<script type="text/javascript">
|
23
|
+
$(function() {
|
24
|
+
var goals = <%= raw Houston::Roadmaps::MilestonePresenter.new(@milestones).to_json %>;
|
25
|
+
goals = new Roadmaps.Goals(goals, {parse: true});
|
26
|
+
|
27
|
+
new Roadmaps.ProjectGoalsView({
|
28
|
+
el: $('#project_goals_view')[0],
|
29
|
+
project: {
|
30
|
+
id: <%= @project.id %>,
|
31
|
+
slug: '<%= @project.slug %>',
|
32
|
+
color: '<%= @project.color %>' },
|
33
|
+
goals: goals,
|
34
|
+
can: {
|
35
|
+
create: <%= can?(:create, Milestone.new(project_id: @project.id)) %>,
|
36
|
+
update: <%= can?(:update, Milestone.new(project_id: @project.id)) %>,
|
37
|
+
destroy: <%= can?(:destroy, Milestone.new(project_id: @project.id)) %> }
|
38
|
+
}).render();
|
39
|
+
|
40
|
+
});
|
41
|
+
</script>
|
42
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<%= form_for @roadmap, :html => { :class => "form-horizontal" } do |f| %>
|
2
|
+
<fieldset>
|
3
|
+
<div class="control-group">
|
4
|
+
<%= f.label :name, :class => "control-label" %>
|
5
|
+
<div class="controls">
|
6
|
+
<%= f.text_field :name, :class => "text_field" %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="control-group">
|
11
|
+
<label class="control-label">Projects</label>
|
12
|
+
<div class="controls">
|
13
|
+
<% Project.unretired.with_feature("goals").pluck(:id, :name, :color).each do |project_id, project_name, project_color| %>
|
14
|
+
<label for="roadmap_project_ids_<%= project_id %>">
|
15
|
+
<%= check_box_tag "roadmap[project_ids][]", project_id, @roadmap.project_ids.member?(project_id),
|
16
|
+
id: "roadmap_project_ids_#{project_id}" %>
|
17
|
+
<b class="bubble <%= project_color %>"></b>
|
18
|
+
<%= project_name %>
|
19
|
+
</label>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="form-actions">
|
25
|
+
<%= f.submit nil, :class => "btn btn-primary" %>
|
26
|
+
<%= link_to "Cancel", (@roadmap.persisted? ? roadmap_path(@roadmap) : roadmaps_path), :class => "btn" %>
|
27
|
+
</div>
|
28
|
+
</fieldset>
|
29
|
+
<% end %>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h1 class="project-banner space-below">
|
3
|
+
<small>Roadmap:</small>
|
4
|
+
<%= @roadmap.name %>
|
5
|
+
|
6
|
+
<%= render partial: "projects/keyboard_shortcuts" %>
|
7
|
+
</h1>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div id="roadmap_history_view"></div>
|
11
|
+
|
12
|
+
<% content_for :javascripts do %>
|
13
|
+
<script type="text/javascript">
|
14
|
+
$(function() {
|
15
|
+
var milestones = <%= raw Houston::Roadmaps::RoadmapMilestonePresenter.new(@milestones).to_json %>;
|
16
|
+
new Roadmaps.RoadmapHistoryView({
|
17
|
+
milestones: milestones,
|
18
|
+
commitId: <%= @commit_id %>,
|
19
|
+
commits: <%=raw @commits.map { |commit| {
|
20
|
+
id: commit.id,
|
21
|
+
createdAt: commit.created_at,
|
22
|
+
user: commit.user && {
|
23
|
+
email: commit.user.email,
|
24
|
+
name: commit.user.name },
|
25
|
+
message: commit.message,
|
26
|
+
changes: commit.milestone_versions.map { |version| {
|
27
|
+
milestoneId: version.versioned_id,
|
28
|
+
number: version.number,
|
29
|
+
modifications: Hash[version.modifications.map { |key, change|
|
30
|
+
key = "startDate" if key == "start_date"
|
31
|
+
key = "endDate" if key == "end_date"
|
32
|
+
key, change = "removed", change.map(&:present?) if key == "destroyed_at"
|
33
|
+
[key, change]
|
34
|
+
}] } }
|
35
|
+
} }.to_json %>,
|
36
|
+
markers: <%=raw @markers.to_json %>,
|
37
|
+
showWeekends: true
|
38
|
+
}).render();
|
39
|
+
});
|
40
|
+
</script>
|
41
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h1 class="project-banner space-below">
|
3
|
+
Roadmaps
|
4
|
+
<%= link_to "New Roadmap", new_roadmap_path, :class => "btn btn-primary" if can?(:create, Roadmap) %>
|
5
|
+
|
6
|
+
<%= render partial: "projects/keyboard_shortcuts" %>
|
7
|
+
</h1>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div id="roadmaps_view"></div>
|
11
|
+
|
12
|
+
<% content_for :javascripts do %>
|
13
|
+
<script type="text/javascript">
|
14
|
+
$(function() {
|
15
|
+
var roadmaps = <%= raw Houston::Roadmaps::RoadmapPresenter.new(@roadmaps).to_json %>;
|
16
|
+
Roadmaps.all = new Roadmaps.Roadmaps(roadmaps, {parse: true});
|
17
|
+
|
18
|
+
new Roadmaps.RoadmapsView({
|
19
|
+
el: $('#roadmaps_view')[0],
|
20
|
+
roadmaps: Roadmaps.all
|
21
|
+
}).render();
|
22
|
+
});
|
23
|
+
</script>
|
24
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h1 class="project-banner space-below">
|
3
|
+
<small>Roadmap:</small>
|
4
|
+
<%= @roadmap.name %>
|
5
|
+
|
6
|
+
<%= render partial: "projects/keyboard_shortcuts" %>
|
7
|
+
</h1>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div id="roadmap" class="roadmap callout callout-banner"></div>
|
11
|
+
|
12
|
+
<% content_for :javascripts do %>
|
13
|
+
<script type="text/javascript">
|
14
|
+
$(function() {
|
15
|
+
var milestones = new Roadmaps.Milestones(
|
16
|
+
<%= raw Houston::Roadmaps::RoadmapMilestonePresenter.new(@milestones).to_json %>,
|
17
|
+
{parse: true});
|
18
|
+
|
19
|
+
new Roadmaps.RoadmapView({
|
20
|
+
el: $('#roadmap')[0],
|
21
|
+
milestones: milestones,
|
22
|
+
showWeekends: true,
|
23
|
+
linkMilestones: true
|
24
|
+
}).render();
|
25
|
+
});
|
26
|
+
</script>
|
27
|
+
<% end %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h1 class="project-banner space-below">
|
3
|
+
<small>Roadmap:</small>
|
4
|
+
<%= @roadmap.name %>
|
5
|
+
<%= link_to "Edit", edit_roadmap_path(@roadmap), class: "btn btn-primary" %>
|
6
|
+
|
7
|
+
<span class="buttons" style="float: right;">
|
8
|
+
<button id="reset_roadmap" class="btn">Reset</button>
|
9
|
+
<button id="save_roadmap" class="btn btn-primary">Save</button>
|
10
|
+
</span>
|
11
|
+
</h1>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div id="roadmap_view"></div>
|
15
|
+
|
16
|
+
<% content_for :javascripts do %>
|
17
|
+
<script type="text/javascript">
|
18
|
+
$(function() {
|
19
|
+
var milestones = new Roadmaps.Milestones(
|
20
|
+
<%= raw Houston::Roadmaps::RoadmapMilestonePresenter.new(@milestones).to_json %>,
|
21
|
+
{parse: true});
|
22
|
+
|
23
|
+
var goals = new Roadmaps.Goals(
|
24
|
+
<%= raw Houston::Roadmaps::MilestonePresenter.new(@goals).to_json %>,
|
25
|
+
{parse: true});
|
26
|
+
|
27
|
+
new Roadmaps.EditRoadmapView({
|
28
|
+
el: $('#roadmap_view')[0],
|
29
|
+
id: <%= @roadmap.id %>,
|
30
|
+
milestones: milestones,
|
31
|
+
goals: goals
|
32
|
+
}).render();
|
33
|
+
});
|
34
|
+
</script>
|
35
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% content_for :stylesheets do %>
|
2
|
+
<%= stylesheet_link_tag "houston/roadmaps/application", :media => "all" %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :javascripts do %>
|
6
|
+
<%= javascript_include_tag "houston/roadmaps/application" %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%# Houston's default layout %>
|
10
|
+
<%= render template: "layouts/application" %>
|