forked from jacksonh/ScrumDo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
story.html
126 lines (93 loc) · 4.19 KB
/
story.html
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
{% load i18n %}{% load comments_tag %}{% load theme_tags %}{% load projects_tags %}<div id="story_area" style="width: 860px;">
<form id="story_detail_form" method="POST" action="{% url story_form group_slug=project.slug story_id=story.id %}">
{{ form.non_field_errors }}
<h1>Story #{{story.local_id}}</h1><br/>
{% locked story %}
<div style="background-color:#ffaaaa ; text-align: center; min-height:32px;">
<h2>Read Only: The iteration this story belongs to is locked.</h2>
</div>
{% endlocked %}
<div id="story_details">
<table>
<tr><td>Summary</td><td>{{form.summary}} {{form.summary.errors}} </td></tr>
<tr><td>Detail</td><td>{{form.detail}} {{form.detail.errors}} </td></tr>
<tr><td>Tags</td>
<td>
<ul id="id_tags2"></ul>
{{form.tags}} {{form.tags.errors}}
</td></tr>
<tr><td>Points </td><td id="points_section">{{form.points}} {{form.points.errors}} </td></tr>
{% if project.use_assignee %}
<tr><td>Assignee</td><td>{{form.assignee}} {{form.assignee.errors}} </td></tr>
{% endif %}
<!-- <tr><td>Backlog Position: </td><td>{{form.general_rank}} {{form.general_rank.errors}} </td></tr> -->
{% if project.use_extra_1 %}
<tr><td>{{project.extra_1_label}} </td><td>{{form.extra_1}} {{form.extra_1.errors}} </td></tr>
{% endif %}
{% if project.use_extra_2 %}
<tr><td>{{project.extra_2_label}} </td><td>{{form.extra_2}} {{form.extra_2.errors}} </td></tr>
{% endif %}
{% if project.use_extra_3 %}
<tr><td>{{project.extra_3_label}} </td><td>{{form.extra_3}} {{form.extra_3.errors}} </td></tr>
{% endif %}
</table>
</div>
<input type="hidden" name="return_type" value="{{return_type}}" />
<input type="hidden" name="rank" value="{{ story.rank }}" />
{% notlocked story %}
<input class="button blue large" type="submit" style="float:right; " value="Update Story" />
{% endnotlocked %}
</form>
{% locked story %}
<div style="background-color:#ffaaaa ; text-align: center; min-height:32px;">
<h2>Read Only: The iteration this story belongs to is locked.</h2>
</div>
{% endlocked %}
<br/><br/><br/><br/>
<h2>Comments {% silk "comments" %}</h2>
<div class="comments_area">
{% comments story %}
</div>
<hr/>
{% notlocked story %}
<form method="POST" id="deleteStoryForm" action="{% url delete_story project.slug story.id %}">
<input class="button red" style="margin-top: -25px; margin-right: 5px" type="submit" value="Delete Story" />
</form>
{% endnotlocked %}
</div>
<script type="text/javascript" charset="utf-8">
var project_tags = [
{% for tag in tags %}
{label:"{{tag.name}}",value:"{{tag.name}}"},
{% endfor %}
{label:"", value:""}
];
var all_tags = scrumdo_special_tags.concat( project_tags );
$("#story_details #id_tags2").tagit({
availableTags:all_tags,
input_field:"#facebox #story_details #id_tags"
});
$("#story_area .commentForm").show();
$("#story_detail_form").ajaxForm({
success: function(responseText) {
$("#story_{{story.id}}").replaceWith(responseText);
calculateBothPoints();
$(document).trigger('close.facebox');
{% if GOOGLE_ANALYTICS %}
_gaq.push(['_trackEvent',"EditStory", "{{current_view}}", "", 1]);
{% endif %}
if(typeof reloadStoryCallback == 'function') { reloadStoryCallback(); }
}});
$("#deleteStoryForm").ajaxForm({
beforeSubmit: function(arr, $form, options) { return confirm ("Are you sure you want to delete this story?"); },
success: function(responseText) { $("#story_{{story.id}}").hide(); $(document).trigger('close.facebox'); }
});
// bind 'myForm' and provide a simple callback function
$(".comments_area form").ajaxForm({
replaceTarget: true,
target: $("#story_area"),
beforeSubmit: function(arr, $form, options) {
$form.hide();
}
});
</script>