Show More
@@ -1,112 +1,113 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
4 | ## ${comment.comment_block(co)} |
|
4 | ## ${comment.comment_block(co)} | |
5 | ## |
|
5 | ## | |
6 | <%def name="comment_block(co)"> |
|
6 | <%def name="comment_block(co)"> | |
7 | <div class="comment" id="comment-${co.comment_id}" line="${co.line_no}"> |
|
7 | <div class="comment" id="comment-${co.comment_id}" line="${co.line_no}"> | |
8 | <div class="comment-wrapp"> |
|
8 | <div class="comment-wrapp"> | |
9 | <div class="meta"> |
|
9 | <div class="meta"> | |
10 | <span class="user"> |
|
10 | <span class="user"> | |
11 | <img src="${h.gravatar_url(co.author.email, 20)}" /> |
|
11 | <img src="${h.gravatar_url(co.author.email, 20)}" /> | |
12 | ${co.author.username} |
|
12 | ${co.author.username} | |
13 | </span> |
|
13 | </span> | |
14 | <span class="date"> |
|
14 | <span class="date"> | |
15 | ${h.age(co.modified_at)} |
|
15 | ${h.age(co.modified_at)} | |
16 | </span> |
|
16 | </span> | |
17 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: |
|
17 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: | |
18 | <span class="buttons"> |
|
18 | <span class="buttons"> | |
19 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span> |
|
19 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span> | |
20 | </span> |
|
20 | </span> | |
21 | %endif |
|
21 | %endif | |
22 | </div> |
|
22 | </div> | |
23 | <div class="text"> |
|
23 | <div class="text"> | |
24 | ${h.rst_w_mentions(co.text)|n} |
|
24 | ${h.rst_w_mentions(co.text)|n} | |
25 | </div> |
|
25 | </div> | |
26 | </div> |
|
26 | </div> | |
27 | </div> |
|
27 | </div> | |
28 | </%def> |
|
28 | </%def> | |
29 |
|
29 | |||
30 |
|
30 | |||
31 | <%def name="comment_inline_form(changeset)"> |
|
31 | <%def name="comment_inline_form(changeset)"> | |
32 | <div id='comment-inline-form-template' style="display:none"> |
|
32 | <div id='comment-inline-form-template' style="display:none"> | |
33 | <div class="comment-inline-form"> |
|
33 | <div class="comment-inline-form"> | |
34 | %if c.rhodecode_user.username != 'default': |
|
34 | %if c.rhodecode_user.username != 'default': | |
35 | <div class="overlay"><div class="overlay-text">${_('Submitting...')}</div></div> |
|
35 | <div class="overlay"><div class="overlay-text">${_('Submitting...')}</div></div> | |
36 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id),class_='inline-form')} |
|
36 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id),class_='inline-form')} | |
37 | <div class="clearfix"> |
|
37 | <div class="clearfix"> | |
38 |
<div class="comment-help">${ |
|
38 | <div class="comment-help">${_('Commenting on line {1}.')} | |
39 |
|
|
39 | ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')), | |
40 | '<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % |
|
40 | '<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % | |
41 | _('Use @username inside this text to send notification to this RhodeCode user')))|n}</div> |
|
41 | _('Use @username inside this text to send notification to this RhodeCode user')))|n}</div> | |
42 | <textarea id="text_{1}" name="text"></textarea> |
|
42 | <textarea id="text_{1}" name="text"></textarea> | |
43 | </div> |
|
43 | </div> | |
44 | <div class="comment-button"> |
|
44 | <div class="comment-button"> | |
45 | <input type="hidden" name="f_path" value="{0}"> |
|
45 | <input type="hidden" name="f_path" value="{0}"> | |
46 | <input type="hidden" name="line" value="{1}"> |
|
46 | <input type="hidden" name="line" value="{1}"> | |
47 | ${h.submit('save', _('Comment'), class_='ui-btn save-inline-form')} |
|
47 | ${h.submit('save', _('Comment'), class_='ui-btn save-inline-form')} | |
48 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} |
|
48 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} | |
49 | </div> |
|
49 | </div> | |
50 | ${h.end_form()} |
|
50 | ${h.end_form()} | |
51 | %else: |
|
51 | %else: | |
52 | ${h.form('')} |
|
52 | ${h.form('')} | |
53 | <div class="clearfix"> |
|
53 | <div class="clearfix"> | |
54 | <div class="comment-help"> |
|
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> |
|
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> |
|
56 | </div> | |
57 | </div> |
|
57 | </div> | |
58 | <div class="comment-button"> |
|
58 | <div class="comment-button"> | |
59 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} |
|
59 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} | |
60 | </div> |
|
60 | </div> | |
61 | ${h.end_form()} |
|
61 | ${h.end_form()} | |
62 | %endif |
|
62 | %endif | |
63 | </div> |
|
63 | </div> | |
64 | </div> |
|
64 | </div> | |
65 | </%def> |
|
65 | </%def> | |
66 |
|
66 | |||
67 |
|
67 | |||
68 | <%def name="inlines(changeset)"> |
|
68 | <%def name="inlines(changeset)"> | |
69 | <div class="comments-number">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> |
|
69 | <div class="comments-number">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> | |
70 | %for path, lines in c.inline_comments: |
|
70 | %for path, lines in c.inline_comments: | |
71 | % for line,comments in lines.iteritems(): |
|
71 | % for line,comments in lines.iteritems(): | |
72 | <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> |
|
72 | <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> | |
73 | %for co in comments: |
|
73 | %for co in comments: | |
74 | ${comment_block(co)} |
|
74 | ${comment_block(co)} | |
75 | %endfor |
|
75 | %endfor | |
76 | </div> |
|
76 | </div> | |
77 | %endfor |
|
77 | %endfor | |
78 | %endfor |
|
78 | %endfor | |
79 |
|
79 | |||
80 | </%def> |
|
80 | </%def> | |
81 |
|
81 | |||
82 | <%def name="comments(changeset)"> |
|
82 | <%def name="comments(changeset)"> | |
83 |
|
83 | |||
84 | <div class="comments"> |
|
84 | <div class="comments"> | |
85 | <div id="inline-comments-container"> |
|
85 | <div id="inline-comments-container"> | |
86 | ${inlines(changeset)} |
|
86 | ${inlines(changeset)} | |
87 | </div> |
|
87 | </div> | |
88 |
|
88 | |||
89 | %for co in c.comments: |
|
89 | %for co in c.comments: | |
90 | <div id="comment-tr-${co.comment_id}"> |
|
90 | <div id="comment-tr-${co.comment_id}"> | |
91 | ${comment_block(co)} |
|
91 | ${comment_block(co)} | |
92 | </div> |
|
92 | </div> | |
93 | %endfor |
|
93 | %endfor | |
94 | %if c.rhodecode_user.username != 'default': |
|
94 | %if c.rhodecode_user.username != 'default': | |
95 | <div class="comment-form"> |
|
95 | <div class="comment-form"> | |
96 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))} |
|
96 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))} | |
97 | <strong>${_('Leave a comment')}</strong> |
|
97 | <strong>${_('Leave a comment')}</strong> | |
98 | <div class="clearfix"> |
|
98 | <div class="clearfix"> | |
99 | <div class="comment-help"> |
|
99 | <div class="comment-help"> | |
100 |
${_('Comments parsed using') |
|
100 | ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')), | |
101 | ${_('with')} <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')} |
|
101 | '<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % | |
|
102 | _('Use @username inside this text to send notification to this RhodeCode user')))|n} | |||
102 | </div> |
|
103 | </div> | |
103 | ${h.textarea('text')} |
|
104 | ${h.textarea('text')} | |
104 | </div> |
|
105 | </div> | |
105 | <div class="comment-button"> |
|
106 | <div class="comment-button"> | |
106 | ${h.submit('save', _('Comment'), class_='ui-button')} |
|
107 | ${h.submit('save', _('Comment'), class_='ui-button')} | |
107 | </div> |
|
108 | </div> | |
108 | ${h.end_form()} |
|
109 | ${h.end_form()} | |
109 | </div> |
|
110 | </div> | |
110 | %endif |
|
111 | %endif | |
111 | </div> |
|
112 | </div> | |
112 | </%def> |
|
113 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now