This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 350
/
testcard.html.erb
137 lines (121 loc) · 5.12 KB
/
testcard.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<script type="text/javascript">
$(function() {
var project = new Project({"project":{"iteration_length":1,"last_changeset_id":123,"iteration_start_day":1,"point_values":[0,1,2,3,5,8],"default_velocity":10,"id":999999,"start_date":"2012/03/08"}});
project.users.reset([{"user":{"name":"Test User","email":"test@example.com","initials":"TU","id":1}}]);
project.current_user = new User({"user":{"name":"Test User","email":"test@example.com","initials":"TU","id":1}});
project.stories.fetch = function() {};
window.project = project;
var chilly_bin = $('#chilly_bin');
var backlog = $('#backlog');
var in_progress = $('#in_progress');
var done = $('#done');
var view;
appendStoryTo(chilly_bin, {"title":"Unestimated feature"});
appendStoryTo(chilly_bin, {"title":"Estimated feature","estimate":3});
appendStoryTo(chilly_bin, {"title":"Example chore","story_type":"chore"});
appendStoryTo(chilly_bin, {"title":"Example bug","story_type":"bug"});
appendStoryTo(chilly_bin, {"title":"Example release","story_type":"release"});
view = appendStoryTo(chilly_bin, {"title":"Save in progress","estimate":3});
view.saveInProgress = true;
view.render();
view.disableForm();
appendStoryTo(chilly_bin, {"title":"Editing feature","editing":true});
appendStoryTo(chilly_bin, {
"title":"Editing chore","story_type":"chore","editing":true
});
appendStoryTo(chilly_bin, {
"title":"Editing bug","story_type":"bug","editing":true
});
appendStoryTo(chilly_bin, {
"title":"Editing release","story_type":"release","editing":true
});
appendStoryTo(backlog, {"title":"Unestimated feature"});
appendStoryTo(backlog, {"title":"Estimated feature","estimate":3});
appendStoryTo(backlog, {"title":"Example chore","story_type":"chore"});
appendStoryTo(backlog, {"title":"Example bug","story_type":"bug"});
appendStoryTo(backlog, {"title":"Example release","story_type":"release"});
appendStoryTo(backlog, {"title":"Estimated feature","estimate":3});
view = appendStoryTo(backlog, {
"title":"Save in progress","story_type":"release","editing":true
});
view.saveInProgress = true;
view.render();
view.disableForm();
appendStoryTo(in_progress, {
"title":"Started feature","state":"started","estimate":1
});
appendStoryTo(in_progress, {
"title":"Finished feature","state":"finished", "estimate":2
});
appendStoryTo(in_progress, {
"title":"Delivered feature","estimate":5, "state":"delivered"
});
appendStoryTo(in_progress, {
"title":"Rejected feature","estimate":8, "state": "rejected"
});
appendStoryTo(in_progress, {"title":"Example chore","story_type":"chore"});
appendStoryTo(in_progress, {"title":"Example bug","story_type":"bug"});
appendStoryTo(in_progress, {"title":"Example release","story_type":"release"});
appendIterationTo(done, new Iteration({'number':1, stories:[]}));
function appendStoryTo(el, storyAttributes, view) {
// Increment the ID on each invocation
if (typeof appendStoryTo.id == 'undefined') {
appendStoryTo.id = 1;
}
storyAttributes.id = appendStoryTo.id++;
var story = new Story(storyAttributes);
//story.collection = window.project.stories;
window.project.stories.add(story);
if (typeof view == 'undefined') {
view = new StoryView({model: story});
}
view.render();
el.append(view.el);
return view;
}
function appendIterationTo(el, iteration, view) {
iteration.project = window.project;
if (typeof view == 'undefined') {
view = new IterationView({model: iteration});
}
view.render();
el.append(view.el);
return view;
}
window.projectView = new ProjectView({model: project});
window.projectView.scaleToViewport();
$(window).resize(projectView.scaleToViewport);
window.projectView.notice({
'title': 'Test card',
'text': 'This is a testcard to expose the full UI on one page'
});
});
</script>
<% content_for :title_bar do %>
<div id="velocity" class="velocity"></div>
<%= render :partial => 'projects/nav',
:locals => {:project => @project, :show_column_toggles => true} %>
| <a id="add_story" href="#">Add story</a>
<% end %>
<table class="stories" width="100%">
<tbody>
<tr>
<td class="done_column" style="width: 25%">
<div class="column_header">Done<a class="toggle-column hide_done" title="Close">×</a></div>
<div id="done" class="storycolumn"></div>
</td>
<td class="in_progress_column" style="width: 25%">
<div class="column_header">In Progress<a class="toggle-column hide_in_progress" title="Close">×</a></div>
<div id="in_progress" class="storycolumn sortable"></div>
</td>
<td class="backlog_column" style="width: 25%">
<div class="column_header">Backlog<a class="toggle-column hide_backlog" title="Close">×</a></div>
<div id="backlog" class="storycolumn sortable"></div>
</td>
<td class="chilly_bin_column" style="width: 25%">
<div class="column_header">Chilly Bin<a class="toggle-column hide_chilly_bin" title="Close">×</a></div>
<div id="chilly_bin" class="storycolumn sortable"></div>
</td>
</tr>
</tbody>
</table>