Parent: [d69cb3] (diff)

Child: [a4546e] (diff)

Download this file

ticket.html    194 lines (182 with data), 6.7 kB

  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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
{% extends g.theme.master %}
{% do g.register_forge_css('css/forge/hilite.css') %}
{% do g.register_app_css('css/tracker.css') %}
{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / #{{ticket.ticket_num}} {{ticket.summary}}{% endblock %}
{% block head %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="feed.rss"/>
<link rel="alternate" type="application/atom+xml" title="Atom" href="feed.atom"/>
{% endblock %}
{% block header %}#{{ticket.ticket_num}} {{ticket.summary}}{% endblock %}
{% block actions %}
<a href="{{ticket.url()}}feed.rss" title="Follow this Ticket"><b data-icon="f" class="ico"></b></a>
{% if c.user and c.user != c.user.anonymous() %}
{{c.subscribe_form.display(value=subscribed, tool_subscribed=tool_subscribed, action='subscribe', style='icon')}}
<a href="#" title="Edit" class="edit_ticket"><b data-icon="p" class="ico"></b></a>
{% endif %}
{% endblock %}
{% block edit_box %}
<div class="editbox">
<div class="form_holder" style="display: none">
{{c.ticket_form.display(action='%supdate_ticket_from_widget' % ticket.url(),
value=ticket, ticket=ticket, show_comment=True)}}
</div>
<div class="view_holder">
{% if '_milestone' in ticket.custom_fields %}
<div class="grid-4">
<label class="simple">Milestone: </label>
{% if ticket.custom_fields['_milestone'] %}
<a href="{{c.app.url}}milestone/{{ticket.custom_fields['_milestone']}}">{{ticket.custom_fields['_milestone']}}</a>
{% else %}
None
{% endif %}
</div>
{% endif %}
<div class="grid-4">
<label class="simple">Status: </label>
<span class="{{ticket.open_or_closed}}">{{ticket.status}}</span>
</div>
<div class="grid-4 ticket-assigned-to">
<label class="simple">Owner: </label>
{% if ticket.assigned_to_id %}
<a href="{{ticket.assigned_to.url()}}">{{ticket.assigned_to_name()}}</a>
{% else %}
{{ticket.assigned_to_name()}}
{% endif %}
</div>
<div class="grid-4">
<label class="simple">Labels: </label>
{% for label in ticket.labels %}
<span class="ui-corner-all tag">
<a href="../search?q=labels:{{h.urllib.quote_plus(label)}}">{{label}} ({{ticket.artifacts_labeled_with(label).count()}})</a>
</span>
{% else %}
None
{% endfor %}
</div>
<div style="clear:both"></div>
{% set min_c_fields = '_milestone' in ticket.custom_fields and 1 or 0 %}
{% if globals.custom_fields and globals.custom_fields.__len__() > min_c_fields %}
{% set cf_count=0 %}
{% for field in globals.custom_fields or [] %}
{% if field.name != '_milestone' %}
{% if cf_count%4 == 0 and cf_count != 0 %}
<div style="clear:both"></div>
{% endif %}
<div class="grid-4">
<label class="simple">{{field.label}}:</label>
{{ticket.custom_fields[field.name]}}
</div>
{% set cf_count=cf_count+1 %}
{% endif %}
{% endfor %}
{% endif %}
<div style="clear:both"></div>
<div class="grid-4">
<label class="simple">Updated:</label>
{{h.ago(ticket.mod_date)}}
</div>
<div class="grid-4">
<label class="simple">Created:</label>
{{h.ago(ticket.created_date)}}
</div>
<div class="grid-8">
<label class="simple">Creator:</label>
<a href="{{ticket.reported_by.url()}}">{{ticket.reported_by.display_name}}</a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div id="ticket_content">
{{g.markdown.convert(ticket.description)|safe}}
{% if ticket.attachments %}
<strong>{{ticket.attachments.__len__()}} Attachments</strong>
<div class="clear">
{% for att in ticket.attachments %}
<div class="attachment_thumb">
{% if att.is_image() and not att.is_embedded() %}
<a href="{{att.url()}}" class="file_type">
<img src="{{att.url()}}/thumb">
</a>
{% else %}
<a href="{{att.url()}}" class="file_type">
<span>{{att.filename.split('.')[-1] or 'file'}}</span>
</a>
{% endif %}
<a href="{{att.url()}}">{{att.filename}}</a>
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endblock %}
{% block after_content %}
<div id="discussion_holder">
<h2>Discussion</h2>
{% set thread=ticket.discussion_thread %}
{{c.thread.display(value=thread,new_post_text="New Comment",page=page,limit=limit,count=count)}}
</div>
{% endblock %}
{% block extra_js %}
{% if h.has_artifact_access('write', ticket)() %}
<script type="text/javascript">
$(document).ready(function() {
// show/hide form
var form_holder = $('div.form_holder');
var view_holder = $('div.view_holder');
var discussion_holder = $('#discussion_holder')
var ticket_content = $('#ticket_content');
var title_holder = $('h1.title');
var original_title = title_holder.text();
$('a.edit_ticket, div.view_holder, #ticket_content').click(function(){
form_holder.show();
view_holder.hide();
discussion_holder.hide();
ticket_content.hide();
title_holder.text('\u00A0');
$('a.edit_ticket').addClass('btn_activate');
$('textarea[name="ticket_form.description"]').focus()
return false;
});
$('a.cancel_form').click(function(){
form_holder.hide();
view_holder.show();
discussion_holder.show();
ticket_content.show();
title_holder.text(original_title);
$('a.edit_ticket').removeClass('btn_activate');
return false;
});
// delete attachments
$('div.attachment_thumb a.delete_attachment').click(function(){
$.post(this.href, {'delete': 'True'}, function(){
location.reload();
});
return false;
});
// Allow the ticket metadata links to function without turning on edit mode
$('.editbox a, #ticket_content a').click(function(event){
event.stopPropagation();
});
});
</script>
{% endif %}
{% endblock %}
{% block extra_css %}
<style type="text/css">
input[name='ticket_form.summary']{
top: 5px;
position: absolute;
z-index: 21;
}
div.form_holder .reply textarea{
height: 60px;
}
div.actions{
width: 150px;
}
.markdown_edit textarea {
height: 100px;
}
</style>
{% endblock %}