Show More
@@ -1,312 +1,312 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(comment)} |
|
4 | ## ${comment.comment_block(comment)} | |
5 | ## |
|
5 | ## | |
6 | <%namespace name="base" file="/base/base.html"/> |
|
6 | <%namespace name="base" file="/base/base.html"/> | |
7 |
|
7 | |||
8 | <%def name="comment_block(comment, inline=False)"> |
|
8 | <%def name="comment_block(comment, inline=False)"> | |
9 | <div class="comment ${'comment-inline' if inline else ''}" id="comment-${comment.comment_id}" line="${comment.line_no}" data-comment-id="${comment.comment_id}"> |
|
9 | <div class="comment ${'comment-inline' if inline else ''}" id="comment-${comment.comment_id}" line="${comment.line_no}" data-comment-id="${comment.comment_id}"> | |
10 | <div class="meta"> |
|
10 | <div class="meta"> | |
11 | <div class="author"> |
|
11 | <div class="author"> | |
12 | ${base.gravatar_with_user(comment.author.email, 16)} |
|
12 | ${base.gravatar_with_user(comment.author.email, 16)} | |
13 | </div> |
|
13 | </div> | |
14 | <div class="date"> |
|
14 | <div class="date"> | |
15 | ${h.age_component(comment.modified_at, time_is_local=True)} |
|
15 | ${h.age_component(comment.modified_at, time_is_local=True)} | |
16 | </div> |
|
16 | </div> | |
17 | <div class="status-change"> |
|
17 | <div class="status-change"> | |
18 | %if comment.pull_request: |
|
18 | %if comment.pull_request: | |
19 | <a href="${h.url('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}"> |
|
19 | <a href="${h.url('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}"> | |
20 | %if comment.status_change: |
|
20 | %if comment.status_change: | |
21 | ${_('Vote on pull request #%s') % comment.pull_request.pull_request_id}: |
|
21 | ${_('Vote on pull request #%s') % comment.pull_request.pull_request_id}: | |
22 | %else: |
|
22 | %else: | |
23 | ${_('Comment on pull request #%s') % comment.pull_request.pull_request_id} |
|
23 | ${_('Comment on pull request #%s') % comment.pull_request.pull_request_id} | |
24 | %endif |
|
24 | %endif | |
25 | </a> |
|
25 | </a> | |
26 | %else: |
|
26 | %else: | |
27 | %if comment.status_change: |
|
27 | %if comment.status_change: | |
28 | ${_('Status change on commit')}: |
|
28 | ${_('Status change on commit')}: | |
29 | %else: |
|
29 | %else: | |
30 | ${_('Comment on commit')} |
|
30 | ${_('Comment on commit')} | |
31 | %endif |
|
31 | %endif | |
32 | %endif |
|
32 | %endif | |
33 | </div> |
|
33 | </div> | |
34 | %if comment.status_change: |
|
34 | %if comment.status_change: | |
35 | <div class="${'flag_status %s' % comment.status_change[0].status}"></div> |
|
35 | <div class="${'flag_status %s' % comment.status_change[0].status}"></div> | |
36 | <div title="${_('Commit status')}" class="changeset-status-lbl"> |
|
36 | <div title="${_('Commit status')}" class="changeset-status-lbl"> | |
37 | ${comment.status_change[0].status_lbl} |
|
37 | ${comment.status_change[0].status_lbl} | |
38 | </div> |
|
38 | </div> | |
39 | %endif |
|
39 | %endif | |
40 | <a class="permalink" href="#comment-${comment.comment_id}"> ¶</a> |
|
40 | <a class="permalink" href="#comment-${comment.comment_id}"> ¶</a> | |
41 |
|
41 | |||
42 |
|
42 | |||
43 | <div class="comment-links-block"> |
|
43 | <div class="comment-links-block"> | |
44 |
|
44 | |||
45 | ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed |
|
45 | ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed | |
46 | ## only super-admin, repo admin OR comment owner can delete |
|
46 | ## only super-admin, repo admin OR comment owner can delete | |
47 | %if not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed()): |
|
47 | %if not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed()): | |
48 | %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id: |
|
48 | %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id: | |
49 | <div onClick="deleteComment(${comment.comment_id})" class="delete-comment"> ${_('Delete')}</div> |
|
49 | <div onClick="deleteComment(${comment.comment_id})" class="delete-comment"> ${_('Delete')}</div> | |
50 | %if inline: |
|
50 | %if inline: | |
51 | <div class="comment-links-divider"> | </div> |
|
51 | <div class="comment-links-divider"> | </div> | |
52 | %endif |
|
52 | %endif | |
53 | %endif |
|
53 | %endif | |
54 | %endif |
|
54 | %endif | |
55 |
|
55 | |||
56 | %if inline: |
|
56 | %if inline: | |
57 |
|
57 | |||
58 | <div id="prev_c_${comment.comment_id}" class="comment-previous-link" title="${_('Previous comment')}"> |
|
58 | <div id="prev_c_${comment.comment_id}" class="comment-previous-link" title="${_('Previous comment')}"> | |
59 | <a class="arrow_comment_link disabled"><i class="icon-left"></i></a> |
|
59 | <a class="arrow_comment_link disabled"><i class="icon-left"></i></a> | |
60 | </div> |
|
60 | </div> | |
61 |
|
61 | |||
62 | <div id="next_c_${comment.comment_id}" class="comment-next-link" title="${_('Next comment')}"> |
|
62 | <div id="next_c_${comment.comment_id}" class="comment-next-link" title="${_('Next comment')}"> | |
63 | <a class="arrow_comment_link disabled"><i class="icon-right"></i></a> |
|
63 | <a class="arrow_comment_link disabled"><i class="icon-right"></i></a> | |
64 | </div> |
|
64 | </div> | |
65 | %endif |
|
65 | %endif | |
66 |
|
66 | |||
67 | </div> |
|
67 | </div> | |
68 | </div> |
|
68 | </div> | |
69 | <div class="text"> |
|
69 | <div class="text"> | |
70 | ${comment.render(mentions=True)|n} |
|
70 | ${comment.render(mentions=True)|n} | |
71 | </div> |
|
71 | </div> | |
72 | </div> |
|
72 | </div> | |
73 | </%def> |
|
73 | </%def> | |
74 |
|
74 | |||
75 | <%def name="comment_block_outdated(comment)"> |
|
75 | <%def name="comment_block_outdated(comment)"> | |
76 | <div class="comments" id="comment-${comment.comment_id}"> |
|
76 | <div class="comments" id="comment-${comment.comment_id}"> | |
77 | <div class="comment comment-wrapp"> |
|
77 | <div class="comment comment-wrapp"> | |
78 | <div class="meta"> |
|
78 | <div class="meta"> | |
79 | <div class="author"> |
|
79 | <div class="author"> | |
80 | ${base.gravatar_with_user(comment.author.email, 16)} |
|
80 | ${base.gravatar_with_user(comment.author.email, 16)} | |
81 | </div> |
|
81 | </div> | |
82 | <div class="date"> |
|
82 | <div class="date"> | |
83 | ${h.age_component(comment.modified_at, time_is_local=True)} |
|
83 | ${h.age_component(comment.modified_at, time_is_local=True)} | |
84 | </div> |
|
84 | </div> | |
85 | %if comment.status_change: |
|
85 | %if comment.status_change: | |
86 | <span class="changeset-status-container"> |
|
86 | <span class="changeset-status-container"> | |
87 | <span class="changeset-status-ico"> |
|
87 | <span class="changeset-status-ico"> | |
88 | <div class="${'flag_status %s' % comment.status_change[0].status}"></div> |
|
88 | <div class="${'flag_status %s' % comment.status_change[0].status}"></div> | |
89 | </span> |
|
89 | </span> | |
90 | <span title="${_('Commit status')}" class="changeset-status-lbl"> ${comment.status_change[0].status_lbl}</span> |
|
90 | <span title="${_('Commit status')}" class="changeset-status-lbl"> ${comment.status_change[0].status_lbl}</span> | |
91 | </span> |
|
91 | </span> | |
92 | %endif |
|
92 | %endif | |
93 | <a class="permalink" href="#comment-${comment.comment_id}">¶</a> |
|
93 | <a class="permalink" href="#comment-${comment.comment_id}">¶</a> | |
94 | ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed |
|
94 | ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed | |
95 | ## only super-admin, repo admin OR comment owner can delete |
|
95 | ## only super-admin, repo admin OR comment owner can delete | |
96 | %if not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed()): |
|
96 | %if not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed()): | |
97 | <div class="comment-links-block"> |
|
97 | <div class="comment-links-block"> | |
98 | %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id: |
|
98 | %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id: | |
99 | <div data-comment-id=${comment.comment_id} class="delete-comment">${_('Delete')}</div> |
|
99 | <div data-comment-id=${comment.comment_id} class="delete-comment">${_('Delete')}</div> | |
100 | %endif |
|
100 | %endif | |
101 | </div> |
|
101 | </div> | |
102 | %endif |
|
102 | %endif | |
103 | </div> |
|
103 | </div> | |
104 | <div class="text"> |
|
104 | <div class="text"> | |
105 | ${comment.render(mentions=True)|n} |
|
105 | ${comment.render(mentions=True)|n} | |
106 | </div> |
|
106 | </div> | |
107 | </div> |
|
107 | </div> | |
108 | </div> |
|
108 | </div> | |
109 | </%def> |
|
109 | </%def> | |
110 |
|
110 | |||
111 | <%def name="comment_inline_form()"> |
|
111 | <%def name="comment_inline_form()"> | |
112 | <div id="comment-inline-form-template" style="display: none;"> |
|
112 | <div id="comment-inline-form-template" style="display: none;"> | |
113 | <div class="comment-inline-form ac"> |
|
113 | <div class="comment-inline-form ac"> | |
114 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
114 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
115 | ${h.form('#', class_='inline-form', method='get')} |
|
115 | ${h.form('#', class_='inline-form', method='get')} | |
116 | <div id="edit-container_{1}" class="clearfix"> |
|
116 | <div id="edit-container_{1}" class="clearfix"> | |
117 | <div class="comment-title pull-left"> |
|
117 | <div class="comment-title pull-left"> | |
118 | ${_('Create a comment on line {1}.')} |
|
118 | ${_('Create a comment on line {1}.')} | |
119 | </div> |
|
119 | </div> | |
120 | <div class="comment-help pull-right"> |
|
120 | <div class="comment-help pull-right"> | |
121 | ${(_('Comments parsed using %s syntax with %s support.') % ( |
|
121 | ${(_('Comments parsed using %s syntax with %s support.') % ( | |
122 | ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), |
|
122 | ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), | |
123 | ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) |
|
123 | ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) | |
124 | ) |
|
124 | ) | |
125 | )|n |
|
125 | )|n | |
126 | } |
|
126 | } | |
127 | </div> |
|
127 | </div> | |
128 | <div style="clear: both"></div> |
|
128 | <div style="clear: both"></div> | |
129 | <textarea id="text_{1}" name="text" class="comment-block-ta ac-input"></textarea> |
|
129 | <textarea id="text_{1}" name="text" class="comment-block-ta ac-input"></textarea> | |
130 | </div> |
|
130 | </div> | |
131 | <div id="preview-container_{1}" class="clearfix" style="display: none;"> |
|
131 | <div id="preview-container_{1}" class="clearfix" style="display: none;"> | |
132 | <div class="comment-help"> |
|
132 | <div class="comment-help"> | |
133 | ${_('Comment preview')} |
|
133 | ${_('Comment preview')} | |
134 | </div> |
|
134 | </div> | |
135 | <div id="preview-box_{1}" class="preview-box"></div> |
|
135 | <div id="preview-box_{1}" class="preview-box"></div> | |
136 | </div> |
|
136 | </div> | |
137 | <div class="comment-footer"> |
|
137 | <div class="comment-footer"> | |
138 | <div class="comment-button hide-inline-form-button cancel-button"> |
|
138 | <div class="comment-button hide-inline-form-button cancel-button"> | |
139 | ${h.reset('hide-inline-form', _('Cancel'), class_='btn hide-inline-form', id_="cancel-btn_{1}")} |
|
139 | ${h.reset('hide-inline-form', _('Cancel'), class_='btn hide-inline-form', id_="cancel-btn_{1}")} | |
140 | </div> |
|
140 | </div> | |
141 | <div class="action-buttons"> |
|
141 | <div class="action-buttons"> | |
142 | <input type="hidden" name="f_path" value="{0}"> |
|
142 | <input type="hidden" name="f_path" value="{0}"> | |
143 | <input type="hidden" name="line" value="{1}"> |
|
143 | <input type="hidden" name="line" value="{1}"> | |
144 | <button id="preview-btn_{1}" class="btn btn-secondary">${_('Preview')}</button> |
|
144 | <button id="preview-btn_{1}" class="btn btn-secondary">${_('Preview')}</button> | |
145 | <button id="edit-btn_{1}" class="btn btn-secondary" style="display: none;">${_('Edit')}</button> |
|
145 | <button id="edit-btn_{1}" class="btn btn-secondary" style="display: none;">${_('Edit')}</button> | |
146 | ${h.submit('save', _('Comment'), class_='btn btn-success save-inline-form')} |
|
146 | ${h.submit('save', _('Comment'), class_='btn btn-success save-inline-form')} | |
147 | </div> |
|
147 | </div> | |
148 | ${h.end_form()} |
|
148 | ${h.end_form()} | |
149 | </div> |
|
149 | </div> | |
150 | %else: |
|
150 | %else: | |
151 | ${h.form('', class_='inline-form comment-form-login', method='get')} |
|
151 | ${h.form('', class_='inline-form comment-form-login', method='get')} | |
152 | <div class="pull-left"> |
|
152 | <div class="pull-left"> | |
153 | <div class="comment-help pull-right"> |
|
153 | <div class="comment-help pull-right"> | |
154 |
${_('You need to be logged in to comment.')} <a href="${h. |
|
154 | ${_('You need to be logged in to comment.')} <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a> | |
155 | </div> |
|
155 | </div> | |
156 | </div> |
|
156 | </div> | |
157 | <div class="comment-button pull-right"> |
|
157 | <div class="comment-button pull-right"> | |
158 | ${h.reset('hide-inline-form', _('Hide'), class_='btn hide-inline-form')} |
|
158 | ${h.reset('hide-inline-form', _('Hide'), class_='btn hide-inline-form')} | |
159 | </div> |
|
159 | </div> | |
160 | <div class="clearfix"></div> |
|
160 | <div class="clearfix"></div> | |
161 | ${h.end_form()} |
|
161 | ${h.end_form()} | |
162 | %endif |
|
162 | %endif | |
163 | </div> |
|
163 | </div> | |
164 | </div> |
|
164 | </div> | |
165 | </%def> |
|
165 | </%def> | |
166 |
|
166 | |||
167 |
|
167 | |||
168 | ## generates inlines taken from c.comments var |
|
168 | ## generates inlines taken from c.comments var | |
169 | <%def name="inlines(is_pull_request=False)"> |
|
169 | <%def name="inlines(is_pull_request=False)"> | |
170 | %if is_pull_request: |
|
170 | %if is_pull_request: | |
171 | <h2 id="comments">${ungettext("%d Pull Request Comment", "%d Pull Request Comments", len(c.comments)) % len(c.comments)}</h2> |
|
171 | <h2 id="comments">${ungettext("%d Pull Request Comment", "%d Pull Request Comments", len(c.comments)) % len(c.comments)}</h2> | |
172 | %else: |
|
172 | %else: | |
173 | <h2 id="comments">${ungettext("%d Commit Comment", "%d Commit Comments", len(c.comments)) % len(c.comments)}</h2> |
|
173 | <h2 id="comments">${ungettext("%d Commit Comment", "%d Commit Comments", len(c.comments)) % len(c.comments)}</h2> | |
174 | %endif |
|
174 | %endif | |
175 | %for path, lines_comments in c.inline_comments: |
|
175 | %for path, lines_comments in c.inline_comments: | |
176 | % for line, comments in lines_comments.iteritems(): |
|
176 | % for line, comments in lines_comments.iteritems(): | |
177 | <div style="display: none;" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> |
|
177 | <div style="display: none;" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> | |
178 | ## for each comment in particular line |
|
178 | ## for each comment in particular line | |
179 | %for comment in comments: |
|
179 | %for comment in comments: | |
180 | ${comment_block(comment, inline=True)} |
|
180 | ${comment_block(comment, inline=True)} | |
181 | %endfor |
|
181 | %endfor | |
182 | </div> |
|
182 | </div> | |
183 | %endfor |
|
183 | %endfor | |
184 | %endfor |
|
184 | %endfor | |
185 |
|
185 | |||
186 | </%def> |
|
186 | </%def> | |
187 |
|
187 | |||
188 | ## generate inline comments and the main ones |
|
188 | ## generate inline comments and the main ones | |
189 | <%def name="generate_comments(include_pull_request=False, is_pull_request=False)"> |
|
189 | <%def name="generate_comments(include_pull_request=False, is_pull_request=False)"> | |
190 | ## generate inlines for this changeset |
|
190 | ## generate inlines for this changeset | |
191 | ${inlines(is_pull_request)} |
|
191 | ${inlines(is_pull_request)} | |
192 |
|
192 | |||
193 | %for comment in c.comments: |
|
193 | %for comment in c.comments: | |
194 | <div id="comment-tr-${comment.comment_id}"> |
|
194 | <div id="comment-tr-${comment.comment_id}"> | |
195 | ## only render comments that are not from pull request, or from |
|
195 | ## only render comments that are not from pull request, or from | |
196 | ## pull request and a status change |
|
196 | ## pull request and a status change | |
197 | %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request: |
|
197 | %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request: | |
198 | ${comment_block(comment)} |
|
198 | ${comment_block(comment)} | |
199 | %endif |
|
199 | %endif | |
200 | </div> |
|
200 | </div> | |
201 | %endfor |
|
201 | %endfor | |
202 | ## to anchor ajax comments |
|
202 | ## to anchor ajax comments | |
203 | <div id="injected_page_comments"></div> |
|
203 | <div id="injected_page_comments"></div> | |
204 | </%def> |
|
204 | </%def> | |
205 |
|
205 | |||
206 | ## MAIN COMMENT FORM |
|
206 | ## MAIN COMMENT FORM | |
207 | <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)"> |
|
207 | <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)"> | |
208 | %if is_compare: |
|
208 | %if is_compare: | |
209 | <% form_id = "comments_form_compare" %> |
|
209 | <% form_id = "comments_form_compare" %> | |
210 | %else: |
|
210 | %else: | |
211 | <% form_id = "comments_form" %> |
|
211 | <% form_id = "comments_form" %> | |
212 | %endif |
|
212 | %endif | |
213 |
|
213 | |||
214 |
|
214 | |||
215 | %if is_pull_request: |
|
215 | %if is_pull_request: | |
216 | <div class="pull-request-merge"> |
|
216 | <div class="pull-request-merge"> | |
217 | %if c.allowed_to_merge: |
|
217 | %if c.allowed_to_merge: | |
218 | <div class="pull-request-wrap"> |
|
218 | <div class="pull-request-wrap"> | |
219 | <div class="pull-right"> |
|
219 | <div class="pull-right"> | |
220 | ${h.secure_form(url('pullrequest_merge', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), id='merge_pull_request_form')} |
|
220 | ${h.secure_form(url('pullrequest_merge', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), id='merge_pull_request_form')} | |
221 | <span data-role="merge-message">${c.pr_merge_msg} ${c.approval_msg if c.approval_msg else ''}</span> |
|
221 | <span data-role="merge-message">${c.pr_merge_msg} ${c.approval_msg if c.approval_msg else ''}</span> | |
222 | <% merge_disabled = ' disabled' if c.pr_merge_status is False else '' %> |
|
222 | <% merge_disabled = ' disabled' if c.pr_merge_status is False else '' %> | |
223 | <input type="submit" id="merge_pull_request" value="${_('Merge Pull Request')}" class="btn${merge_disabled}"${merge_disabled}> |
|
223 | <input type="submit" id="merge_pull_request" value="${_('Merge Pull Request')}" class="btn${merge_disabled}"${merge_disabled}> | |
224 | ${h.end_form()} |
|
224 | ${h.end_form()} | |
225 | </div> |
|
225 | </div> | |
226 | </div> |
|
226 | </div> | |
227 | %else: |
|
227 | %else: | |
228 | <div class="pull-request-wrap"> |
|
228 | <div class="pull-request-wrap"> | |
229 | <div class="pull-right"> |
|
229 | <div class="pull-right"> | |
230 | <span>${c.pr_merge_msg} ${c.approval_msg if c.approval_msg else ''}</span> |
|
230 | <span>${c.pr_merge_msg} ${c.approval_msg if c.approval_msg else ''}</span> | |
231 | </div> |
|
231 | </div> | |
232 | </div> |
|
232 | </div> | |
233 | %endif |
|
233 | %endif | |
234 | </div> |
|
234 | </div> | |
235 | %endif |
|
235 | %endif | |
236 | <div class="comments"> |
|
236 | <div class="comments"> | |
237 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
237 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
238 | <div class="comment-form ac"> |
|
238 | <div class="comment-form ac"> | |
239 | ${h.secure_form(post_url, id_=form_id)} |
|
239 | ${h.secure_form(post_url, id_=form_id)} | |
240 | <div id="edit-container" class="clearfix"> |
|
240 | <div id="edit-container" class="clearfix"> | |
241 | <div class="comment-title pull-left"> |
|
241 | <div class="comment-title pull-left"> | |
242 | %if is_pull_request: |
|
242 | %if is_pull_request: | |
243 | ${(_('Create a comment on this Pull Request.'))} |
|
243 | ${(_('Create a comment on this Pull Request.'))} | |
244 | %elif is_compare: |
|
244 | %elif is_compare: | |
245 | ${(_('Create comments on this Commit range.'))} |
|
245 | ${(_('Create comments on this Commit range.'))} | |
246 | %else: |
|
246 | %else: | |
247 | ${(_('Create a comment on this Commit.'))} |
|
247 | ${(_('Create a comment on this Commit.'))} | |
248 | %endif |
|
248 | %endif | |
249 | </div> |
|
249 | </div> | |
250 | <div class="comment-help pull-right"> |
|
250 | <div class="comment-help pull-right"> | |
251 | ${(_('Comments parsed using %s syntax with %s support.') % ( |
|
251 | ${(_('Comments parsed using %s syntax with %s support.') % ( | |
252 | ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), |
|
252 | ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), | |
253 | ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) |
|
253 | ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) | |
254 | ) |
|
254 | ) | |
255 | )|n |
|
255 | )|n | |
256 | } |
|
256 | } | |
257 | </div> |
|
257 | </div> | |
258 | <div style="clear: both"></div> |
|
258 | <div style="clear: both"></div> | |
259 | ${h.textarea('text', class_="comment-block-ta")} |
|
259 | ${h.textarea('text', class_="comment-block-ta")} | |
260 | </div> |
|
260 | </div> | |
261 |
|
261 | |||
262 | <div id="preview-container" class="clearfix" style="display: none;"> |
|
262 | <div id="preview-container" class="clearfix" style="display: none;"> | |
263 | <div class="comment-title"> |
|
263 | <div class="comment-title"> | |
264 | ${_('Comment preview')} |
|
264 | ${_('Comment preview')} | |
265 | </div> |
|
265 | </div> | |
266 | <div id="preview-box" class="preview-box"></div> |
|
266 | <div id="preview-box" class="preview-box"></div> | |
267 | </div> |
|
267 | </div> | |
268 |
|
268 | |||
269 | <div id="comment_form_extras"> |
|
269 | <div id="comment_form_extras"> | |
270 | %if form_extras and isinstance(form_extras, (list, tuple)): |
|
270 | %if form_extras and isinstance(form_extras, (list, tuple)): | |
271 | % for form_ex_el in form_extras: |
|
271 | % for form_ex_el in form_extras: | |
272 | ${form_ex_el|n} |
|
272 | ${form_ex_el|n} | |
273 | % endfor |
|
273 | % endfor | |
274 | %endif |
|
274 | %endif | |
275 | </div> |
|
275 | </div> | |
276 | <div class="comment-footer"> |
|
276 | <div class="comment-footer"> | |
277 | %if change_status: |
|
277 | %if change_status: | |
278 | <div class="status_box"> |
|
278 | <div class="status_box"> | |
279 | <select id="change_status" name="changeset_status"> |
|
279 | <select id="change_status" name="changeset_status"> | |
280 | <option></option> # Placeholder |
|
280 | <option></option> # Placeholder | |
281 | %for status,lbl in c.commit_statuses: |
|
281 | %for status,lbl in c.commit_statuses: | |
282 | <option value="${status}" data-status="${status}">${lbl}</option> |
|
282 | <option value="${status}" data-status="${status}">${lbl}</option> | |
283 | %if is_pull_request and change_status and status in ('approved', 'rejected'): |
|
283 | %if is_pull_request and change_status and status in ('approved', 'rejected'): | |
284 | <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option> |
|
284 | <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option> | |
285 | %endif |
|
285 | %endif | |
286 | %endfor |
|
286 | %endfor | |
287 | </select> |
|
287 | </select> | |
288 | </div> |
|
288 | </div> | |
289 | %endif |
|
289 | %endif | |
290 | <div class="action-buttons"> |
|
290 | <div class="action-buttons"> | |
291 | <button id="preview-btn" class="btn btn-secondary">${_('Preview')}</button> |
|
291 | <button id="preview-btn" class="btn btn-secondary">${_('Preview')}</button> | |
292 | <button id="edit-btn" class="btn btn-secondary" style="display:none;">${_('Edit')}</button> |
|
292 | <button id="edit-btn" class="btn btn-secondary" style="display:none;">${_('Edit')}</button> | |
293 | <div class="comment-button">${h.submit('save', _('Comment'), class_="btn btn-success comment-button-input")}</div> |
|
293 | <div class="comment-button">${h.submit('save', _('Comment'), class_="btn btn-success comment-button-input")}</div> | |
294 | </div> |
|
294 | </div> | |
295 | </div> |
|
295 | </div> | |
296 | ${h.end_form()} |
|
296 | ${h.end_form()} | |
297 | </div> |
|
297 | </div> | |
298 | %endif |
|
298 | %endif | |
299 | </div> |
|
299 | </div> | |
300 | <script> |
|
300 | <script> | |
301 | // init active elements of commentForm |
|
301 | // init active elements of commentForm | |
302 | var commitId = templateContext.commit_data.commit_id; |
|
302 | var commitId = templateContext.commit_data.commit_id; | |
303 | var pullRequestId = templateContext.pull_request_data.pull_request_id; |
|
303 | var pullRequestId = templateContext.pull_request_data.pull_request_id; | |
304 | var lineNo; |
|
304 | var lineNo; | |
305 |
|
305 | |||
306 | var mainCommentForm = new CommentForm( |
|
306 | var mainCommentForm = new CommentForm( | |
307 | "#${form_id}", commitId, pullRequestId, lineNo, true); |
|
307 | "#${form_id}", commitId, pullRequestId, lineNo, true); | |
308 |
|
308 | |||
309 | mainCommentForm.initStatusChangeSelector(); |
|
309 | mainCommentForm.initStatusChangeSelector(); | |
310 |
|
310 | |||
311 | </script> |
|
311 | </script> | |
312 | </%def> |
|
312 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now