annotate rhodecode/templates/changeset/changeset_file_comment.html @ 2286:9265958e33bb codereview

Show changes of status inside comments - comments that change status are now associated with status object, and showed in comments blocks
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 17 May 2012 00:02:52 +0200
parents 76947224bf27
children d3f1b71099ab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
1 ## -*- coding: utf-8 -*-
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
2 ## usage:
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
3 ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
4 ## ${comment.comment_block(co)}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
5 ##
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
6 <%def name="comment_block(co)">
2187
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
7 <div class="comment" id="comment-${co.comment_id}" line="${co.line_no}">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
8 <div class="comment-wrapp">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
9 <div class="meta">
2286
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
10 <div style="float:left"> <img src="${h.gravatar_url(co.author.email, 20)}" /> </div>
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
11 <div class="user">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
12 ${co.author.username}
2286
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
13 </div>
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
14 <div class="date">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
15 ${h.age(co.modified_at)}
2286
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
16 </div>
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
17 %if co.status_change:
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
18 <div style="float:left" class="changeset-status-container">
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
19 <div style="float:left;padding:0px 2px 0px 2px"><span style="font-size: 18px;">&rsaquo;</span></div>
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
20 <div title="${_('Changeset status')}" class="changeset-status-lbl"> ${co.status_change.status_lbl}</div>
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
21 <div class="changeset-status-ico"><img src="${h.url(str('/images/icons/flag_status_%s.png' % co.status_change.status))}" /></div>
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
22 </div>
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
23 %endif
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
24 %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id:
2286
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
25 <div class="buttons">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
26 <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span>
2286
9265958e33bb Show changes of status inside comments
Marcin Kuzminski <marcin@python-works.com>
parents: 2217
diff changeset
27 </div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
28 %endif
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
29 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
30 <div class="text">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
31 ${h.rst_w_mentions(co.text)|n}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
32 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
33 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
34 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
35 </%def>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
36
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
37
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
38 <%def name="comment_inline_form(changeset)">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
39 <div id='comment-inline-form-template' style="display:none">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
40 <div class="comment-inline-form">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
41 %if c.rhodecode_user.username != 'default':
2187
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
42 <div class="overlay"><div class="overlay-text">${_('Submitting...')}</div></div>
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
43 ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id),class_='inline-form')}
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
44 <div class="clearfix">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
45 <div class="comment-help">${_('Commenting on line')} {1}. ${_('Comments parsed using')}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
46 <a href="${h.url('rst_help')}">RST</a> ${_('syntax')} ${_('with')}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
47 <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')}
2217
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
48 </div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
49 <textarea id="text_{1}" name="text"></textarea>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
50 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
51 <div class="comment-button">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
52 <input type="hidden" name="f_path" value="{0}">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
53 <input type="hidden" name="line" value="{1}">
2187
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
54 ${h.submit('save', _('Comment'), class_='ui-btn save-inline-form')}
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
55 ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
56 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
57 ${h.end_form()}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
58 %else:
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
59 ${h.form('')}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
60 <div class="clearfix">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
61 <div class="comment-help">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
62 ${'You need to be logged in to comment.'} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
63 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
64 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
65 <div class="comment-button">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
66 ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
67 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
68 ${h.end_form()}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
69 %endif
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
70 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
71 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
72 </%def>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
73
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
74
2187
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
75 <%def name="inlines(changeset)">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
76 <div class="comments-number">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
77 %for path, lines in c.inline_comments:
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
78 % for line,comments in lines.iteritems():
2187
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
79 <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
80 %for co in comments:
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
81 ${comment_block(co)}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
82 %endfor
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
83 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
84 %endfor
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
85 %endfor
2188
56e96d4e9f6e white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2187
diff changeset
86
2187
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
87 </%def>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
88
2217
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
89 ## MAIN COMMENT FORM
2187
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
90 <%def name="comments(changeset)">
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
91
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
92 <div class="comments">
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
93 <div id="inline-comments-container">
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
94 ${inlines(changeset)}
b61e540122f2 #415: Adding comment to changeset causes reload
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
95 </div>
2188
56e96d4e9f6e white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2187
diff changeset
96
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
97 %for co in c.comments:
2189
3052f90c568a fixed main comments, prevent from sending inline comments if text is empty
Marcin Kuzminski <marcin@python-works.com>
parents: 2188
diff changeset
98 <div id="comment-tr-${co.comment_id}">
3052f90c568a fixed main comments, prevent from sending inline comments if text is empty
Marcin Kuzminski <marcin@python-works.com>
parents: 2188
diff changeset
99 ${comment_block(co)}
3052f90c568a fixed main comments, prevent from sending inline comments if text is empty
Marcin Kuzminski <marcin@python-works.com>
parents: 2188
diff changeset
100 </div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
101 %endfor
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
102 %if c.rhodecode_user.username != 'default':
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
103 <div class="comment-form">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
104 ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
105 <strong>${_('Leave a comment')}</strong>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
106 <div class="clearfix">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
107 <div class="comment-help">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
108 ${_('Comments parsed using')} <a href="${h.url('rst_help')}">RST</a> ${_('syntax')}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
109 ${_('with')} <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')}
2217
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
110 | <span class="tooltip" title="${_('Check this to change current status of code-review for this changeset')}"> ${_('change status')}
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
111 <input style="vertical-align: bottom;margin-bottom:-2px" id="show_changeset_status_box" type="checkbox" name="change_changeset_status" />
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
112 </span>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
113 </div>
2217
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
114 <div id="status_block_container" class="status-block" style="display:none">
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
115 %for status,lbl in c.changeset_statuses:
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
116 <div class="">
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
117 <img src="${h.url('/images/icons/flag_status_%s.png' % status)}" /> <input ${'checked="checked"' if status == h.changeset_status(c.rhodecode_db_repo, c.changeset.raw_id) else ''}" type="radio" name="changeset_status" value="${status}"> <label>${lbl}</label>
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
118 </div>
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
119 %endfor
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
120 </div>
76947224bf27 Implemented initial code-review status of changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 2189
diff changeset
121 ${h.textarea('text')}
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
122 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
123 <div class="comment-button">
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
124 ${h.submit('save', _('Comment'), class_='ui-button')}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
125 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
126 ${h.end_form()}
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
127 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
128 %endif
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
129 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1860
diff changeset
130 </%def>