Show More
@@ -1,52 +1,65 | |||||
1 | ##usage: |
|
1 | ##usage: | |
2 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
2 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
3 | ## ${comment.comment_block(co)} |
|
3 | ## ${comment.comment_block(co)} | |
4 | ## |
|
4 | ## | |
5 | <%def name="comment_block(co)"> |
|
5 | <%def name="comment_block(co)"> | |
6 | <div class="comment" id="comment-${co.comment_id}"> |
|
6 | <div class="comment" id="comment-${co.comment_id}"> | |
7 | <div class="meta"> |
|
7 | <div class="meta"> | |
8 | <span class="user"> |
|
8 | <span class="user"> | |
9 | <img src="${h.gravatar_url(co.author.email, 20)}" /> |
|
9 | <img src="${h.gravatar_url(co.author.email, 20)}" /> | |
10 | ${co.author.username} |
|
10 | ${co.author.username} | |
11 | </span> |
|
11 | </span> | |
12 | <a href="${h.url.current(anchor='comment-%s' % co.comment_id)}"> ${_('commented on')} </a> |
|
12 | <a href="${h.url.current(anchor='comment-%s' % co.comment_id)}"> ${_('commented on')} </a> | |
13 | ${h.short_id(co.revision)} |
|
13 | ${h.short_id(co.revision)} | |
14 | %if co.f_path: |
|
14 | %if co.f_path: | |
15 | ${_(' in file ')} |
|
15 | ${_(' in file ')} | |
16 | ${co.f_path}:L ${co.line_no} |
|
16 | ${co.f_path}:L ${co.line_no} | |
17 | %endif |
|
17 | %endif | |
18 | <span class="date"> |
|
18 | <span class="date"> | |
19 | ${h.age(co.modified_at)} |
|
19 | ${h.age(co.modified_at)} | |
20 | </span> |
|
20 | </span> | |
21 | </div> |
|
21 | </div> | |
22 | <div class="text"> |
|
22 | <div class="text"> | |
23 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: |
|
23 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: | |
24 | <div class="buttons"> |
|
24 | <div class="buttons"> | |
25 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-button-small">${_('Delete')}</span> |
|
25 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-button-small">${_('Delete')}</span> | |
26 | </div> |
|
26 | </div> | |
27 | %endif |
|
27 | %endif | |
28 | ${h.rst(co.text)|n} |
|
28 | ${h.rst(co.text)|n} | |
29 | </div> |
|
29 | </div> | |
30 | </div> |
|
30 | </div> | |
31 | </%def> |
|
31 | </%def> | |
32 |
|
32 | |||
33 |
|
33 | |||
34 |
|
34 | |||
35 | <%def name="comment_inline_form()"> |
|
35 | <%def name="comment_inline_form()"> | |
36 | <div id='comment-inline-form-template' style="display:none"> |
|
36 | <div id='comment-inline-form-template' style="display:none"> | |
37 | <div class="comment-inline-form"> |
|
37 | <div class="comment-inline-form"> | |
|
38 | %if c.rhodecode_user.username != 'default': | |||
38 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=c.changeset.raw_id))} |
|
39 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=c.changeset.raw_id))} | |
39 | <div class="clearfix"> |
|
40 | <div class="clearfix"> | |
40 | <div class="comment-help">${_('Commenting on line')} {1} ${_('comments parsed using RST syntax')}</div> |
|
41 | <div class="comment-help">${_('Commenting on line')} {1} ${_('comments parsed using RST syntax')}</div> | |
41 | ${h.textarea('text')} |
|
42 | ${h.textarea('text')} | |
42 | </div> |
|
43 | </div> | |
43 | <div class="comment-button"> |
|
44 | <div class="comment-button"> | |
44 | <input type="hidden" name="f_path" value="{0}"> |
|
45 | <input type="hidden" name="f_path" value="{0}"> | |
45 | <input type="hidden" name="line" value="{1}"> |
|
46 | <input type="hidden" name="line" value="{1}"> | |
46 | ${h.submit('save', _('Comment'), class_='ui-button-small')} |
|
47 | ${h.submit('save', _('Comment'), class_='ui-button-small')} | |
47 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-button-small hide-inline-form')} |
|
48 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-button-small hide-inline-form')} | |
48 | </div> |
|
49 | </div> | |
49 | ${h.end_form()} |
|
50 | ${h.end_form()} | |
|
51 | %else: | |||
|
52 | ${h.form('')} | |||
|
53 | <div class="clearfix"> | |||
|
54 | <div class="comment-help"> | |||
|
55 | ${'You need to be logged in to comment.'} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a> | |||
|
56 | </div> | |||
|
57 | </div> | |||
|
58 | <div class="comment-button"> | |||
|
59 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-button-small hide-inline-form')} | |||
|
60 | </div> | |||
|
61 | ${h.end_form()} | |||
|
62 | %endif | |||
50 | </div> |
|
63 | </div> | |
51 | </div> |
|
64 | </div> | |
52 | </%def> No newline at end of file |
|
65 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now