##// END OF EJS Templates
pull-requests: fixed small UI issues in case of missing commits inside a Pull request.
marcink -
r1287:27ca0c8b default
parent child Browse files
Show More
@@ -1,643 +1,647 b''
1 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)}
4 ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)}
5 %if c.rhodecode_name:
5 %if c.rhodecode_name:
6 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
7 %endif
7 %endif
8 </%def>
8 </%def>
9
9
10 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
11 <span id="pr-title">
11 <span id="pr-title">
12 ${c.pull_request.title}
12 ${c.pull_request.title}
13 %if c.pull_request.is_closed():
13 %if c.pull_request.is_closed():
14 (${_('Closed')})
14 (${_('Closed')})
15 %endif
15 %endif
16 </span>
16 </span>
17 <div id="pr-title-edit" class="input" style="display: none;">
17 <div id="pr-title-edit" class="input" style="display: none;">
18 ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)}
18 ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)}
19 </div>
19 </div>
20 </%def>
20 </%def>
21
21
22 <%def name="menu_bar_nav()">
22 <%def name="menu_bar_nav()">
23 ${self.menu_items(active='repositories')}
23 ${self.menu_items(active='repositories')}
24 </%def>
24 </%def>
25
25
26 <%def name="menu_bar_subnav()">
26 <%def name="menu_bar_subnav()">
27 ${self.repo_menu(active='showpullrequest')}
27 ${self.repo_menu(active='showpullrequest')}
28 </%def>
28 </%def>
29
29
30 <%def name="main()">
30 <%def name="main()">
31
31
32 <script type="text/javascript">
32 <script type="text/javascript">
33 // TODO: marcink switch this to pyroutes
33 // TODO: marcink switch this to pyroutes
34 AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
34 AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
35 templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id};
35 templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id};
36 </script>
36 </script>
37 <div class="box">
37 <div class="box">
38 <div class="title">
38 <div class="title">
39 ${self.repo_page_title(c.rhodecode_db_repo)}
39 ${self.repo_page_title(c.rhodecode_db_repo)}
40 </div>
40 </div>
41
41
42 ${self.breadcrumbs()}
42 ${self.breadcrumbs()}
43
43
44 <div class="box pr-summary">
44 <div class="box pr-summary">
45 <div class="summary-details block-left">
45 <div class="summary-details block-left">
46 <% summary = lambda n:{False:'summary-short'}.get(n) %>
46 <% summary = lambda n:{False:'summary-short'}.get(n) %>
47 <div class="pr-details-title">
47 <div class="pr-details-title">
48 <a href="${h.url('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)}
48 <a href="${h.url('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)}
49 %if c.allowed_to_update:
49 %if c.allowed_to_update:
50 <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0">
50 <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0">
51 % if c.allowed_to_delete:
51 % if c.allowed_to_delete:
52 ${h.secure_form(url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')}
52 ${h.secure_form(url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')}
53 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
53 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
54 class_="btn btn-link btn-danger",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
54 class_="btn btn-link btn-danger",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
55 ${h.end_form()}
55 ${h.end_form()}
56 % else:
56 % else:
57 ${_('Delete')}
57 ${_('Delete')}
58 % endif
58 % endif
59 </div>
59 </div>
60 <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
60 <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
61 <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div>
61 <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div>
62 %endif
62 %endif
63 </div>
63 </div>
64
64
65 <div id="summary" class="fields pr-details-content">
65 <div id="summary" class="fields pr-details-content">
66 <div class="field">
66 <div class="field">
67 <div class="label-summary">
67 <div class="label-summary">
68 <label>${_('Origin')}:</label>
68 <label>${_('Origin')}:</label>
69 </div>
69 </div>
70 <div class="input">
70 <div class="input">
71 <div class="pr-origininfo">
71 <div class="pr-origininfo">
72 ## branch link is only valid if it is a branch
72 ## branch link is only valid if it is a branch
73 <span class="tag">
73 <span class="tag">
74 %if c.pull_request.source_ref_parts.type == 'branch':
74 %if c.pull_request.source_ref_parts.type == 'branch':
75 <a href="${h.url('changelog_home', repo_name=c.pull_request.source_repo.repo_name, branch=c.pull_request.source_ref_parts.name)}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a>
75 <a href="${h.url('changelog_home', repo_name=c.pull_request.source_repo.repo_name, branch=c.pull_request.source_ref_parts.name)}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a>
76 %else:
76 %else:
77 ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}
77 ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}
78 %endif
78 %endif
79 </span>
79 </span>
80 <span class="clone-url">
80 <span class="clone-url">
81 <a href="${h.url('summary_home', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a>
81 <a href="${h.url('summary_home', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a>
82 </span>
82 </span>
83 </div>
83 </div>
84 <div class="pr-pullinfo">
84 <div class="pr-pullinfo">
85 %if h.is_hg(c.pull_request.source_repo):
85 %if h.is_hg(c.pull_request.source_repo):
86 <input type="text" value="hg pull -r ${h.short_id(c.source_ref)} ${c.pull_request.source_repo.clone_url()}" readonly="readonly">
86 <input type="text" value="hg pull -r ${h.short_id(c.source_ref)} ${c.pull_request.source_repo.clone_url()}" readonly="readonly">
87 %elif h.is_git(c.pull_request.source_repo):
87 %elif h.is_git(c.pull_request.source_repo):
88 <input type="text" value="git pull ${c.pull_request.source_repo.clone_url()} ${c.pull_request.source_ref_parts.name}" readonly="readonly">
88 <input type="text" value="git pull ${c.pull_request.source_repo.clone_url()} ${c.pull_request.source_ref_parts.name}" readonly="readonly">
89 %endif
89 %endif
90 </div>
90 </div>
91 </div>
91 </div>
92 </div>
92 </div>
93 <div class="field">
93 <div class="field">
94 <div class="label-summary">
94 <div class="label-summary">
95 <label>${_('Target')}:</label>
95 <label>${_('Target')}:</label>
96 </div>
96 </div>
97 <div class="input">
97 <div class="input">
98 <div class="pr-targetinfo">
98 <div class="pr-targetinfo">
99 ## branch link is only valid if it is a branch
99 ## branch link is only valid if it is a branch
100 <span class="tag">
100 <span class="tag">
101 %if c.pull_request.target_ref_parts.type == 'branch':
101 %if c.pull_request.target_ref_parts.type == 'branch':
102 <a href="${h.url('changelog_home', repo_name=c.pull_request.target_repo.repo_name, branch=c.pull_request.target_ref_parts.name)}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a>
102 <a href="${h.url('changelog_home', repo_name=c.pull_request.target_repo.repo_name, branch=c.pull_request.target_ref_parts.name)}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a>
103 %else:
103 %else:
104 ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}
104 ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}
105 %endif
105 %endif
106 </span>
106 </span>
107 <span class="clone-url">
107 <span class="clone-url">
108 <a href="${h.url('summary_home', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a>
108 <a href="${h.url('summary_home', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a>
109 </span>
109 </span>
110 </div>
110 </div>
111 </div>
111 </div>
112 </div>
112 </div>
113
113
114 ## Link to the shadow repository.
114 ## Link to the shadow repository.
115 <div class="field">
115 <div class="field">
116 <div class="label-summary">
116 <div class="label-summary">
117 <label>${_('Merge')}:</label>
117 <label>${_('Merge')}:</label>
118 </div>
118 </div>
119 <div class="input">
119 <div class="input">
120 % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
120 % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
121 <div class="pr-mergeinfo">
121 <div class="pr-mergeinfo">
122 %if h.is_hg(c.pull_request.target_repo):
122 %if h.is_hg(c.pull_request.target_repo):
123 <input type="text" value="hg clone -u ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
123 <input type="text" value="hg clone -u ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
124 %elif h.is_git(c.pull_request.target_repo):
124 %elif h.is_git(c.pull_request.target_repo):
125 <input type="text" value="git clone --branch ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
125 <input type="text" value="git clone --branch ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
126 %endif
126 %endif
127 </div>
127 </div>
128 % else:
128 % else:
129 <div class="">
129 <div class="">
130 ${_('Shadow repository data not available')}.
130 ${_('Shadow repository data not available')}.
131 </div>
131 </div>
132 % endif
132 % endif
133 </div>
133 </div>
134 </div>
134 </div>
135
135
136 <div class="field">
136 <div class="field">
137 <div class="label-summary">
137 <div class="label-summary">
138 <label>${_('Review')}:</label>
138 <label>${_('Review')}:</label>
139 </div>
139 </div>
140 <div class="input">
140 <div class="input">
141 %if c.pull_request_review_status:
141 %if c.pull_request_review_status:
142 <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div>
142 <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div>
143 <span class="changeset-status-lbl tooltip">
143 <span class="changeset-status-lbl tooltip">
144 %if c.pull_request.is_closed():
144 %if c.pull_request.is_closed():
145 ${_('Closed')},
145 ${_('Closed')},
146 %endif
146 %endif
147 ${h.commit_status_lbl(c.pull_request_review_status)}
147 ${h.commit_status_lbl(c.pull_request_review_status)}
148 </span>
148 </span>
149 - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)}
149 - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)}
150 %endif
150 %endif
151 </div>
151 </div>
152 </div>
152 </div>
153 <div class="field">
153 <div class="field">
154 <div class="pr-description-label label-summary">
154 <div class="pr-description-label label-summary">
155 <label>${_('Description')}:</label>
155 <label>${_('Description')}:</label>
156 </div>
156 </div>
157 <div id="pr-desc" class="input">
157 <div id="pr-desc" class="input">
158 <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div>
158 <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div>
159 </div>
159 </div>
160 <div id="pr-desc-edit" class="input textarea editor" style="display: none;">
160 <div id="pr-desc-edit" class="input textarea editor" style="display: none;">
161 <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea>
161 <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea>
162 </div>
162 </div>
163 </div>
163 </div>
164
164
165 <div class="field">
165 <div class="field">
166 <div class="label-summary">
166 <div class="label-summary">
167 <label>${_('Versions')} (${len(c.versions)+1}):</label>
167 <label>${_('Versions')} (${len(c.versions)+1}):</label>
168 </div>
168 </div>
169
169
170 <div class="pr-versions">
170 <div class="pr-versions">
171 % if c.show_version_changes:
171 % if c.show_version_changes:
172 <table>
172 <table>
173 ## CURRENTLY SELECT PR VERSION
173 ## CURRENTLY SELECT PR VERSION
174 <tr class="version-pr" style="display: ${'' if c.at_version_num is None else 'none'}">
174 <tr class="version-pr" style="display: ${'' if c.at_version_num is None else 'none'}">
175 <td>
175 <td>
176 % if c.at_version in [None, 'latest']:
176 % if c.at_version in [None, 'latest']:
177 <i class="icon-ok link"></i>
177 <i class="icon-ok link"></i>
178 % else:
178 % else:
179 <i class="icon-comment"></i> <code>${len(c.inline_versions[None])}</code>
179 <i class="icon-comment"></i> <code>${len(c.inline_versions[None])}</code>
180 % endif
180 % endif
181 </td>
181 </td>
182 <td>
182 <td>
183 <code>
183 <code>
184 % if c.versions:
184 % if c.versions:
185 <a href="${h.url.current(version='latest')}">${_('latest')}</a>
185 <a href="${h.url.current(version='latest')}">${_('latest')}</a>
186 % else:
186 % else:
187 ${_('initial')}
187 ${_('initial')}
188 % endif
188 % endif
189 </code>
189 </code>
190 </td>
190 </td>
191 <td>
191 <td>
192 <code>${c.pull_request_latest.source_ref_parts.commit_id[:6]}</code>
192 <code>${c.pull_request_latest.source_ref_parts.commit_id[:6]}</code>
193 </td>
193 </td>
194 <td>
194 <td>
195 ${_('created')} ${h.age_component(c.pull_request_latest.updated_on)}
195 ${_('created')} ${h.age_component(c.pull_request_latest.updated_on)}
196 </td>
196 </td>
197 <td align="right">
197 <td align="right">
198 % if c.versions and c.at_version_num in [None, 'latest']:
198 % if c.versions and c.at_version_num in [None, 'latest']:
199 <span id="show-pr-versions" class="btn btn-link" onclick="$('.version-pr').show(); $(this).hide(); return false">${_('Show all versions')}</span>
199 <span id="show-pr-versions" class="btn btn-link" onclick="$('.version-pr').show(); $(this).hide(); return false">${_('Show all versions')}</span>
200 % endif
200 % endif
201 </td>
201 </td>
202 </tr>
202 </tr>
203
203
204 ## SHOW ALL VERSIONS OF PR
204 ## SHOW ALL VERSIONS OF PR
205 <% ver_pr = None %>
205 <% ver_pr = None %>
206 % for data in reversed(list(enumerate(c.versions, 1))):
206 % for data in reversed(list(enumerate(c.versions, 1))):
207 <% ver_pos = data[0] %>
207 <% ver_pos = data[0] %>
208 <% ver = data[1] %>
208 <% ver = data[1] %>
209 <% ver_pr = ver.pull_request_version_id %>
209 <% ver_pr = ver.pull_request_version_id %>
210
210
211 <tr class="version-pr" style="display: ${'' if c.at_version == ver_pr else 'none'}">
211 <tr class="version-pr" style="display: ${'' if c.at_version == ver_pr else 'none'}">
212 <td>
212 <td>
213 % if c.at_version == ver_pr:
213 % if c.at_version == ver_pr:
214 <i class="icon-ok link"></i>
214 <i class="icon-ok link"></i>
215 % else:
215 % else:
216 <i class="icon-comment"></i> <code>${len(c.inline_versions[ver_pr])}</code>
216 <i class="icon-comment"></i> <code>${len(c.inline_versions[ver_pr])}</code>
217 % endif
217 % endif
218 </td>
218 </td>
219 <td>
219 <td>
220 <code class="tooltip" title="${_('Comment from pull request version {0}').format(ver_pos)}">
220 <code class="tooltip" title="${_('Comment from pull request version {0}').format(ver_pos)}">
221 <a href="${h.url.current(version=ver_pr)}">v${ver_pos}</a>
221 <a href="${h.url.current(version=ver_pr)}">v${ver_pos}</a>
222 </code>
222 </code>
223 </td>
223 </td>
224 <td>
224 <td>
225 <code>${ver.source_ref_parts.commit_id[:6]}</code>
225 <code>${ver.source_ref_parts.commit_id[:6]}</code>
226 </td>
226 </td>
227 <td>
227 <td>
228 ${_('created')} ${h.age_component(ver.updated_on)}
228 ${_('created')} ${h.age_component(ver.updated_on)}
229 </td>
229 </td>
230 <td align="right">
230 <td align="right">
231 % if c.at_version == ver_pr:
231 % if c.at_version == ver_pr:
232 <span id="show-pr-versions" class="btn btn-link" onclick="$('.version-pr').show(); $(this).hide(); return false">${_('Show all versions')}</span>
232 <span id="show-pr-versions" class="btn btn-link" onclick="$('.version-pr').show(); $(this).hide(); return false">${_('Show all versions')}</span>
233 % endif
233 % endif
234 </td>
234 </td>
235 </tr>
235 </tr>
236 % endfor
236 % endfor
237
237
238 ## show comment/inline comments summary
238 ## show comment/inline comments summary
239 <tr>
239 <tr>
240 <td>
240 <td>
241 </td>
241 </td>
242
242
243 <% inline_comm_count_ver = len(c.inline_versions[ver_pr])%>
243 <% inline_comm_count_ver = len(c.inline_versions[ver_pr])%>
244 <td colspan="4" style="border-top: 1px dashed #dbd9da">
244 <td colspan="4" style="border-top: 1px dashed #dbd9da">
245 ${_('Comments for this version')}:
245 ${_('Comments for this version')}:
246 %if c.comments:
246 %if c.comments:
247 <a href="#comments">${_("%d General ") % len(c.comments)}</a>
247 <a href="#comments">${_("%d General ") % len(c.comments)}</a>
248 %else:
248 %else:
249 ${_("%d General ") % len(c.comments)}
249 ${_("%d General ") % len(c.comments)}
250 %endif
250 %endif
251
251
252 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num])%>
252 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num])%>
253 %if inline_comm_count_ver:
253 %if inline_comm_count_ver:
254 , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a>
254 , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a>
255 %else:
255 %else:
256 , ${_("%d Inline") % inline_comm_count_ver}
256 , ${_("%d Inline") % inline_comm_count_ver}
257 %endif
257 %endif
258
258
259 %if c.outdated_cnt:
259 %if c.outdated_cnt:
260 , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % c.outdated_cnt}</a>
260 , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % c.outdated_cnt}</a>
261 <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a>
261 <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a>
262 <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a>
262 <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a>
263 %else:
263 %else:
264 , ${_("%d Outdated") % c.outdated_cnt}
264 , ${_("%d Outdated") % c.outdated_cnt}
265 %endif
265 %endif
266 </td>
266 </td>
267 </tr>
267 </tr>
268
268
269 <tr>
269 <tr>
270 <td></td>
270 <td></td>
271 <td colspan="4">
271 <td colspan="4">
272 % if c.at_version:
272 % if c.at_version:
273 <pre>
273 <pre>
274 Changed commits:
274 Changed commits:
275 * added: ${len(c.changes.added)}
275 * added: ${len(c.changes.added)}
276 * removed: ${len(c.changes.removed)}
276 * removed: ${len(c.changes.removed)}
277
277
278 % if not (c.file_changes.added+c.file_changes.modified+c.file_changes.removed):
278 % if not (c.file_changes.added+c.file_changes.modified+c.file_changes.removed):
279 No file changes found
279 No file changes found
280 % else:
280 % else:
281 Changed files:
281 Changed files:
282 %for file_name in c.file_changes.added:
282 %for file_name in c.file_changes.added:
283 * A <a href="#${'a_' + h.FID('', file_name)}">${file_name}</a>
283 * A <a href="#${'a_' + h.FID('', file_name)}">${file_name}</a>
284 %endfor
284 %endfor
285 %for file_name in c.file_changes.modified:
285 %for file_name in c.file_changes.modified:
286 * M <a href="#${'a_' + h.FID('', file_name)}">${file_name}</a>
286 * M <a href="#${'a_' + h.FID('', file_name)}">${file_name}</a>
287 %endfor
287 %endfor
288 %for file_name in c.file_changes.removed:
288 %for file_name in c.file_changes.removed:
289 * R ${file_name}
289 * R ${file_name}
290 %endfor
290 %endfor
291 % endif
291 % endif
292 </pre>
292 </pre>
293 % endif
293 % endif
294 </td>
294 </td>
295 </tr>
295 </tr>
296 </table>
296 </table>
297 % else:
297 % else:
298 ${_('Pull request versions not available')}.
298 ${_('Pull request versions not available')}.
299 % endif
299 % endif
300 </div>
300 </div>
301 </div>
301 </div>
302
302
303 <div id="pr-save" class="field" style="display: none;">
303 <div id="pr-save" class="field" style="display: none;">
304 <div class="label-summary"></div>
304 <div class="label-summary"></div>
305 <div class="input">
305 <div class="input">
306 <span id="edit_pull_request" class="btn btn-small">${_('Save Changes')}</span>
306 <span id="edit_pull_request" class="btn btn-small">${_('Save Changes')}</span>
307 </div>
307 </div>
308 </div>
308 </div>
309 </div>
309 </div>
310 </div>
310 </div>
311 <div>
311 <div>
312 ## AUTHOR
312 ## AUTHOR
313 <div class="reviewers-title block-right">
313 <div class="reviewers-title block-right">
314 <div class="pr-details-title">
314 <div class="pr-details-title">
315 ${_('Author')}
315 ${_('Author')}
316 </div>
316 </div>
317 </div>
317 </div>
318 <div class="block-right pr-details-content reviewers">
318 <div class="block-right pr-details-content reviewers">
319 <ul class="group_members">
319 <ul class="group_members">
320 <li>
320 <li>
321 ${self.gravatar_with_user(c.pull_request.author.email, 16)}
321 ${self.gravatar_with_user(c.pull_request.author.email, 16)}
322 </li>
322 </li>
323 </ul>
323 </ul>
324 </div>
324 </div>
325 ## REVIEWERS
325 ## REVIEWERS
326 <div class="reviewers-title block-right">
326 <div class="reviewers-title block-right">
327 <div class="pr-details-title">
327 <div class="pr-details-title">
328 ${_('Pull request reviewers')}
328 ${_('Pull request reviewers')}
329 %if c.allowed_to_update:
329 %if c.allowed_to_update:
330 <span id="open_edit_reviewers" class="block-right action_button">${_('Edit')}</span>
330 <span id="open_edit_reviewers" class="block-right action_button">${_('Edit')}</span>
331 <span id="close_edit_reviewers" class="block-right action_button" style="display: none;">${_('Close')}</span>
331 <span id="close_edit_reviewers" class="block-right action_button" style="display: none;">${_('Close')}</span>
332 %endif
332 %endif
333 </div>
333 </div>
334 </div>
334 </div>
335 <div id="reviewers" class="block-right pr-details-content reviewers">
335 <div id="reviewers" class="block-right pr-details-content reviewers">
336 ## members goes here !
336 ## members goes here !
337 <input type="hidden" name="__start__" value="review_members:sequence">
337 <input type="hidden" name="__start__" value="review_members:sequence">
338 <ul id="review_members" class="group_members">
338 <ul id="review_members" class="group_members">
339 %for member,reasons,status in c.pull_request_reviewers:
339 %for member,reasons,status in c.pull_request_reviewers:
340 <li id="reviewer_${member.user_id}">
340 <li id="reviewer_${member.user_id}">
341 <div class="reviewers_member">
341 <div class="reviewers_member">
342 <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}">
342 <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}">
343 <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div>
343 <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div>
344 </div>
344 </div>
345 <div id="reviewer_${member.user_id}_name" class="reviewer_name">
345 <div id="reviewer_${member.user_id}_name" class="reviewer_name">
346 ${self.gravatar_with_user(member.email, 16)}
346 ${self.gravatar_with_user(member.email, 16)}
347 </div>
347 </div>
348 <input type="hidden" name="__start__" value="reviewer:mapping">
348 <input type="hidden" name="__start__" value="reviewer:mapping">
349 <input type="hidden" name="__start__" value="reasons:sequence">
349 <input type="hidden" name="__start__" value="reasons:sequence">
350 %for reason in reasons:
350 %for reason in reasons:
351 <div class="reviewer_reason">- ${reason}</div>
351 <div class="reviewer_reason">- ${reason}</div>
352 <input type="hidden" name="reason" value="${reason}">
352 <input type="hidden" name="reason" value="${reason}">
353
353
354 %endfor
354 %endfor
355 <input type="hidden" name="__end__" value="reasons:sequence">
355 <input type="hidden" name="__end__" value="reasons:sequence">
356 <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" />
356 <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" />
357 <input type="hidden" name="__end__" value="reviewer:mapping">
357 <input type="hidden" name="__end__" value="reviewer:mapping">
358 %if c.allowed_to_update:
358 %if c.allowed_to_update:
359 <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id}, true)" style="visibility: hidden;">
359 <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id}, true)" style="visibility: hidden;">
360 <i class="icon-remove-sign" ></i>
360 <i class="icon-remove-sign" ></i>
361 </div>
361 </div>
362 %endif
362 %endif
363 </div>
363 </div>
364 </li>
364 </li>
365 %endfor
365 %endfor
366 </ul>
366 </ul>
367 <input type="hidden" name="__end__" value="review_members:sequence">
367 <input type="hidden" name="__end__" value="review_members:sequence">
368 %if not c.pull_request.is_closed():
368 %if not c.pull_request.is_closed():
369 <div id="add_reviewer_input" class='ac' style="display: none;">
369 <div id="add_reviewer_input" class='ac' style="display: none;">
370 %if c.allowed_to_update:
370 %if c.allowed_to_update:
371 <div class="reviewer_ac">
371 <div class="reviewer_ac">
372 ${h.text('user', class_='ac-input', placeholder=_('Add reviewer'))}
372 ${h.text('user', class_='ac-input', placeholder=_('Add reviewer'))}
373 <div id="reviewers_container"></div>
373 <div id="reviewers_container"></div>
374 </div>
374 </div>
375 <div>
375 <div>
376 <span id="update_pull_request" class="btn btn-small">${_('Save Changes')}</span>
376 <span id="update_pull_request" class="btn btn-small">${_('Save Changes')}</span>
377 </div>
377 </div>
378 %endif
378 %endif
379 </div>
379 </div>
380 %endif
380 %endif
381 </div>
381 </div>
382 </div>
382 </div>
383 </div>
383 </div>
384 <div class="box">
384 <div class="box">
385 ##DIFF
385 ##DIFF
386 <div class="table" >
386 <div class="table" >
387 <div id="changeset_compare_view_content">
387 <div id="changeset_compare_view_content">
388 ##CS
388 ##CS
389 % if c.missing_requirements:
389 % if c.missing_requirements:
390 <div class="box">
390 <div class="box">
391 <div class="alert alert-warning">
391 <div class="alert alert-warning">
392 <div>
392 <div>
393 <strong>${_('Missing requirements:')}</strong>
393 <strong>${_('Missing requirements:')}</strong>
394 ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
394 ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
395 </div>
395 </div>
396 </div>
396 </div>
397 </div>
397 </div>
398 % elif c.missing_commits:
398 % elif c.missing_commits:
399 <div class="box">
399 <div class="box">
400 <div class="alert alert-warning">
400 <div class="alert alert-warning">
401 <div>
401 <div>
402 <strong>${_('Missing commits')}:</strong>
402 <strong>${_('Missing commits')}:</strong>
403 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}
403 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}
404 ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}
404 ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}
405 </div>
405 </div>
406 </div>
406 </div>
407 </div>
407 </div>
408 % endif
408 % endif
409 <div class="compare_view_commits_title">
409 <div class="compare_view_commits_title">
410
410
411 <div class="pull-left">
411 <div class="pull-left">
412 <div class="btn-group">
412 <div class="btn-group">
413 <a
413 <a
414 class="btn"
414 class="btn"
415 href="#"
415 href="#"
416 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
416 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
417 ${ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
417 ${ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
418 </a>
418 </a>
419 <a
419 <a
420 class="btn"
420 class="btn"
421 href="#"
421 href="#"
422 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
422 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
423 ${ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
423 ${ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
424 </a>
424 </a>
425 </div>
425 </div>
426 </div>
426 </div>
427
427
428 <div class="pull-right">
428 <div class="pull-right">
429 % if c.allowed_to_update and not c.pull_request.is_closed():
429 % if c.allowed_to_update and not c.pull_request.is_closed():
430 <a id="update_commits" class="btn btn-primary pull-right">${_('Update commits')}</a>
430 <a id="update_commits" class="btn btn-primary pull-right">${_('Update commits')}</a>
431 % else:
431 % else:
432 <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a>
432 <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a>
433 % endif
433 % endif
434
434
435 </div>
435 </div>
436
436
437 </div>
437 </div>
438
438 % if not c.missing_commits:
439 % if not c.missing_commits:
439 <%include file="/compare/compare_commits.mako" />
440 <%include file="/compare/compare_commits.mako" />
440 <div class="cs_files">
441 <div class="cs_files">
441 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
442 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
442 ${cbdiffs.render_diffset_menu()}
443 ${cbdiffs.render_diffset_menu()}
443 ${cbdiffs.render_diffset(
444 ${cbdiffs.render_diffset(
444 c.diffset, use_comments=True,
445 c.diffset, use_comments=True,
445 collapse_when_files_over=30,
446 collapse_when_files_over=30,
446 disable_new_comments=not c.allowed_to_comment,
447 disable_new_comments=not c.allowed_to_comment,
447 deleted_files_comments=c.deleted_files_comments)}
448 deleted_files_comments=c.deleted_files_comments)}
449 </div>
450 % else:
451 ## skipping commits we need to clear the view for missing commits
452 <div style="clear:both;"></div>
453 % endif
448
454
449 </div>
450 % endif
451 </div>
455 </div>
452 </div>
456 </div>
453
457
454 ## template for inline comment form
458 ## template for inline comment form
455 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
459 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
456
460
457 ## render general comments
461 ## render general comments
458 ${comment.generate_comments(include_pull_request=True, is_pull_request=True)}
462 ${comment.generate_comments(include_pull_request=True, is_pull_request=True)}
459
463
460 % if not c.pull_request.is_closed():
464 % if not c.pull_request.is_closed():
461 ## main comment form and it status
465 ## main comment form and it status
462 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name,
466 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name,
463 pull_request_id=c.pull_request.pull_request_id),
467 pull_request_id=c.pull_request.pull_request_id),
464 c.pull_request_review_status,
468 c.pull_request_review_status,
465 is_pull_request=True, change_status=c.allowed_to_change_status)}
469 is_pull_request=True, change_status=c.allowed_to_change_status)}
466 %endif
470 %endif
467
471
468 <script type="text/javascript">
472 <script type="text/javascript">
469 if (location.hash) {
473 if (location.hash) {
470 var result = splitDelimitedHash(location.hash);
474 var result = splitDelimitedHash(location.hash);
471 var line = $('html').find(result.loc);
475 var line = $('html').find(result.loc);
472 if (line.length > 0){
476 if (line.length > 0){
473 offsetScroll(line, 70);
477 offsetScroll(line, 70);
474 }
478 }
475 }
479 }
476 $(function(){
480 $(function(){
477 ReviewerAutoComplete('user');
481 ReviewerAutoComplete('user');
478 // custom code mirror
482 // custom code mirror
479 var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input');
483 var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input');
480
484
481 var PRDetails = {
485 var PRDetails = {
482 editButton: $('#open_edit_pullrequest'),
486 editButton: $('#open_edit_pullrequest'),
483 closeButton: $('#close_edit_pullrequest'),
487 closeButton: $('#close_edit_pullrequest'),
484 deleteButton: $('#delete_pullrequest'),
488 deleteButton: $('#delete_pullrequest'),
485 viewFields: $('#pr-desc, #pr-title'),
489 viewFields: $('#pr-desc, #pr-title'),
486 editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'),
490 editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'),
487
491
488 init: function() {
492 init: function() {
489 var that = this;
493 var that = this;
490 this.editButton.on('click', function(e) { that.edit(); });
494 this.editButton.on('click', function(e) { that.edit(); });
491 this.closeButton.on('click', function(e) { that.view(); });
495 this.closeButton.on('click', function(e) { that.view(); });
492 },
496 },
493
497
494 edit: function(event) {
498 edit: function(event) {
495 this.viewFields.hide();
499 this.viewFields.hide();
496 this.editButton.hide();
500 this.editButton.hide();
497 this.deleteButton.hide();
501 this.deleteButton.hide();
498 this.closeButton.show();
502 this.closeButton.show();
499 this.editFields.show();
503 this.editFields.show();
500 codeMirrorInstance.refresh();
504 codeMirrorInstance.refresh();
501 },
505 },
502
506
503 view: function(event) {
507 view: function(event) {
504 this.editButton.show();
508 this.editButton.show();
505 this.deleteButton.show();
509 this.deleteButton.show();
506 this.editFields.hide();
510 this.editFields.hide();
507 this.closeButton.hide();
511 this.closeButton.hide();
508 this.viewFields.show();
512 this.viewFields.show();
509 }
513 }
510 };
514 };
511
515
512 var ReviewersPanel = {
516 var ReviewersPanel = {
513 editButton: $('#open_edit_reviewers'),
517 editButton: $('#open_edit_reviewers'),
514 closeButton: $('#close_edit_reviewers'),
518 closeButton: $('#close_edit_reviewers'),
515 addButton: $('#add_reviewer_input'),
519 addButton: $('#add_reviewer_input'),
516 removeButtons: $('.reviewer_member_remove'),
520 removeButtons: $('.reviewer_member_remove'),
517
521
518 init: function() {
522 init: function() {
519 var that = this;
523 var that = this;
520 this.editButton.on('click', function(e) { that.edit(); });
524 this.editButton.on('click', function(e) { that.edit(); });
521 this.closeButton.on('click', function(e) { that.close(); });
525 this.closeButton.on('click', function(e) { that.close(); });
522 },
526 },
523
527
524 edit: function(event) {
528 edit: function(event) {
525 this.editButton.hide();
529 this.editButton.hide();
526 this.closeButton.show();
530 this.closeButton.show();
527 this.addButton.show();
531 this.addButton.show();
528 this.removeButtons.css('visibility', 'visible');
532 this.removeButtons.css('visibility', 'visible');
529 },
533 },
530
534
531 close: function(event) {
535 close: function(event) {
532 this.editButton.show();
536 this.editButton.show();
533 this.closeButton.hide();
537 this.closeButton.hide();
534 this.addButton.hide();
538 this.addButton.hide();
535 this.removeButtons.css('visibility', 'hidden');
539 this.removeButtons.css('visibility', 'hidden');
536 }
540 }
537 };
541 };
538
542
539 PRDetails.init();
543 PRDetails.init();
540 ReviewersPanel.init();
544 ReviewersPanel.init();
541
545
542 showOutdated = function(self){
546 showOutdated = function(self){
543 $('.comment-outdated').show();
547 $('.comment-outdated').show();
544 $('.filediff-outdated').show();
548 $('.filediff-outdated').show();
545 $('.showOutdatedComments').hide();
549 $('.showOutdatedComments').hide();
546 $('.hideOutdatedComments').show();
550 $('.hideOutdatedComments').show();
547
551
548 };
552 };
549
553
550 hideOutdated = function(self){
554 hideOutdated = function(self){
551 $('.comment-outdated').hide();
555 $('.comment-outdated').hide();
552 $('.filediff-outdated').hide();
556 $('.filediff-outdated').hide();
553 $('.hideOutdatedComments').hide();
557 $('.hideOutdatedComments').hide();
554 $('.showOutdatedComments').show();
558 $('.showOutdatedComments').show();
555 };
559 };
556
560
557 $('#show-outdated-comments').on('click', function(e){
561 $('#show-outdated-comments').on('click', function(e){
558 var button = $(this);
562 var button = $(this);
559 var outdated = $('.comment-outdated');
563 var outdated = $('.comment-outdated');
560
564
561 if (button.html() === "(Show)") {
565 if (button.html() === "(Show)") {
562 button.html("(Hide)");
566 button.html("(Hide)");
563 outdated.show();
567 outdated.show();
564 } else {
568 } else {
565 button.html("(Show)");
569 button.html("(Show)");
566 outdated.hide();
570 outdated.hide();
567 }
571 }
568 });
572 });
569
573
570 $('.show-inline-comments').on('change', function(e){
574 $('.show-inline-comments').on('change', function(e){
571 var show = 'none';
575 var show = 'none';
572 var target = e.currentTarget;
576 var target = e.currentTarget;
573 if(target.checked){
577 if(target.checked){
574 show = ''
578 show = ''
575 }
579 }
576 var boxid = $(target).attr('id_for');
580 var boxid = $(target).attr('id_for');
577 var comments = $('#{0} .inline-comments'.format(boxid));
581 var comments = $('#{0} .inline-comments'.format(boxid));
578 var fn_display = function(idx){
582 var fn_display = function(idx){
579 $(this).css('display', show);
583 $(this).css('display', show);
580 };
584 };
581 $(comments).each(fn_display);
585 $(comments).each(fn_display);
582 var btns = $('#{0} .inline-comments-button'.format(boxid));
586 var btns = $('#{0} .inline-comments-button'.format(boxid));
583 $(btns).each(fn_display);
587 $(btns).each(fn_display);
584 });
588 });
585
589
586 $('#merge_pull_request_form').submit(function() {
590 $('#merge_pull_request_form').submit(function() {
587 if (!$('#merge_pull_request').attr('disabled')) {
591 if (!$('#merge_pull_request').attr('disabled')) {
588 $('#merge_pull_request').attr('disabled', 'disabled');
592 $('#merge_pull_request').attr('disabled', 'disabled');
589 }
593 }
590 return true;
594 return true;
591 });
595 });
592
596
593 $('#edit_pull_request').on('click', function(e){
597 $('#edit_pull_request').on('click', function(e){
594 var title = $('#pr-title-input').val();
598 var title = $('#pr-title-input').val();
595 var description = codeMirrorInstance.getValue();
599 var description = codeMirrorInstance.getValue();
596 editPullRequest(
600 editPullRequest(
597 "${c.repo_name}", "${c.pull_request.pull_request_id}",
601 "${c.repo_name}", "${c.pull_request.pull_request_id}",
598 title, description);
602 title, description);
599 });
603 });
600
604
601 $('#update_pull_request').on('click', function(e){
605 $('#update_pull_request').on('click', function(e){
602 updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
606 updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
603 });
607 });
604
608
605 $('#update_commits').on('click', function(e){
609 $('#update_commits').on('click', function(e){
606 var isDisabled = !$(e.currentTarget).attr('disabled');
610 var isDisabled = !$(e.currentTarget).attr('disabled');
607 $(e.currentTarget).text(_gettext('Updating...'));
611 $(e.currentTarget).text(_gettext('Updating...'));
608 $(e.currentTarget).attr('disabled', 'disabled');
612 $(e.currentTarget).attr('disabled', 'disabled');
609 if(isDisabled){
613 if(isDisabled){
610 updateCommits("${c.repo_name}", "${c.pull_request.pull_request_id}");
614 updateCommits("${c.repo_name}", "${c.pull_request.pull_request_id}");
611 }
615 }
612
616
613 });
617 });
614 // fixing issue with caches on firefox
618 // fixing issue with caches on firefox
615 $('#update_commits').removeAttr("disabled");
619 $('#update_commits').removeAttr("disabled");
616
620
617 $('#close_pull_request').on('click', function(e){
621 $('#close_pull_request').on('click', function(e){
618 closePullRequest("${c.repo_name}", "${c.pull_request.pull_request_id}");
622 closePullRequest("${c.repo_name}", "${c.pull_request.pull_request_id}");
619 });
623 });
620
624
621 $('.show-inline-comments').on('click', function(e){
625 $('.show-inline-comments').on('click', function(e){
622 var boxid = $(this).attr('data-comment-id');
626 var boxid = $(this).attr('data-comment-id');
623 var button = $(this);
627 var button = $(this);
624
628
625 if(button.hasClass("comments-visible")) {
629 if(button.hasClass("comments-visible")) {
626 $('#{0} .inline-comments'.format(boxid)).each(function(index){
630 $('#{0} .inline-comments'.format(boxid)).each(function(index){
627 $(this).hide();
631 $(this).hide();
628 });
632 });
629 button.removeClass("comments-visible");
633 button.removeClass("comments-visible");
630 } else {
634 } else {
631 $('#{0} .inline-comments'.format(boxid)).each(function(index){
635 $('#{0} .inline-comments'.format(boxid)).each(function(index){
632 $(this).show();
636 $(this).show();
633 });
637 });
634 button.addClass("comments-visible");
638 button.addClass("comments-visible");
635 }
639 }
636 });
640 });
637 })
641 })
638 </script>
642 </script>
639
643
640 </div>
644 </div>
641 </div>
645 </div>
642
646
643 </%def>
647 </%def>
General Comments 0
You need to be logged in to leave comments. Login now