annotate rhodecode/templates/changeset/changeset_file_comment.html @ 1860:1f06cd49cb3e beta

changeset: simplifying comments
author Aras Pranckevicius <aras@unity3d.com>
date Sat, 07 Jan 2012 21:44:18 +0200
parents ef0613584ced
children f91d3f9b7230
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1787
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
1 ## -*- coding: utf-8 -*-
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
2 ## usage:
1670
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 ## ${comment.comment_block(co)}
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 ##
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 <%def name="comment_block(co)">
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 <div class="comment" id="comment-${co.comment_id}">
1772
c83d3d42ab92 - diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents: 1769
diff changeset
8 <div class="comment-wrapp">
1670
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 <div class="meta">
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 <span class="user">
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 <img src="${h.gravatar_url(co.author.email, 20)}" />
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 ${co.author.username}
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 </span>
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 <span class="date">
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 ${h.age(co.modified_at)}
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 </span>
1860
1f06cd49cb3e changeset: simplifying comments
Aras Pranckevicius <aras@unity3d.com>
parents: 1788
diff changeset
17 %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id:
1f06cd49cb3e changeset: simplifying comments
Aras Pranckevicius <aras@unity3d.com>
parents: 1788
diff changeset
18 <span class="buttons">
1f06cd49cb3e changeset: simplifying comments
Aras Pranckevicius <aras@unity3d.com>
parents: 1788
diff changeset
19 <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span>
1f06cd49cb3e changeset: simplifying comments
Aras Pranckevicius <aras@unity3d.com>
parents: 1788
diff changeset
20 </span>
1f06cd49cb3e changeset: simplifying comments
Aras Pranckevicius <aras@unity3d.com>
parents: 1788
diff changeset
21 %endif
1670
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 </div>
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 <div class="text">
1769
025f3333c769 @mention highlighting
Marcin Kuzminski <marcin@python-works.com>
parents: 1756
diff changeset
24 ${h.rst_w_mentions(co.text)|n}
1670
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25 </div>
1772
c83d3d42ab92 - diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents: 1769
diff changeset
26 </div>
1670
d2de0c2f02cd #77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 </div>
1677
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
28 </%def>
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
29
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
30
1787
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
31 <%def name="comment_inline_form(changeset)">
1677
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
32 <div id='comment-inline-form-template' style="display:none">
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
33 <div class="comment-inline-form">
1678
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
34 %if c.rhodecode_user.username != 'default':
1787
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
35 ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))}
1677
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
36 <div class="clearfix">
1772
c83d3d42ab92 - diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents: 1769
diff changeset
37 <div class="comment-help">${_('Commenting on line')} {1}. ${_('Comments parsed using')}
c83d3d42ab92 - diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents: 1769
diff changeset
38 <a href="${h.url('rst_help')}">RST</a> ${_('syntax')} ${_('with')}
c83d3d42ab92 - diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents: 1769
diff changeset
39 <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')}
c83d3d42ab92 - diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents: 1769
diff changeset
40 </div>
c83d3d42ab92 - diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents: 1769
diff changeset
41 <textarea id="text_{1}" name="text"></textarea>
1677
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
42 </div>
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
43 <div class="comment-button">
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
44 <input type="hidden" name="f_path" value="{0}">
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
45 <input type="hidden" name="line" value="{1}">
1756
Marcin Kuzminski <marcin@python-works.com>
parents: 1704
diff changeset
46 ${h.submit('save', _('Comment'), class_='ui-btn')}
Marcin Kuzminski <marcin@python-works.com>
parents: 1704
diff changeset
47 ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')}
1677
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
48 </div>
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
49 ${h.end_form()}
1678
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
50 %else:
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
51 ${h.form('')}
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
52 <div class="clearfix">
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
53 <div class="comment-help">
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
54 ${'You need to be logged in to comment.'} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a>
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
55 </div>
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
56 </div>
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
57 <div class="comment-button">
1756
Marcin Kuzminski <marcin@python-works.com>
parents: 1704
diff changeset
58 ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')}
1678
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
59 </div>
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
60 ${h.end_form()}
aa6a1c6f2ac5 remove inline comments forms for anonymous users
Marcin Kuzminski <marcin@python-works.com>
parents: 1677
diff changeset
61 %endif
1677
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
62 </div>
7276b170ce8b #71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents: 1675
diff changeset
63 </div>
1787
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
64 </%def>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
65
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
66
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
67 <%def name="comments(changeset)">
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
68
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
69 <div class="comments">
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
70 <div class="comments-number">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
71
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
72 %for path, lines in c.inline_comments:
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
73 <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.FID(changeset.raw_id,path)}">
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
74 % for line,comments in lines.iteritems():
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
75 <div class="inline-comment-placeholder-line" line="${line}" target_id="${h.safeid(h.safe_unicode(path))}">
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
76 %for co in comments:
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
77 ${comment_block(co)}
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
78 %endfor
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
79 </div>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
80 %endfor
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
81 </div>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
82 %endfor
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
83
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
84 %for co in c.comments:
1788
ef0613584ced test fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1787
diff changeset
85 ${comment_block(co)}
1787
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
86 %endfor
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
87 %if c.rhodecode_user.username != 'default':
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
88 <div class="comment-form">
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
89 ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))}
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
90 <strong>${_('Leave a comment')}</strong>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
91 <div class="clearfix">
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
92 <div class="comment-help">
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
93 ${_('Comments parsed using')} <a href="${h.url('rst_help')}">RST</a> ${_('syntax')}
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
94 ${_('with')} <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')}
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
95 </div>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
96 ${h.textarea('text')}
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
97 </div>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
98 <div class="comment-button">
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
99 ${h.submit('save', _('Comment'), class_='ui-button')}
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
100 </div>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
101 ${h.end_form()}
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
102 </div>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
103 %endif
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
104 </div>
d4a7b6c82efe code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents: 1772
diff changeset
105 </%def>