##// END OF EJS Templates
sidebar: introduce tooltips for observers
marcink -
r4515:3f5e9d55 stable
parent child Browse files
Show More
@@ -1,994 +1,999 b''
1 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
2 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="base" file="/base/base.mako"/>
3 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
3 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
4 <%namespace name="sidebar" file="/base/sidebar.mako"/>
4 <%namespace name="sidebar" file="/base/sidebar.mako"/>
5
5
6
6
7 <%def name="title()">
7 <%def name="title()">
8 ${_('{} Pull Request !{}').format(c.repo_name, c.pull_request.pull_request_id)}
8 ${_('{} Pull Request !{}').format(c.repo_name, c.pull_request.pull_request_id)}
9 %if c.rhodecode_name:
9 %if c.rhodecode_name:
10 &middot; ${h.branding(c.rhodecode_name)}
10 &middot; ${h.branding(c.rhodecode_name)}
11 %endif
11 %endif
12 </%def>
12 </%def>
13
13
14 <%def name="breadcrumbs_links()">
14 <%def name="breadcrumbs_links()">
15
15
16 </%def>
16 </%def>
17
17
18 <%def name="menu_bar_nav()">
18 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='repositories')}
19 ${self.menu_items(active='repositories')}
20 </%def>
20 </%def>
21
21
22 <%def name="menu_bar_subnav()">
22 <%def name="menu_bar_subnav()">
23 ${self.repo_menu(active='showpullrequest')}
23 ${self.repo_menu(active='showpullrequest')}
24 </%def>
24 </%def>
25
25
26
26
27 <%def name="main()">
27 <%def name="main()">
28 ## Container to gather extracted Tickets
28 ## Container to gather extracted Tickets
29 <%
29 <%
30 c.referenced_commit_issues = []
30 c.referenced_commit_issues = []
31 c.referenced_desc_issues = []
31 c.referenced_desc_issues = []
32 %>
32 %>
33
33
34 <script type="text/javascript">
34 <script type="text/javascript">
35 // TODO: marcink switch this to pyroutes
35 // TODO: marcink switch this to pyroutes
36 AJAX_COMMENT_DELETE_URL = "${h.route_path('pullrequest_comment_delete',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id,comment_id='__COMMENT_ID__')}";
36 AJAX_COMMENT_DELETE_URL = "${h.route_path('pullrequest_comment_delete',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id,comment_id='__COMMENT_ID__')}";
37 templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id};
37 templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id};
38 templateContext.pull_request_data.pull_request_version = '${request.GET.get('version', '')}';
38 templateContext.pull_request_data.pull_request_version = '${request.GET.get('version', '')}';
39 </script>
39 </script>
40
40
41 <div class="box">
41 <div class="box">
42
42
43 <div class="box pr-summary">
43 <div class="box pr-summary">
44
44
45 <div class="summary-details block-left">
45 <div class="summary-details block-left">
46 <div id="pr-title">
46 <div id="pr-title">
47 % if c.pull_request.is_closed():
47 % if c.pull_request.is_closed():
48 <span class="pr-title-closed-tag tag">${_('Closed')}</span>
48 <span class="pr-title-closed-tag tag">${_('Closed')}</span>
49 % endif
49 % endif
50 <input class="pr-title-input large disabled" disabled="disabled" name="pullrequest_title" type="text" value="${c.pull_request.title}">
50 <input class="pr-title-input large disabled" disabled="disabled" name="pullrequest_title" type="text" value="${c.pull_request.title}">
51 </div>
51 </div>
52 <div id="pr-title-edit" class="input" style="display: none;">
52 <div id="pr-title-edit" class="input" style="display: none;">
53 <input class="pr-title-input large" id="pr-title-input" name="pullrequest_title" type="text" value="${c.pull_request.title}">
53 <input class="pr-title-input large" id="pr-title-input" name="pullrequest_title" type="text" value="${c.pull_request.title}">
54 </div>
54 </div>
55
55
56 <% summary = lambda n:{False:'summary-short'}.get(n) %>
56 <% summary = lambda n:{False:'summary-short'}.get(n) %>
57 <div class="pr-details-title">
57 <div class="pr-details-title">
58 <div class="pull-left">
58 <div class="pull-left">
59 <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request !{}').format(c.pull_request.pull_request_id)}</a>
59 <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request !{}').format(c.pull_request.pull_request_id)}</a>
60 ${_('Created on')}
60 ${_('Created on')}
61 <span class="tooltip" title="${_('Last updated on')} ${h.format_date(c.pull_request.updated_on)}">${h.format_date(c.pull_request.created_on)},</span>
61 <span class="tooltip" title="${_('Last updated on')} ${h.format_date(c.pull_request.updated_on)}">${h.format_date(c.pull_request.created_on)},</span>
62 <span class="pr-details-title-author-pref">${_('by')}</span>
62 <span class="pr-details-title-author-pref">${_('by')}</span>
63 </div>
63 </div>
64
64
65 <div class="pull-left">
65 <div class="pull-left">
66 ${self.gravatar_with_user(c.pull_request.author.email, 16, tooltip=True)}
66 ${self.gravatar_with_user(c.pull_request.author.email, 16, tooltip=True)}
67 </div>
67 </div>
68
68
69 %if c.allowed_to_update:
69 %if c.allowed_to_update:
70 <div class="pull-right">
70 <div class="pull-right">
71 <div id="edit_pull_request" class="action_button pr-save" style="display: none;">${_('Update title & description')}</div>
71 <div id="edit_pull_request" class="action_button pr-save" style="display: none;">${_('Update title & description')}</div>
72 <div id="delete_pullrequest" class="action_button pr-save ${('' if c.allowed_to_delete else 'disabled' )}" style="display: none;">
72 <div id="delete_pullrequest" class="action_button pr-save ${('' if c.allowed_to_delete else 'disabled' )}" style="display: none;">
73 % if c.allowed_to_delete:
73 % if c.allowed_to_delete:
74 ${h.secure_form(h.route_path('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id), request=request)}
74 ${h.secure_form(h.route_path('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id), request=request)}
75 <input class="btn btn-link btn-danger no-margin" id="remove_${c.pull_request.pull_request_id}" name="remove_${c.pull_request.pull_request_id}"
75 <input class="btn btn-link btn-danger no-margin" id="remove_${c.pull_request.pull_request_id}" name="remove_${c.pull_request.pull_request_id}"
76 onclick="submitConfirm(event, this, _gettext('Confirm to delete this pull request'), _gettext('Delete'), '${'!{}'.format(c.pull_request.pull_request_id)}')"
76 onclick="submitConfirm(event, this, _gettext('Confirm to delete this pull request'), _gettext('Delete'), '${'!{}'.format(c.pull_request.pull_request_id)}')"
77 type="submit" value="${_('Delete pull request')}">
77 type="submit" value="${_('Delete pull request')}">
78 ${h.end_form()}
78 ${h.end_form()}
79 % else:
79 % else:
80 <span class="tooltip" title="${_('Not allowed to delete this pull request')}">${_('Delete pull request')}</span>
80 <span class="tooltip" title="${_('Not allowed to delete this pull request')}">${_('Delete pull request')}</span>
81 % endif
81 % endif
82 </div>
82 </div>
83 <div id="open_edit_pullrequest" class="action_button">${_('Edit')}</div>
83 <div id="open_edit_pullrequest" class="action_button">${_('Edit')}</div>
84 <div id="close_edit_pullrequest" class="action_button" style="display: none;">${_('Cancel')}</div>
84 <div id="close_edit_pullrequest" class="action_button" style="display: none;">${_('Cancel')}</div>
85 </div>
85 </div>
86
86
87 %endif
87 %endif
88 </div>
88 </div>
89
89
90 <div id="pr-desc" class="input" title="${_('Rendered using {} renderer').format(c.renderer)}">
90 <div id="pr-desc" class="input" title="${_('Rendered using {} renderer').format(c.renderer)}">
91 ${h.render(c.pull_request.description, renderer=c.renderer, repo_name=c.repo_name, issues_container=c.referenced_desc_issues)}
91 ${h.render(c.pull_request.description, renderer=c.renderer, repo_name=c.repo_name, issues_container=c.referenced_desc_issues)}
92 </div>
92 </div>
93
93
94 <div id="pr-desc-edit" class="input textarea" style="display: none;">
94 <div id="pr-desc-edit" class="input textarea" style="display: none;">
95 <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}">
95 <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}">
96 ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)}
96 ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)}
97 </div>
97 </div>
98
98
99 <div id="summary" class="fields pr-details-content">
99 <div id="summary" class="fields pr-details-content">
100
100
101 ## source
101 ## source
102 <div class="field">
102 <div class="field">
103 <div class="label-pr-detail">
103 <div class="label-pr-detail">
104 <label>${_('Commit flow')}:</label>
104 <label>${_('Commit flow')}:</label>
105 </div>
105 </div>
106 <div class="input">
106 <div class="input">
107 <div class="pr-commit-flow">
107 <div class="pr-commit-flow">
108 ## Source
108 ## Source
109 %if c.pull_request.source_ref_parts.type == 'branch':
109 %if c.pull_request.source_ref_parts.type == 'branch':
110 <a href="${h.route_path('repo_commits', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}"><code class="pr-source-info">${c.pull_request.source_ref_parts.type}:${c.pull_request.source_ref_parts.name}</code></a>
110 <a href="${h.route_path('repo_commits', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}"><code class="pr-source-info">${c.pull_request.source_ref_parts.type}:${c.pull_request.source_ref_parts.name}</code></a>
111 %else:
111 %else:
112 <code class="pr-source-info">${'{}:{}'.format(c.pull_request.source_ref_parts.type, c.pull_request.source_ref_parts.name)}</code>
112 <code class="pr-source-info">${'{}:{}'.format(c.pull_request.source_ref_parts.type, c.pull_request.source_ref_parts.name)}</code>
113 %endif
113 %endif
114 ${_('of')} <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.repo_name}</a>
114 ${_('of')} <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.repo_name}</a>
115 &rarr;
115 &rarr;
116 ## Target
116 ## Target
117 %if c.pull_request.target_ref_parts.type == 'branch':
117 %if c.pull_request.target_ref_parts.type == 'branch':
118 <a href="${h.route_path('repo_commits', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}"><code class="pr-target-info">${c.pull_request.target_ref_parts.type}:${c.pull_request.target_ref_parts.name}</code></a>
118 <a href="${h.route_path('repo_commits', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}"><code class="pr-target-info">${c.pull_request.target_ref_parts.type}:${c.pull_request.target_ref_parts.name}</code></a>
119 %else:
119 %else:
120 <code class="pr-target-info">${'{}:{}'.format(c.pull_request.target_ref_parts.type, c.pull_request.target_ref_parts.name)}</code>
120 <code class="pr-target-info">${'{}:{}'.format(c.pull_request.target_ref_parts.type, c.pull_request.target_ref_parts.name)}</code>
121 %endif
121 %endif
122
122
123 ${_('of')} <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.repo_name}</a>
123 ${_('of')} <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.repo_name}</a>
124
124
125 <a class="source-details-action" href="#expand-source-details" onclick="return toggleElement(this, '.source-details')" data-toggle-on='<i class="icon-angle-down">more details</i>' data-toggle-off='<i class="icon-angle-up">less details</i>'>
125 <a class="source-details-action" href="#expand-source-details" onclick="return toggleElement(this, '.source-details')" data-toggle-on='<i class="icon-angle-down">more details</i>' data-toggle-off='<i class="icon-angle-up">less details</i>'>
126 <i class="icon-angle-down">more details</i>
126 <i class="icon-angle-down">more details</i>
127 </a>
127 </a>
128
128
129 </div>
129 </div>
130
130
131 <div class="source-details" style="display: none">
131 <div class="source-details" style="display: none">
132
132
133 <ul>
133 <ul>
134
134
135 ## common ancestor
135 ## common ancestor
136 <li>
136 <li>
137 ${_('Common ancestor')}:
137 ${_('Common ancestor')}:
138 % if c.ancestor_commit:
138 % if c.ancestor_commit:
139 <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a>
139 <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a>
140 % else:
140 % else:
141 ${_('not available')}
141 ${_('not available')}
142 % endif
142 % endif
143 </li>
143 </li>
144
144
145 ## pull url
145 ## pull url
146 <li>
146 <li>
147 %if h.is_hg(c.pull_request.source_repo):
147 %if h.is_hg(c.pull_request.source_repo):
148 <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %>
148 <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %>
149 %elif h.is_git(c.pull_request.source_repo):
149 %elif h.is_git(c.pull_request.source_repo):
150 <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %>
150 <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %>
151 %endif
151 %endif
152
152
153 <span>${_('Pull changes from source')}</span>: <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly">
153 <span>${_('Pull changes from source')}</span>: <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly">
154 <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i>
154 <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i>
155 </li>
155 </li>
156
156
157 ## Shadow repo
157 ## Shadow repo
158 <li>
158 <li>
159 % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
159 % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
160 %if h.is_hg(c.pull_request.target_repo):
160 %if h.is_hg(c.pull_request.target_repo):
161 <% clone_url = 'hg clone --update {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %>
161 <% clone_url = 'hg clone --update {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %>
162 %elif h.is_git(c.pull_request.target_repo):
162 %elif h.is_git(c.pull_request.target_repo):
163 <% clone_url = 'git clone --branch {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %>
163 <% clone_url = 'git clone --branch {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %>
164 %endif
164 %endif
165
165
166 <span class="tooltip" title="${_('Clone repository in its merged state using shadow repository')}">${_('Clone from shadow repository')}</span>: <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly">
166 <span class="tooltip" title="${_('Clone repository in its merged state using shadow repository')}">${_('Clone from shadow repository')}</span>: <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly">
167 <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i>
167 <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i>
168
168
169 % else:
169 % else:
170 <div class="">
170 <div class="">
171 ${_('Shadow repository data not available')}.
171 ${_('Shadow repository data not available')}.
172 </div>
172 </div>
173 % endif
173 % endif
174 </li>
174 </li>
175
175
176 </ul>
176 </ul>
177
177
178 </div>
178 </div>
179
179
180 </div>
180 </div>
181
181
182 </div>
182 </div>
183
183
184 ## versions
184 ## versions
185 <div class="field">
185 <div class="field">
186 <div class="label-pr-detail">
186 <div class="label-pr-detail">
187 <label>${_('Versions')}:</label>
187 <label>${_('Versions')}:</label>
188 </div>
188 </div>
189
189
190 <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %>
190 <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %>
191 <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %>
191 <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %>
192
192
193 <div class="pr-versions">
193 <div class="pr-versions">
194 % if c.show_version_changes:
194 % if c.show_version_changes:
195 <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %>
195 <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %>
196 <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %>
196 <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %>
197 ${_ungettext('{} version available for this pull request, ', '{} versions available for this pull request, ', len(c.versions)).format(len(c.versions))}
197 ${_ungettext('{} version available for this pull request, ', '{} versions available for this pull request, ', len(c.versions)).format(len(c.versions))}
198 <a id="show-pr-versions" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions"
198 <a id="show-pr-versions" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions"
199 data-toggle-on="${_('show versions')}."
199 data-toggle-on="${_('show versions')}."
200 data-toggle-off="${_('hide versions')}.">
200 data-toggle-off="${_('hide versions')}.">
201 ${_('show versions')}.
201 ${_('show versions')}.
202 </a>
202 </a>
203 <table>
203 <table>
204 ## SHOW ALL VERSIONS OF PR
204 ## SHOW ALL VERSIONS OF PR
205 <% ver_pr = None %>
205 <% ver_pr = None %>
206
206
207 % for data in reversed(list(enumerate(c.versions, 1))):
207 % for data in reversed(list(enumerate(c.versions, 1))):
208 <% ver_pos = data[0] %>
208 <% ver_pos = data[0] %>
209 <% ver = data[1] %>
209 <% ver = data[1] %>
210 <% ver_pr = ver.pull_request_version_id %>
210 <% ver_pr = ver.pull_request_version_id %>
211 <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %>
211 <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %>
212
212
213 <tr class="version-pr" style="display: ${display_row}">
213 <tr class="version-pr" style="display: ${display_row}">
214 <td>
214 <td>
215 <code>
215 <code>
216 <a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a>
216 <a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a>
217 </code>
217 </code>
218 </td>
218 </td>
219 <td>
219 <td>
220 <input ${('checked="checked"' if c.from_version_index == ver_pr else '')} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/>
220 <input ${('checked="checked"' if c.from_version_index == ver_pr else '')} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/>
221 <input ${('checked="checked"' if c.at_version_num == ver_pr else '')} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/>
221 <input ${('checked="checked"' if c.at_version_num == ver_pr else '')} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/>
222 </td>
222 </td>
223 <td>
223 <td>
224 <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %>
224 <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %>
225 <i class="tooltip icon-circle review-status-${review_status}" title="${_('Your review status at this version')}"></i>
225 <i class="tooltip icon-circle review-status-${review_status}" title="${_('Your review status at this version')}"></i>
226
226
227 </td>
227 </td>
228 <td>
228 <td>
229 % if c.at_version_num != ver_pr:
229 % if c.at_version_num != ver_pr:
230 <i class="tooltip icon-comment" title="${_('Comments from pull request version v{0}').format(ver_pos)}"></i>
230 <i class="tooltip icon-comment" title="${_('Comments from pull request version v{0}').format(ver_pos)}"></i>
231 <code>
231 <code>
232 General:${len(c.comment_versions[ver_pr]['at'])} / Inline:${len(c.inline_versions[ver_pr]['at'])}
232 General:${len(c.comment_versions[ver_pr]['at'])} / Inline:${len(c.inline_versions[ver_pr]['at'])}
233 </code>
233 </code>
234 % endif
234 % endif
235 </td>
235 </td>
236 <td>
236 <td>
237 ##<code>${ver.source_ref_parts.commit_id[:6]}</code>
237 ##<code>${ver.source_ref_parts.commit_id[:6]}</code>
238 </td>
238 </td>
239 <td>
239 <td>
240 <code>${h.age_component(ver.updated_on, time_is_local=True, tooltip=False)}</code>
240 <code>${h.age_component(ver.updated_on, time_is_local=True, tooltip=False)}</code>
241 </td>
241 </td>
242 </tr>
242 </tr>
243 % endfor
243 % endfor
244
244
245 <tr>
245 <tr>
246 <td colspan="6">
246 <td colspan="6">
247 <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none"
247 <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none"
248 data-label-text-locked="${_('select versions to show changes')}"
248 data-label-text-locked="${_('select versions to show changes')}"
249 data-label-text-diff="${_('show changes between versions')}"
249 data-label-text-diff="${_('show changes between versions')}"
250 data-label-text-show="${_('show pull request for this version')}"
250 data-label-text-show="${_('show pull request for this version')}"
251 >
251 >
252 ${_('select versions to show changes')}
252 ${_('select versions to show changes')}
253 </button>
253 </button>
254 </td>
254 </td>
255 </tr>
255 </tr>
256 </table>
256 </table>
257 % else:
257 % else:
258 <div>
258 <div>
259 ${_('Pull request versions not available')}.
259 ${_('Pull request versions not available')}.
260 </div>
260 </div>
261 % endif
261 % endif
262 </div>
262 </div>
263 </div>
263 </div>
264
264
265 </div>
265 </div>
266
266
267 </div>
267 </div>
268
268
269
269
270 </div>
270 </div>
271
271
272 </div>
272 </div>
273
273
274 <div class="box">
274 <div class="box">
275
275
276 % if c.state_progressing:
276 % if c.state_progressing:
277
277
278 <h2 style="text-align: center">
278 <h2 style="text-align: center">
279 ${_('Cannot show diff when pull request state is changing. Current progress state')}: <span class="tag tag-merge-state-${c.pull_request.state}">${c.pull_request.state}</span>
279 ${_('Cannot show diff when pull request state is changing. Current progress state')}: <span class="tag tag-merge-state-${c.pull_request.state}">${c.pull_request.state}</span>
280
280
281 % if c.is_super_admin:
281 % if c.is_super_admin:
282 <br/>
282 <br/>
283 If you think this is an error try <a href="${h.current_route_path(request, force_state='created')}">forced state reset</a> to <span class="tag tag-merge-state-created">created</span> state.
283 If you think this is an error try <a href="${h.current_route_path(request, force_state='created')}">forced state reset</a> to <span class="tag tag-merge-state-created">created</span> state.
284 % endif
284 % endif
285 </h2>
285 </h2>
286
286
287 % else:
287 % else:
288
288
289 ## Diffs rendered here
289 ## Diffs rendered here
290 <div class="table" >
290 <div class="table" >
291 <div id="changeset_compare_view_content">
291 <div id="changeset_compare_view_content">
292 ##CS
292 ##CS
293 % if c.missing_requirements:
293 % if c.missing_requirements:
294 <div class="box">
294 <div class="box">
295 <div class="alert alert-warning">
295 <div class="alert alert-warning">
296 <div>
296 <div>
297 <strong>${_('Missing requirements:')}</strong>
297 <strong>${_('Missing requirements:')}</strong>
298 ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
298 ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
299 </div>
299 </div>
300 </div>
300 </div>
301 </div>
301 </div>
302 % elif c.missing_commits:
302 % elif c.missing_commits:
303 <div class="box">
303 <div class="box">
304 <div class="alert alert-warning">
304 <div class="alert alert-warning">
305 <div>
305 <div>
306 <strong>${_('Missing commits')}:</strong>
306 <strong>${_('Missing commits')}:</strong>
307 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}<br/>
307 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}<br/>
308 ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}<br/>
308 ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}<br/>
309 ${_('Consider doing a `force update commits` in case you think this is an error.')}
309 ${_('Consider doing a `force update commits` in case you think this is an error.')}
310 </div>
310 </div>
311 </div>
311 </div>
312 </div>
312 </div>
313 % elif c.pr_merge_source_commit.changed and not c.pull_request.is_closed():
313 % elif c.pr_merge_source_commit.changed and not c.pull_request.is_closed():
314 <div class="box">
314 <div class="box">
315 <div class="alert alert-info">
315 <div class="alert alert-info">
316 <div>
316 <div>
317 <strong>${_('There are new changes for `{}:{}` in source repository, please consider updating this pull request.').format(c.pr_merge_source_commit.ref_spec.type, c.pr_merge_source_commit.ref_spec.name)}</strong>
317 <strong>${_('There are new changes for `{}:{}` in source repository, please consider updating this pull request.').format(c.pr_merge_source_commit.ref_spec.type, c.pr_merge_source_commit.ref_spec.name)}</strong>
318 </div>
318 </div>
319 </div>
319 </div>
320 </div>
320 </div>
321 % endif
321 % endif
322
322
323 <div class="compare_view_commits_title">
323 <div class="compare_view_commits_title">
324 % if not c.compare_mode:
324 % if not c.compare_mode:
325
325
326 % if c.at_version_index:
326 % if c.at_version_index:
327 <h4>
327 <h4>
328 ${_('Showing changes at v{}, commenting is disabled.').format(c.at_version_index)}
328 ${_('Showing changes at v{}, commenting is disabled.').format(c.at_version_index)}
329 </h4>
329 </h4>
330 % endif
330 % endif
331
331
332 <div class="pull-left">
332 <div class="pull-left">
333 <div class="btn-group">
333 <div class="btn-group">
334 <a class="${('collapsed' if c.collapse_all_commits else '')}" href="#expand-commits" onclick="toggleCommitExpand(this); return false" data-toggle-commits-cnt=${len(c.commit_ranges)} >
334 <a class="${('collapsed' if c.collapse_all_commits else '')}" href="#expand-commits" onclick="toggleCommitExpand(this); return false" data-toggle-commits-cnt=${len(c.commit_ranges)} >
335 % if c.collapse_all_commits:
335 % if c.collapse_all_commits:
336 <i class="icon-plus-squared-alt icon-no-margin"></i>
336 <i class="icon-plus-squared-alt icon-no-margin"></i>
337 ${_ungettext('Expand {} commit', 'Expand {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
337 ${_ungettext('Expand {} commit', 'Expand {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
338 % else:
338 % else:
339 <i class="icon-minus-squared-alt icon-no-margin"></i>
339 <i class="icon-minus-squared-alt icon-no-margin"></i>
340 ${_ungettext('Collapse {} commit', 'Collapse {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
340 ${_ungettext('Collapse {} commit', 'Collapse {} commits', len(c.commit_ranges)).format(len(c.commit_ranges))}
341 % endif
341 % endif
342 </a>
342 </a>
343 </div>
343 </div>
344 </div>
344 </div>
345
345
346 <div class="pull-right">
346 <div class="pull-right">
347 % if c.allowed_to_update and not c.pull_request.is_closed():
347 % if c.allowed_to_update and not c.pull_request.is_closed():
348
348
349 <div class="btn-group btn-group-actions">
349 <div class="btn-group btn-group-actions">
350 <a id="update_commits" class="btn btn-primary no-margin" onclick="updateController.updateCommits(this); return false">
350 <a id="update_commits" class="btn btn-primary no-margin" onclick="updateController.updateCommits(this); return false">
351 ${_('Update commits')}
351 ${_('Update commits')}
352 </a>
352 </a>
353
353
354 <a id="update_commits_switcher" class="tooltip btn btn-primary btn-more-option" data-toggle="dropdown" aria-pressed="false" role="button" title="${_('more update options')}">
354 <a id="update_commits_switcher" class="tooltip btn btn-primary btn-more-option" data-toggle="dropdown" aria-pressed="false" role="button" title="${_('more update options')}">
355 <i class="icon-down"></i>
355 <i class="icon-down"></i>
356 </a>
356 </a>
357
357
358 <div class="btn-action-switcher-container right-align" id="update-commits-switcher">
358 <div class="btn-action-switcher-container right-align" id="update-commits-switcher">
359 <ul class="btn-action-switcher" role="menu" style="min-width: 300px;">
359 <ul class="btn-action-switcher" role="menu" style="min-width: 300px;">
360 <li>
360 <li>
361 <a href="#forceUpdate" onclick="updateController.forceUpdateCommits(this); return false">
361 <a href="#forceUpdate" onclick="updateController.forceUpdateCommits(this); return false">
362 ${_('Force update commits')}
362 ${_('Force update commits')}
363 </a>
363 </a>
364 <div class="action-help-block">
364 <div class="action-help-block">
365 ${_('Update commits and force refresh this pull request.')}
365 ${_('Update commits and force refresh this pull request.')}
366 </div>
366 </div>
367 </li>
367 </li>
368 </ul>
368 </ul>
369 </div>
369 </div>
370 </div>
370 </div>
371
371
372 % else:
372 % else:
373 <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a>
373 <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a>
374 % endif
374 % endif
375
375
376 </div>
376 </div>
377 % endif
377 % endif
378 </div>
378 </div>
379
379
380 % if not c.missing_commits:
380 % if not c.missing_commits:
381 ## COMPARE RANGE DIFF MODE
381 ## COMPARE RANGE DIFF MODE
382 % if c.compare_mode:
382 % if c.compare_mode:
383 % if c.at_version:
383 % if c.at_version:
384 <h4>
384 <h4>
385 ${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_index, ver_to=c.at_version_index if c.at_version_index else 'latest')}:
385 ${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_index, ver_to=c.at_version_index if c.at_version_index else 'latest')}:
386 </h4>
386 </h4>
387
387
388 <div class="subtitle-compare">
388 <div class="subtitle-compare">
389 ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))}
389 ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))}
390 </div>
390 </div>
391
391
392 <div class="container">
392 <div class="container">
393 <table class="rctable compare_view_commits">
393 <table class="rctable compare_view_commits">
394 <tr>
394 <tr>
395 <th></th>
395 <th></th>
396 <th>${_('Time')}</th>
396 <th>${_('Time')}</th>
397 <th>${_('Author')}</th>
397 <th>${_('Author')}</th>
398 <th>${_('Commit')}</th>
398 <th>${_('Commit')}</th>
399 <th></th>
399 <th></th>
400 <th>${_('Description')}</th>
400 <th>${_('Description')}</th>
401 </tr>
401 </tr>
402
402
403 % for c_type, commit in c.commit_changes:
403 % for c_type, commit in c.commit_changes:
404 % if c_type in ['a', 'r']:
404 % if c_type in ['a', 'r']:
405 <%
405 <%
406 if c_type == 'a':
406 if c_type == 'a':
407 cc_title = _('Commit added in displayed changes')
407 cc_title = _('Commit added in displayed changes')
408 elif c_type == 'r':
408 elif c_type == 'r':
409 cc_title = _('Commit removed in displayed changes')
409 cc_title = _('Commit removed in displayed changes')
410 else:
410 else:
411 cc_title = ''
411 cc_title = ''
412 %>
412 %>
413 <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select">
413 <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select">
414 <td>
414 <td>
415 <div class="commit-change-indicator color-${c_type}-border">
415 <div class="commit-change-indicator color-${c_type}-border">
416 <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}">
416 <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}">
417 ${c_type.upper()}
417 ${c_type.upper()}
418 </div>
418 </div>
419 </div>
419 </div>
420 </td>
420 </td>
421 <td class="td-time">
421 <td class="td-time">
422 ${h.age_component(commit.date)}
422 ${h.age_component(commit.date)}
423 </td>
423 </td>
424 <td class="td-user">
424 <td class="td-user">
425 ${base.gravatar_with_user(commit.author, 16, tooltip=True)}
425 ${base.gravatar_with_user(commit.author, 16, tooltip=True)}
426 </td>
426 </td>
427 <td class="td-hash">
427 <td class="td-hash">
428 <code>
428 <code>
429 <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}">
429 <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}">
430 r${commit.idx}:${h.short_id(commit.raw_id)}
430 r${commit.idx}:${h.short_id(commit.raw_id)}
431 </a>
431 </a>
432 ${h.hidden('revisions', commit.raw_id)}
432 ${h.hidden('revisions', commit.raw_id)}
433 </code>
433 </code>
434 </td>
434 </td>
435 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}" onclick="commitsController.expandCommit(this); return false">
435 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}" onclick="commitsController.expandCommit(this); return false">
436 <i class="icon-expand-linked"></i>
436 <i class="icon-expand-linked"></i>
437 </td>
437 </td>
438 <td class="mid td-description">
438 <td class="mid td-description">
439 <div class="log-container truncate-wrap">
439 <div class="log-container truncate-wrap">
440 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${h.urlify_commit_message(commit.message, c.repo_name, issues_container=c.referenced_commit_issues)}</div>
440 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${h.urlify_commit_message(commit.message, c.repo_name, issues_container=c.referenced_commit_issues)}</div>
441 </div>
441 </div>
442 </td>
442 </td>
443 </tr>
443 </tr>
444 % endif
444 % endif
445 % endfor
445 % endfor
446 </table>
446 </table>
447 </div>
447 </div>
448
448
449 % endif
449 % endif
450
450
451 ## Regular DIFF
451 ## Regular DIFF
452 % else:
452 % else:
453 <%include file="/compare/compare_commits.mako" />
453 <%include file="/compare/compare_commits.mako" />
454 % endif
454 % endif
455
455
456 <div class="cs_files">
456 <div class="cs_files">
457 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
457 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
458
458
459 <%
459 <%
460 pr_menu_data = {
460 pr_menu_data = {
461 'outdated_comm_count_ver': outdated_comm_count_ver,
461 'outdated_comm_count_ver': outdated_comm_count_ver,
462 'pull_request': c.pull_request
462 'pull_request': c.pull_request
463 }
463 }
464 %>
464 %>
465
465
466 ${cbdiffs.render_diffset_menu(c.diffset, range_diff_on=c.range_diff_on, pull_request_menu=pr_menu_data)}
466 ${cbdiffs.render_diffset_menu(c.diffset, range_diff_on=c.range_diff_on, pull_request_menu=pr_menu_data)}
467
467
468 % if c.range_diff_on:
468 % if c.range_diff_on:
469 % for commit in c.commit_ranges:
469 % for commit in c.commit_ranges:
470 ${cbdiffs.render_diffset(
470 ${cbdiffs.render_diffset(
471 c.changes[commit.raw_id],
471 c.changes[commit.raw_id],
472 commit=commit, use_comments=True,
472 commit=commit, use_comments=True,
473 collapse_when_files_over=5,
473 collapse_when_files_over=5,
474 disable_new_comments=True,
474 disable_new_comments=True,
475 deleted_files_comments=c.deleted_files_comments,
475 deleted_files_comments=c.deleted_files_comments,
476 inline_comments=c.inline_comments,
476 inline_comments=c.inline_comments,
477 pull_request_menu=pr_menu_data, show_todos=False)}
477 pull_request_menu=pr_menu_data, show_todos=False)}
478 % endfor
478 % endfor
479 % else:
479 % else:
480 ${cbdiffs.render_diffset(
480 ${cbdiffs.render_diffset(
481 c.diffset, use_comments=True,
481 c.diffset, use_comments=True,
482 collapse_when_files_over=30,
482 collapse_when_files_over=30,
483 disable_new_comments=not c.allowed_to_comment,
483 disable_new_comments=not c.allowed_to_comment,
484 deleted_files_comments=c.deleted_files_comments,
484 deleted_files_comments=c.deleted_files_comments,
485 inline_comments=c.inline_comments,
485 inline_comments=c.inline_comments,
486 pull_request_menu=pr_menu_data, show_todos=False)}
486 pull_request_menu=pr_menu_data, show_todos=False)}
487 % endif
487 % endif
488
488
489 </div>
489 </div>
490 % else:
490 % else:
491 ## skipping commits we need to clear the view for missing commits
491 ## skipping commits we need to clear the view for missing commits
492 <div style="clear:both;"></div>
492 <div style="clear:both;"></div>
493 % endif
493 % endif
494
494
495 </div>
495 </div>
496 </div>
496 </div>
497
497
498 ## template for inline comment form
498 ## template for inline comment form
499 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
499 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
500
500
501 ## comments heading with count
501 ## comments heading with count
502 <div class="comments-heading">
502 <div class="comments-heading">
503 <i class="icon-comment"></i>
503 <i class="icon-comment"></i>
504 ${_('General Comments')} ${len(c.comments)}
504 ${_('General Comments')} ${len(c.comments)}
505 </div>
505 </div>
506
506
507 ## render general comments
507 ## render general comments
508 <div id="comment-tr-show">
508 <div id="comment-tr-show">
509 % if general_outdated_comm_count_ver:
509 % if general_outdated_comm_count_ver:
510 <div class="info-box">
510 <div class="info-box">
511 % if general_outdated_comm_count_ver == 1:
511 % if general_outdated_comm_count_ver == 1:
512 ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)},
512 ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)},
513 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a>
513 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a>
514 % else:
514 % else:
515 ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)},
515 ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)},
516 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a>
516 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a>
517 % endif
517 % endif
518 </div>
518 </div>
519 % endif
519 % endif
520 </div>
520 </div>
521
521
522 ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)}
522 ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)}
523
523
524 % if not c.pull_request.is_closed():
524 % if not c.pull_request.is_closed():
525 ## main comment form and it status
525 ## main comment form and it status
526 ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name,
526 ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name,
527 pull_request_id=c.pull_request.pull_request_id),
527 pull_request_id=c.pull_request.pull_request_id),
528 c.pull_request_review_status,
528 c.pull_request_review_status,
529 is_pull_request=True, change_status=c.allowed_to_change_status)}
529 is_pull_request=True, change_status=c.allowed_to_change_status)}
530
530
531 ## merge status, and merge action
531 ## merge status, and merge action
532 <div class="pull-request-merge">
532 <div class="pull-request-merge">
533 <%include file="/pullrequests/pullrequest_merge_checks.mako"/>
533 <%include file="/pullrequests/pullrequest_merge_checks.mako"/>
534 </div>
534 </div>
535
535
536 %endif
536 %endif
537
537
538 % endif
538 % endif
539 </div>
539 </div>
540
540
541
541
542 ### NAV SIDEBAR
542 ### NAV SIDEBAR
543 <aside class="right-sidebar right-sidebar-expanded" id="pr-nav-sticky" style="display: none">
543 <aside class="right-sidebar right-sidebar-expanded" id="pr-nav-sticky" style="display: none">
544 <div class="sidenav navbar__inner" >
544 <div class="sidenav navbar__inner" >
545 ## TOGGLE
545 ## TOGGLE
546 <div class="sidebar-toggle" onclick="toggleSidebar(); return false">
546 <div class="sidebar-toggle" onclick="toggleSidebar(); return false">
547 <a href="#toggleSidebar" class="grey-link-action">
547 <a href="#toggleSidebar" class="grey-link-action">
548
548
549 </a>
549 </a>
550 </div>
550 </div>
551
551
552 ## CONTENT
552 ## CONTENT
553 <div class="sidebar-content">
553 <div class="sidebar-content">
554
554
555 ## RULES SUMMARY/RULES
555 ## RULES SUMMARY/RULES
556 <div class="sidebar-element clear-both">
556 <div class="sidebar-element clear-both">
557 <% vote_title = _ungettext(
557 <% vote_title = _ungettext(
558 'Status calculated based on votes from {} reviewer',
558 'Status calculated based on votes from {} reviewer',
559 'Status calculated based on votes from {} reviewers', c.reviewers_count).format(c.reviewers_count)
559 'Status calculated based on votes from {} reviewers', c.reviewers_count).format(c.reviewers_count)
560 %>
560 %>
561
561
562 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${vote_title}">
562 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${vote_title}">
563 <i class="icon-circle review-status-${c.pull_request_review_status}"></i>
563 <i class="icon-circle review-status-${c.pull_request_review_status}"></i>
564 ${c.reviewers_count}
564 ${c.reviewers_count}
565 </div>
565 </div>
566
566
567 ## REVIEW RULES
567 ## REVIEW RULES
568 <div id="review_rules" style="display: none" class="">
568 <div id="review_rules" style="display: none" class="">
569 <div class="right-sidebar-expanded-state pr-details-title">
569 <div class="right-sidebar-expanded-state pr-details-title">
570 <span class="sidebar-heading">
570 <span class="sidebar-heading">
571 ${_('Reviewer rules')}
571 ${_('Reviewer rules')}
572 </span>
572 </span>
573
573
574 </div>
574 </div>
575 <div class="pr-reviewer-rules">
575 <div class="pr-reviewer-rules">
576 ## review rules will be appended here, by default reviewers logic
576 ## review rules will be appended here, by default reviewers logic
577 </div>
577 </div>
578 <input id="review_data" type="hidden" name="review_data" value="">
578 <input id="review_data" type="hidden" name="review_data" value="">
579 </div>
579 </div>
580
580
581 ## REVIEWERS
581 ## REVIEWERS
582 <div class="right-sidebar-expanded-state pr-details-title">
582 <div class="right-sidebar-expanded-state pr-details-title">
583 <span class="tooltip sidebar-heading" title="${vote_title}">
583 <span class="tooltip sidebar-heading" title="${vote_title}">
584 <i class="icon-circle review-status-${c.pull_request_review_status}"></i>
584 <i class="icon-circle review-status-${c.pull_request_review_status}"></i>
585 ${_('Reviewers')}
585 ${_('Reviewers')}
586 </span>
586 </span>
587 %if c.allowed_to_update:
587 %if c.allowed_to_update:
588 <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span>
588 <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span>
589 <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
589 <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
590 %else:
590 %else:
591 <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Show rules')}</span>
591 <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Show rules')}</span>
592 <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
592 <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
593 %endif
593 %endif
594 </div>
594 </div>
595
595
596 <div id="reviewers" class="right-sidebar-expanded-state pr-details-content reviewers">
596 <div id="reviewers" class="right-sidebar-expanded-state pr-details-content reviewers">
597
597
598 ## members redering block
598 ## members redering block
599 <input type="hidden" name="__start__" value="review_members:sequence">
599 <input type="hidden" name="__start__" value="review_members:sequence">
600
600
601 <table id="review_members" class="group_members">
601 <table id="review_members" class="group_members">
602 ## This content is loaded via JS and ReviewersPanel
602 ## This content is loaded via JS and ReviewersPanel
603 </table>
603 </table>
604
604
605 <input type="hidden" name="__end__" value="review_members:sequence">
605 <input type="hidden" name="__end__" value="review_members:sequence">
606 ## end members redering block
606 ## end members redering block
607
607
608 %if not c.pull_request.is_closed():
608 %if not c.pull_request.is_closed():
609 <div id="add_reviewer" class="ac" style="display: none;">
609 <div id="add_reviewer" class="ac" style="display: none;">
610 %if c.allowed_to_update:
610 %if c.allowed_to_update:
611 % if not c.forbid_adding_reviewers:
611 % if not c.forbid_adding_reviewers:
612 <div id="add_reviewer_input" class="reviewer_ac" style="width: 240px">
612 <div id="add_reviewer_input" class="reviewer_ac" style="width: 240px">
613 <input class="ac-input" id="user" name="user" placeholder="${_('Add reviewer or reviewer group')}" type="text" autocomplete="off">
613 <input class="ac-input" id="user" name="user" placeholder="${_('Add reviewer or reviewer group')}" type="text" autocomplete="off">
614 <div id="reviewers_container"></div>
614 <div id="reviewers_container"></div>
615 </div>
615 </div>
616 % endif
616 % endif
617 <div class="pull-right" style="margin-bottom: 15px">
617 <div class="pull-right" style="margin-bottom: 15px">
618 <button data-role="reviewer" id="update_reviewers" class="btn btn-small no-margin">${_('Save Changes')}</button>
618 <button data-role="reviewer" id="update_reviewers" class="btn btn-small no-margin">${_('Save Changes')}</button>
619 </div>
619 </div>
620 %endif
620 %endif
621 </div>
621 </div>
622 %endif
622 %endif
623 </div>
623 </div>
624 </div>
624 </div>
625
625
626 ## OBSERVERS
626 ## OBSERVERS
627 <div class="sidebar-element clear-both">
627 <div class="sidebar-element clear-both">
628 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${_('Observers')}">
628 <% vote_title = _ungettext(
629 '{} observer without voting right.',
630 '{} observers without voting right.', c.observers_count).format(c.observers_count)
631 %>
632
633 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${vote_title}">
629 <i class="icon-circle-thin"></i>
634 <i class="icon-circle-thin"></i>
630 ${c.observers_count}
635 ${c.observers_count}
631 </div>
636 </div>
632
637
633 <div class="right-sidebar-expanded-state pr-details-title">
638 <div class="right-sidebar-expanded-state pr-details-title">
634 <span class="sidebar-heading">
639 <span class="tooltip sidebar-heading" title="${vote_title}">
635 <i class="icon-circle-thin"></i>
640 <i class="icon-circle-thin"></i>
636 ${_('Observers')}
641 ${_('Observers')}
637 </span>
642 </span>
638 %if c.allowed_to_update:
643 %if c.allowed_to_update:
639 <span id="open_edit_observers" class="block-right action_button last-item">${_('Edit')}</span>
644 <span id="open_edit_observers" class="block-right action_button last-item">${_('Edit')}</span>
640 <span id="close_edit_observers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
645 <span id="close_edit_observers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
641 %endif
646 %endif
642 </div>
647 </div>
643
648
644 <div id="observers" class="right-sidebar-expanded-state pr-details-content reviewers">
649 <div id="observers" class="right-sidebar-expanded-state pr-details-content reviewers">
645 ## members redering block
650 ## members redering block
646 <input type="hidden" name="__start__" value="observer_members:sequence">
651 <input type="hidden" name="__start__" value="observer_members:sequence">
647
652
648 <table id="observer_members" class="group_members">
653 <table id="observer_members" class="group_members">
649 ## This content is loaded via JS and ReviewersPanel
654 ## This content is loaded via JS and ReviewersPanel
650 </table>
655 </table>
651
656
652 <input type="hidden" name="__end__" value="observer_members:sequence">
657 <input type="hidden" name="__end__" value="observer_members:sequence">
653 ## end members redering block
658 ## end members redering block
654
659
655 %if not c.pull_request.is_closed():
660 %if not c.pull_request.is_closed():
656 <div id="add_observer" class="ac" style="display: none;">
661 <div id="add_observer" class="ac" style="display: none;">
657 %if c.allowed_to_update:
662 %if c.allowed_to_update:
658 % if not c.forbid_adding_reviewers or 1:
663 % if not c.forbid_adding_reviewers or 1:
659 <div id="add_reviewer_input" class="reviewer_ac" style="width: 240px" >
664 <div id="add_reviewer_input" class="reviewer_ac" style="width: 240px" >
660 <input class="ac-input" id="observer" name="observer" placeholder="${_('Add observer or observer group')}" type="text" autocomplete="off">
665 <input class="ac-input" id="observer" name="observer" placeholder="${_('Add observer or observer group')}" type="text" autocomplete="off">
661 <div id="observers_container"></div>
666 <div id="observers_container"></div>
662 </div>
667 </div>
663 % endif
668 % endif
664 <div class="pull-right" style="margin-bottom: 15px">
669 <div class="pull-right" style="margin-bottom: 15px">
665 <button data-role="observer" id="update_observers" class="btn btn-small no-margin">${_('Save Changes')}</button>
670 <button data-role="observer" id="update_observers" class="btn btn-small no-margin">${_('Save Changes')}</button>
666 </div>
671 </div>
667 %endif
672 %endif
668 </div>
673 </div>
669 %endif
674 %endif
670 </div>
675 </div>
671 </div>
676 </div>
672
677
673 ## TODOs
678 ## TODOs
674 <div class="sidebar-element clear-both">
679 <div class="sidebar-element clear-both">
675 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="TODOs">
680 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="TODOs">
676 <i class="icon-flag-filled"></i>
681 <i class="icon-flag-filled"></i>
677 <span id="todos-count">${len(c.unresolved_comments)}</span>
682 <span id="todos-count">${len(c.unresolved_comments)}</span>
678 </div>
683 </div>
679
684
680 <div class="right-sidebar-expanded-state pr-details-title">
685 <div class="right-sidebar-expanded-state pr-details-title">
681 ## Only show unresolved, that is only what matters
686 ## Only show unresolved, that is only what matters
682 <span class="sidebar-heading noselect" onclick="refreshTODOs(); return false">
687 <span class="sidebar-heading noselect" onclick="refreshTODOs(); return false">
683 <i class="icon-flag-filled"></i>
688 <i class="icon-flag-filled"></i>
684 TODOs
689 TODOs
685 </span>
690 </span>
686
691
687 % if not c.at_version:
692 % if not c.at_version:
688 % if c.resolved_comments:
693 % if c.resolved_comments:
689 <span class="block-right action_button last-item noselect" onclick="$('.unresolved-todo-text').toggle(); return toggleElement(this, '.resolved-todo');" data-toggle-on="Show resolved" data-toggle-off="Hide resolved">Show resolved</span>
694 <span class="block-right action_button last-item noselect" onclick="$('.unresolved-todo-text').toggle(); return toggleElement(this, '.resolved-todo');" data-toggle-on="Show resolved" data-toggle-off="Hide resolved">Show resolved</span>
690 % else:
695 % else:
691 <span class="block-right last-item noselect">Show resolved</span>
696 <span class="block-right last-item noselect">Show resolved</span>
692 % endif
697 % endif
693 % endif
698 % endif
694 </div>
699 </div>
695
700
696 <div class="right-sidebar-expanded-state pr-details-content">
701 <div class="right-sidebar-expanded-state pr-details-content">
697
702
698 % if c.at_version:
703 % if c.at_version:
699 <table>
704 <table>
700 <tr>
705 <tr>
701 <td class="unresolved-todo-text">${_('TODOs unavailable when browsing versions')}.</td>
706 <td class="unresolved-todo-text">${_('TODOs unavailable when browsing versions')}.</td>
702 </tr>
707 </tr>
703 </table>
708 </table>
704 % else:
709 % else:
705 % if c.unresolved_comments + c.resolved_comments:
710 % if c.unresolved_comments + c.resolved_comments:
706 ${sidebar.comments_table(c.unresolved_comments + c.resolved_comments, len(c.unresolved_comments), todo_comments=True)}
711 ${sidebar.comments_table(c.unresolved_comments + c.resolved_comments, len(c.unresolved_comments), todo_comments=True)}
707 % else:
712 % else:
708 <table>
713 <table>
709 <tr>
714 <tr>
710 <td>
715 <td>
711 ${_('No TODOs yet')}
716 ${_('No TODOs yet')}
712 </td>
717 </td>
713 </tr>
718 </tr>
714 </table>
719 </table>
715 % endif
720 % endif
716 % endif
721 % endif
717 </div>
722 </div>
718 </div>
723 </div>
719
724
720 ## COMMENTS
725 ## COMMENTS
721 <div class="sidebar-element clear-both">
726 <div class="sidebar-element clear-both">
722 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${_('Comments')}">
727 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${_('Comments')}">
723 <i class="icon-comment" style="color: #949494"></i>
728 <i class="icon-comment" style="color: #949494"></i>
724 <span id="comments-count">${len(c.inline_comments_flat+c.comments)}</span>
729 <span id="comments-count">${len(c.inline_comments_flat+c.comments)}</span>
725 <span class="display-none" id="general-comments-count">${len(c.comments)}</span>
730 <span class="display-none" id="general-comments-count">${len(c.comments)}</span>
726 <span class="display-none" id="inline-comments-count">${len(c.inline_comments_flat)}</span>
731 <span class="display-none" id="inline-comments-count">${len(c.inline_comments_flat)}</span>
727 </div>
732 </div>
728
733
729 <div class="right-sidebar-expanded-state pr-details-title">
734 <div class="right-sidebar-expanded-state pr-details-title">
730 <span class="sidebar-heading noselect" onclick="refreshComments(); return false">
735 <span class="sidebar-heading noselect" onclick="refreshComments(); return false">
731 <i class="icon-comment" style="color: #949494"></i>
736 <i class="icon-comment" style="color: #949494"></i>
732 ${_('Comments')}
737 ${_('Comments')}
733
738
734 ## % if outdated_comm_count_ver:
739 ## % if outdated_comm_count_ver:
735 ## <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">
740 ## <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">
736 ## (${_("{} Outdated").format(outdated_comm_count_ver)})
741 ## (${_("{} Outdated").format(outdated_comm_count_ver)})
737 ## </a>
742 ## </a>
738 ## <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated')}</a>
743 ## <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated')}</a>
739 ## <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated')}</a>
744 ## <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated')}</a>
740
745
741 ## % else:
746 ## % else:
742 ## (${_("{} Outdated").format(outdated_comm_count_ver)})
747 ## (${_("{} Outdated").format(outdated_comm_count_ver)})
743 ## % endif
748 ## % endif
744
749
745 </span>
750 </span>
746
751
747 % if outdated_comm_count_ver:
752 % if outdated_comm_count_ver:
748 <span class="block-right action_button last-item noselect" onclick="return toggleElement(this, '.hidden-comment');" data-toggle-on="Show outdated" data-toggle-off="Hide outdated">Show outdated</span>
753 <span class="block-right action_button last-item noselect" onclick="return toggleElement(this, '.hidden-comment');" data-toggle-on="Show outdated" data-toggle-off="Hide outdated">Show outdated</span>
749 % else:
754 % else:
750 <span class="block-right last-item noselect">Show hidden</span>
755 <span class="block-right last-item noselect">Show hidden</span>
751 % endif
756 % endif
752
757
753 </div>
758 </div>
754
759
755 <div class="right-sidebar-expanded-state pr-details-content">
760 <div class="right-sidebar-expanded-state pr-details-content">
756 % if c.inline_comments_flat + c.comments:
761 % if c.inline_comments_flat + c.comments:
757 ${sidebar.comments_table(c.inline_comments_flat + c.comments, len(c.inline_comments_flat+c.comments))}
762 ${sidebar.comments_table(c.inline_comments_flat + c.comments, len(c.inline_comments_flat+c.comments))}
758 % else:
763 % else:
759 <table>
764 <table>
760 <tr>
765 <tr>
761 <td>
766 <td>
762 ${_('No Comments yet')}
767 ${_('No Comments yet')}
763 </td>
768 </td>
764 </tr>
769 </tr>
765 </table>
770 </table>
766 % endif
771 % endif
767 </div>
772 </div>
768
773
769 </div>
774 </div>
770
775
771 ## Referenced Tickets
776 ## Referenced Tickets
772 <div class="sidebar-element clear-both">
777 <div class="sidebar-element clear-both">
773 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${_('Referenced Tickets')}">
778 <div class="tooltip right-sidebar-collapsed-state" style="display: none" onclick="toggleSidebar(); return false" title="${_('Referenced Tickets')}">
774 <i class="icon-info-circled"></i>
779 <i class="icon-info-circled"></i>
775 ${(len(c.referenced_desc_issues) + len(c.referenced_commit_issues))}
780 ${(len(c.referenced_desc_issues) + len(c.referenced_commit_issues))}
776 </div>
781 </div>
777
782
778 <div class="right-sidebar-expanded-state pr-details-title">
783 <div class="right-sidebar-expanded-state pr-details-title">
779 <span class="sidebar-heading">
784 <span class="sidebar-heading">
780 <i class="icon-info-circled"></i>
785 <i class="icon-info-circled"></i>
781 ${_('Referenced Tickets')}
786 ${_('Referenced Tickets')}
782 </span>
787 </span>
783 </div>
788 </div>
784 <div class="right-sidebar-expanded-state pr-details-content">
789 <div class="right-sidebar-expanded-state pr-details-content">
785 <table>
790 <table>
786
791
787 <tr><td><code>${_('In pull request description')}:</code></td></tr>
792 <tr><td><code>${_('In pull request description')}:</code></td></tr>
788 % if c.referenced_desc_issues:
793 % if c.referenced_desc_issues:
789 % for ticket_dict in sorted(c.referenced_desc_issues):
794 % for ticket_dict in sorted(c.referenced_desc_issues):
790 <tr>
795 <tr>
791 <td>
796 <td>
792 <a href="${ticket_dict.get('url')}">
797 <a href="${ticket_dict.get('url')}">
793 ${ticket_dict.get('id')}
798 ${ticket_dict.get('id')}
794 </a>
799 </a>
795 </td>
800 </td>
796 </tr>
801 </tr>
797 % endfor
802 % endfor
798 % else:
803 % else:
799 <tr>
804 <tr>
800 <td>
805 <td>
801 ${_('No Ticket data found.')}
806 ${_('No Ticket data found.')}
802 </td>
807 </td>
803 </tr>
808 </tr>
804 % endif
809 % endif
805
810
806 <tr><td style="padding-top: 10px"><code>${_('In commit messages')}:</code></td></tr>
811 <tr><td style="padding-top: 10px"><code>${_('In commit messages')}:</code></td></tr>
807 % if c.referenced_commit_issues:
812 % if c.referenced_commit_issues:
808 % for ticket_dict in sorted(c.referenced_commit_issues):
813 % for ticket_dict in sorted(c.referenced_commit_issues):
809 <tr>
814 <tr>
810 <td>
815 <td>
811 <a href="${ticket_dict.get('url')}">
816 <a href="${ticket_dict.get('url')}">
812 ${ticket_dict.get('id')}
817 ${ticket_dict.get('id')}
813 </a>
818 </a>
814 </td>
819 </td>
815 </tr>
820 </tr>
816 % endfor
821 % endfor
817 % else:
822 % else:
818 <tr>
823 <tr>
819 <td>
824 <td>
820 ${_('No Ticket data found.')}
825 ${_('No Ticket data found.')}
821 </td>
826 </td>
822 </tr>
827 </tr>
823 % endif
828 % endif
824 </table>
829 </table>
825
830
826 </div>
831 </div>
827 </div>
832 </div>
828
833
829 </div>
834 </div>
830
835
831 </div>
836 </div>
832 </aside>
837 </aside>
833
838
834 ## This JS needs to be at the end
839 ## This JS needs to be at the end
835 <script type="text/javascript">
840 <script type="text/javascript">
836
841
837 versionController = new VersionController();
842 versionController = new VersionController();
838 versionController.init();
843 versionController.init();
839
844
840 reviewersController = new ReviewersController();
845 reviewersController = new ReviewersController();
841 commitsController = new CommitsController();
846 commitsController = new CommitsController();
842
847
843 updateController = new UpdatePrController();
848 updateController = new UpdatePrController();
844
849
845 window.reviewerRulesData = ${c.pull_request_default_reviewers_data_json | n};
850 window.reviewerRulesData = ${c.pull_request_default_reviewers_data_json | n};
846 window.setReviewersData = ${c.pull_request_set_reviewers_data_json | n};
851 window.setReviewersData = ${c.pull_request_set_reviewers_data_json | n};
847 window.setObserversData = ${c.pull_request_set_observers_data_json | n};
852 window.setObserversData = ${c.pull_request_set_observers_data_json | n};
848
853
849 (function () {
854 (function () {
850 "use strict";
855 "use strict";
851
856
852 // custom code mirror
857 // custom code mirror
853 var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm;
858 var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm;
854
859
855 PRDetails.init();
860 PRDetails.init();
856 ReviewersPanel.init(reviewersController, reviewerRulesData, setReviewersData);
861 ReviewersPanel.init(reviewersController, reviewerRulesData, setReviewersData);
857 ObserversPanel.init(reviewersController, reviewerRulesData, setObserversData);
862 ObserversPanel.init(reviewersController, reviewerRulesData, setObserversData);
858
863
859 window.showOutdated = function (self) {
864 window.showOutdated = function (self) {
860 $('.comment-inline.comment-outdated').show();
865 $('.comment-inline.comment-outdated').show();
861 $('.filediff-outdated').show();
866 $('.filediff-outdated').show();
862 $('.showOutdatedComments').hide();
867 $('.showOutdatedComments').hide();
863 $('.hideOutdatedComments').show();
868 $('.hideOutdatedComments').show();
864 };
869 };
865
870
866 window.hideOutdated = function (self) {
871 window.hideOutdated = function (self) {
867 $('.comment-inline.comment-outdated').hide();
872 $('.comment-inline.comment-outdated').hide();
868 $('.filediff-outdated').hide();
873 $('.filediff-outdated').hide();
869 $('.hideOutdatedComments').hide();
874 $('.hideOutdatedComments').hide();
870 $('.showOutdatedComments').show();
875 $('.showOutdatedComments').show();
871 };
876 };
872
877
873 window.refreshMergeChecks = function () {
878 window.refreshMergeChecks = function () {
874 var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}";
879 var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}";
875 $('.pull-request-merge').css('opacity', 0.3);
880 $('.pull-request-merge').css('opacity', 0.3);
876 $('.action-buttons-extra').css('opacity', 0.3);
881 $('.action-buttons-extra').css('opacity', 0.3);
877
882
878 $('.pull-request-merge').load(
883 $('.pull-request-merge').load(
879 loadUrl, function () {
884 loadUrl, function () {
880 $('.pull-request-merge').css('opacity', 1);
885 $('.pull-request-merge').css('opacity', 1);
881
886
882 $('.action-buttons-extra').css('opacity', 1);
887 $('.action-buttons-extra').css('opacity', 1);
883 }
888 }
884 );
889 );
885 };
890 };
886
891
887 window.closePullRequest = function (status) {
892 window.closePullRequest = function (status) {
888 if (!confirm(_gettext('Are you sure to close this pull request without merging?'))) {
893 if (!confirm(_gettext('Are you sure to close this pull request without merging?'))) {
889 return false;
894 return false;
890 }
895 }
891 // inject closing flag
896 // inject closing flag
892 $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">');
897 $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">');
893 $(generalCommentForm.statusChange).select2("val", status).trigger('change');
898 $(generalCommentForm.statusChange).select2("val", status).trigger('change');
894 $(generalCommentForm.submitForm).submit();
899 $(generalCommentForm.submitForm).submit();
895 };
900 };
896
901
897 //TODO this functionality is now missing
902 //TODO this functionality is now missing
898 $('#show-outdated-comments').on('click', function (e) {
903 $('#show-outdated-comments').on('click', function (e) {
899 var button = $(this);
904 var button = $(this);
900 var outdated = $('.comment-outdated');
905 var outdated = $('.comment-outdated');
901
906
902 if (button.html() === "(Show)") {
907 if (button.html() === "(Show)") {
903 button.html("(Hide)");
908 button.html("(Hide)");
904 outdated.show();
909 outdated.show();
905 } else {
910 } else {
906 button.html("(Show)");
911 button.html("(Show)");
907 outdated.hide();
912 outdated.hide();
908 }
913 }
909 });
914 });
910
915
911 $('#merge_pull_request_form').submit(function () {
916 $('#merge_pull_request_form').submit(function () {
912 if (!$('#merge_pull_request').attr('disabled')) {
917 if (!$('#merge_pull_request').attr('disabled')) {
913 $('#merge_pull_request').attr('disabled', 'disabled');
918 $('#merge_pull_request').attr('disabled', 'disabled');
914 }
919 }
915 return true;
920 return true;
916 });
921 });
917
922
918 $('#edit_pull_request').on('click', function (e) {
923 $('#edit_pull_request').on('click', function (e) {
919 var title = $('#pr-title-input').val();
924 var title = $('#pr-title-input').val();
920 var description = codeMirrorInstance.getValue();
925 var description = codeMirrorInstance.getValue();
921 var renderer = $('#pr-renderer-input').val();
926 var renderer = $('#pr-renderer-input').val();
922 editPullRequest(
927 editPullRequest(
923 "${c.repo_name}", "${c.pull_request.pull_request_id}",
928 "${c.repo_name}", "${c.pull_request.pull_request_id}",
924 title, description, renderer);
929 title, description, renderer);
925 });
930 });
926
931
927 var $updateButtons = $('#update_reviewers,#update_observers');
932 var $updateButtons = $('#update_reviewers,#update_observers');
928 $updateButtons.on('click', function (e) {
933 $updateButtons.on('click', function (e) {
929 var role = $(this).data('role');
934 var role = $(this).data('role');
930 $updateButtons.attr('disabled', 'disabled');
935 $updateButtons.attr('disabled', 'disabled');
931 $updateButtons.addClass('disabled');
936 $updateButtons.addClass('disabled');
932 $updateButtons.html(_gettext('Saving...'));
937 $updateButtons.html(_gettext('Saving...'));
933 reviewersController.updateReviewers(
938 reviewersController.updateReviewers(
934 templateContext.repo_name,
939 templateContext.repo_name,
935 templateContext.pull_request_data.pull_request_id,
940 templateContext.pull_request_data.pull_request_id,
936 role
941 role
937 );
942 );
938 });
943 });
939
944
940 // fixing issue with caches on firefox
945 // fixing issue with caches on firefox
941 $('#update_commits').removeAttr("disabled");
946 $('#update_commits').removeAttr("disabled");
942
947
943 $('.show-inline-comments').on('click', function (e) {
948 $('.show-inline-comments').on('click', function (e) {
944 var boxid = $(this).attr('data-comment-id');
949 var boxid = $(this).attr('data-comment-id');
945 var button = $(this);
950 var button = $(this);
946
951
947 if (button.hasClass("comments-visible")) {
952 if (button.hasClass("comments-visible")) {
948 $('#{0} .inline-comments'.format(boxid)).each(function (index) {
953 $('#{0} .inline-comments'.format(boxid)).each(function (index) {
949 $(this).hide();
954 $(this).hide();
950 });
955 });
951 button.removeClass("comments-visible");
956 button.removeClass("comments-visible");
952 } else {
957 } else {
953 $('#{0} .inline-comments'.format(boxid)).each(function (index) {
958 $('#{0} .inline-comments'.format(boxid)).each(function (index) {
954 $(this).show();
959 $(this).show();
955 });
960 });
956 button.addClass("comments-visible");
961 button.addClass("comments-visible");
957 }
962 }
958 });
963 });
959
964
960 $('.show-inline-comments').on('change', function (e) {
965 $('.show-inline-comments').on('change', function (e) {
961 var show = 'none';
966 var show = 'none';
962 var target = e.currentTarget;
967 var target = e.currentTarget;
963 if (target.checked) {
968 if (target.checked) {
964 show = ''
969 show = ''
965 }
970 }
966 var boxid = $(target).attr('id_for');
971 var boxid = $(target).attr('id_for');
967 var comments = $('#{0} .inline-comments'.format(boxid));
972 var comments = $('#{0} .inline-comments'.format(boxid));
968 var fn_display = function (idx) {
973 var fn_display = function (idx) {
969 $(this).css('display', show);
974 $(this).css('display', show);
970 };
975 };
971 $(comments).each(fn_display);
976 $(comments).each(fn_display);
972 var btns = $('#{0} .inline-comments-button'.format(boxid));
977 var btns = $('#{0} .inline-comments-button'.format(boxid));
973 $(btns).each(fn_display);
978 $(btns).each(fn_display);
974 });
979 });
975
980
976 // register submit callback on commentForm form to track TODOs
981 // register submit callback on commentForm form to track TODOs
977 window.commentFormGlobalSubmitSuccessCallback = function () {
982 window.commentFormGlobalSubmitSuccessCallback = function () {
978 refreshMergeChecks();
983 refreshMergeChecks();
979 };
984 };
980
985
981 ReviewerAutoComplete('#user', reviewersController);
986 ReviewerAutoComplete('#user', reviewersController);
982 ObserverAutoComplete('#observer', reviewersController);
987 ObserverAutoComplete('#observer', reviewersController);
983
988
984 })();
989 })();
985
990
986 $(document).ready(function () {
991 $(document).ready(function () {
987
992
988 var channel = '${c.pr_broadcast_channel}';
993 var channel = '${c.pr_broadcast_channel}';
989 new ReviewerPresenceController(channel)
994 new ReviewerPresenceController(channel)
990
995
991 })
996 })
992 </script>
997 </script>
993
998
994 </%def>
999 </%def>
General Comments 0
You need to be logged in to leave comments. Login now