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