Show More
@@ -1,511 +1,511 b'' | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
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 | · ${h.branding(c.rhodecode_name)} |
|
6 | · ${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 | <script type="text/javascript"> |
|
31 | <script type="text/javascript"> | |
32 | // TODO: marcink switch this to pyroutes |
|
32 | // TODO: marcink switch this to pyroutes | |
33 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; |
|
33 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; | |
34 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; |
|
34 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; | |
35 | </script> |
|
35 | </script> | |
36 | <div class="box"> |
|
36 | <div class="box"> | |
37 | <div class="title"> |
|
37 | <div class="title"> | |
38 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
38 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
39 | </div> |
|
39 | </div> | |
40 |
|
40 | |||
41 | ${self.breadcrumbs()} |
|
41 | ${self.breadcrumbs()} | |
42 |
|
42 | |||
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 | ${_('Pull request #%s') % c.pull_request.pull_request_id} ${_('From')} ${h.format_date(c.pull_request.created_on)} |
|
48 | ${_('Pull request #%s') % c.pull_request.pull_request_id} ${_('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 edit')}</div> |
|
61 | <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel edit')}</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 | %if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: |
|
115 | %if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: | |
116 | <div class="field"> |
|
116 | <div class="field"> | |
117 | <div class="label-summary"> |
|
117 | <div class="label-summary"> | |
118 | <label>Merge:</label> |
|
118 | <label>Merge:</label> | |
119 | </div> |
|
119 | </div> | |
120 | <div class="input"> |
|
120 | <div class="input"> | |
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 | </div> |
|
128 | </div> | |
129 | </div> |
|
129 | </div> | |
130 | %endif |
|
130 | %endif | |
131 |
|
131 | |||
132 | <div class="field"> |
|
132 | <div class="field"> | |
133 | <div class="label-summary"> |
|
133 | <div class="label-summary"> | |
134 | <label>${_('Review')}:</label> |
|
134 | <label>${_('Review')}:</label> | |
135 | </div> |
|
135 | </div> | |
136 | <div class="input"> |
|
136 | <div class="input"> | |
137 | %if c.pull_request_review_status: |
|
137 | %if c.pull_request_review_status: | |
138 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> |
|
138 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> | |
139 | <span class="changeset-status-lbl tooltip"> |
|
139 | <span class="changeset-status-lbl tooltip"> | |
140 | %if c.pull_request.is_closed(): |
|
140 | %if c.pull_request.is_closed(): | |
141 | ${_('Closed')}, |
|
141 | ${_('Closed')}, | |
142 | %endif |
|
142 | %endif | |
143 | ${h.commit_status_lbl(c.pull_request_review_status)} |
|
143 | ${h.commit_status_lbl(c.pull_request_review_status)} | |
144 | </span> |
|
144 | </span> | |
145 | - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} |
|
145 | - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} | |
146 | %endif |
|
146 | %endif | |
147 | </div> |
|
147 | </div> | |
148 | </div> |
|
148 | </div> | |
149 | <div class="field"> |
|
149 | <div class="field"> | |
150 | <div class="pr-description-label label-summary"> |
|
150 | <div class="pr-description-label label-summary"> | |
151 | <label>${_('Description')}:</label> |
|
151 | <label>${_('Description')}:</label> | |
152 | </div> |
|
152 | </div> | |
153 | <div id="pr-desc" class="input"> |
|
153 | <div id="pr-desc" class="input"> | |
154 | <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div> |
|
154 | <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div> | |
155 | </div> |
|
155 | </div> | |
156 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> |
|
156 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> | |
157 | <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea> |
|
157 | <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea> | |
158 | </div> |
|
158 | </div> | |
159 | </div> |
|
159 | </div> | |
160 | <div class="field"> |
|
160 | <div class="field"> | |
161 | <div class="label-summary"> |
|
161 | <div class="label-summary"> | |
162 | <label>${_('Comments')}:</label> |
|
162 | <label>${_('Comments')}:</label> | |
163 | </div> |
|
163 | </div> | |
164 | <div class="input"> |
|
164 | <div class="input"> | |
165 | <div> |
|
165 | <div> | |
166 | <div class="comments-number"> |
|
166 | <div class="comments-number"> | |
167 | %if c.comments: |
|
167 | %if c.comments: | |
168 | <a href="#comments">${ungettext("%d Pull request comment", "%d Pull request comments", len(c.comments)) % len(c.comments)}</a>, |
|
168 | <a href="#comments">${ungettext("%d Pull request comment", "%d Pull request comments", len(c.comments)) % len(c.comments)}</a>, | |
169 | %else: |
|
169 | %else: | |
170 | ${ungettext("%d Pull request comment", "%d Pull request comments", len(c.comments)) % len(c.comments)} |
|
170 | ${ungettext("%d Pull request comment", "%d Pull request comments", len(c.comments)) % len(c.comments)} | |
171 | %endif |
|
171 | %endif | |
172 | %if c.inline_cnt: |
|
172 | %if c.inline_cnt: | |
173 | ## this is replaced with a proper link to first comment via JS linkifyComments() func |
|
173 | <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a> | |
174 | <a href="#inline-comments" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a> |
|
|||
175 | %else: |
|
174 | %else: | |
176 | ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt} |
|
175 | ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt} | |
177 | %endif |
|
176 | %endif | |
178 |
|
177 | |||
|
178 | ||||
179 | % if c.outdated_cnt: |
|
179 | % if c.outdated_cnt: | |
180 | ,${ungettext("%d Outdated Comment", "%d Outdated Comments", c.outdated_cnt) % c.outdated_cnt} <span id="show-outdated-comments" class="btn btn-link">${_('(Show)')}</span> |
|
180 | ,${ungettext("%d Outdated Comment", "%d Outdated Comments", c.outdated_cnt) % c.outdated_cnt} <span id="show-outdated-comments" class="btn btn-link">${_('(Show)')}</span> | |
181 | % endif |
|
181 | % endif | |
182 | </div> |
|
182 | </div> | |
183 | </div> |
|
183 | </div> | |
184 | </div> |
|
184 | </div> | |
185 | </div> |
|
185 | </div> | |
186 | <div id="pr-save" class="field" style="display: none;"> |
|
186 | <div id="pr-save" class="field" style="display: none;"> | |
187 | <div class="label-summary"></div> |
|
187 | <div class="label-summary"></div> | |
188 | <div class="input"> |
|
188 | <div class="input"> | |
189 | <span id="edit_pull_request" class="btn btn-small">${_('Save Changes')}</span> |
|
189 | <span id="edit_pull_request" class="btn btn-small">${_('Save Changes')}</span> | |
190 | </div> |
|
190 | </div> | |
191 | </div> |
|
191 | </div> | |
192 | </div> |
|
192 | </div> | |
193 | </div> |
|
193 | </div> | |
194 | <div> |
|
194 | <div> | |
195 | ## AUTHOR |
|
195 | ## AUTHOR | |
196 | <div class="reviewers-title block-right"> |
|
196 | <div class="reviewers-title block-right"> | |
197 | <div class="pr-details-title"> |
|
197 | <div class="pr-details-title"> | |
198 | ${_('Author')} |
|
198 | ${_('Author')} | |
199 | </div> |
|
199 | </div> | |
200 | </div> |
|
200 | </div> | |
201 | <div class="block-right pr-details-content reviewers"> |
|
201 | <div class="block-right pr-details-content reviewers"> | |
202 | <ul class="group_members"> |
|
202 | <ul class="group_members"> | |
203 | <li> |
|
203 | <li> | |
204 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} |
|
204 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} | |
205 | </li> |
|
205 | </li> | |
206 | </ul> |
|
206 | </ul> | |
207 | </div> |
|
207 | </div> | |
208 | ## REVIEWERS |
|
208 | ## REVIEWERS | |
209 | <div class="reviewers-title block-right"> |
|
209 | <div class="reviewers-title block-right"> | |
210 | <div class="pr-details-title"> |
|
210 | <div class="pr-details-title"> | |
211 | ${_('Pull request reviewers')} |
|
211 | ${_('Pull request reviewers')} | |
212 | %if c.allowed_to_update: |
|
212 | %if c.allowed_to_update: | |
213 | <span id="open_edit_reviewers" class="block-right action_button">${_('Edit')}</span> |
|
213 | <span id="open_edit_reviewers" class="block-right action_button">${_('Edit')}</span> | |
214 | <span id="close_edit_reviewers" class="block-right action_button" style="display: none;">${_('Close')}</span> |
|
214 | <span id="close_edit_reviewers" class="block-right action_button" style="display: none;">${_('Close')}</span> | |
215 | %endif |
|
215 | %endif | |
216 | </div> |
|
216 | </div> | |
217 | </div> |
|
217 | </div> | |
218 | <div id="reviewers" class="block-right pr-details-content reviewers"> |
|
218 | <div id="reviewers" class="block-right pr-details-content reviewers"> | |
219 | ## members goes here ! |
|
219 | ## members goes here ! | |
220 | <input type="hidden" name="__start__" value="review_members:sequence"> |
|
220 | <input type="hidden" name="__start__" value="review_members:sequence"> | |
221 | <ul id="review_members" class="group_members"> |
|
221 | <ul id="review_members" class="group_members"> | |
222 | %for member,reasons,status in c.pull_request_reviewers: |
|
222 | %for member,reasons,status in c.pull_request_reviewers: | |
223 | <li id="reviewer_${member.user_id}"> |
|
223 | <li id="reviewer_${member.user_id}"> | |
224 | <div class="reviewers_member"> |
|
224 | <div class="reviewers_member"> | |
225 | <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> |
|
225 | <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> | |
226 | <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div> |
|
226 | <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div> | |
227 | </div> |
|
227 | </div> | |
228 | <div id="reviewer_${member.user_id}_name" class="reviewer_name"> |
|
228 | <div id="reviewer_${member.user_id}_name" class="reviewer_name"> | |
229 | ${self.gravatar_with_user(member.email, 16)} |
|
229 | ${self.gravatar_with_user(member.email, 16)} | |
230 | </div> |
|
230 | </div> | |
231 | <input type="hidden" name="__start__" value="reviewer:mapping"> |
|
231 | <input type="hidden" name="__start__" value="reviewer:mapping"> | |
232 | <input type="hidden" name="__start__" value="reasons:sequence"> |
|
232 | <input type="hidden" name="__start__" value="reasons:sequence"> | |
233 | %for reason in reasons: |
|
233 | %for reason in reasons: | |
234 | <div class="reviewer_reason">- ${reason}</div> |
|
234 | <div class="reviewer_reason">- ${reason}</div> | |
235 | <input type="hidden" name="reason" value="${reason}"> |
|
235 | <input type="hidden" name="reason" value="${reason}"> | |
236 |
|
236 | |||
237 | %endfor |
|
237 | %endfor | |
238 | <input type="hidden" name="__end__" value="reasons:sequence"> |
|
238 | <input type="hidden" name="__end__" value="reasons:sequence"> | |
239 | <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" /> |
|
239 | <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" /> | |
240 | <input type="hidden" name="__end__" value="reviewer:mapping"> |
|
240 | <input type="hidden" name="__end__" value="reviewer:mapping"> | |
241 | %if c.allowed_to_update: |
|
241 | %if c.allowed_to_update: | |
242 | <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id}, true)" style="visibility: hidden;"> |
|
242 | <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id}, true)" style="visibility: hidden;"> | |
243 | <i class="icon-remove-sign" ></i> |
|
243 | <i class="icon-remove-sign" ></i> | |
244 | </div> |
|
244 | </div> | |
245 | %endif |
|
245 | %endif | |
246 | </div> |
|
246 | </div> | |
247 | </li> |
|
247 | </li> | |
248 | %endfor |
|
248 | %endfor | |
249 | </ul> |
|
249 | </ul> | |
250 | <input type="hidden" name="__end__" value="review_members:sequence"> |
|
250 | <input type="hidden" name="__end__" value="review_members:sequence"> | |
251 | %if not c.pull_request.is_closed(): |
|
251 | %if not c.pull_request.is_closed(): | |
252 | <div id="add_reviewer_input" class='ac' style="display: none;"> |
|
252 | <div id="add_reviewer_input" class='ac' style="display: none;"> | |
253 | %if c.allowed_to_update: |
|
253 | %if c.allowed_to_update: | |
254 | <div class="reviewer_ac"> |
|
254 | <div class="reviewer_ac"> | |
255 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer'))} |
|
255 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer'))} | |
256 | <div id="reviewers_container"></div> |
|
256 | <div id="reviewers_container"></div> | |
257 | </div> |
|
257 | </div> | |
258 | <div> |
|
258 | <div> | |
259 | <span id="update_pull_request" class="btn btn-small">${_('Save Changes')}</span> |
|
259 | <span id="update_pull_request" class="btn btn-small">${_('Save Changes')}</span> | |
260 | </div> |
|
260 | </div> | |
261 | %endif |
|
261 | %endif | |
262 | </div> |
|
262 | </div> | |
263 | %endif |
|
263 | %endif | |
264 | </div> |
|
264 | </div> | |
265 | </div> |
|
265 | </div> | |
266 | </div> |
|
266 | </div> | |
267 | <div class="box"> |
|
267 | <div class="box"> | |
268 | ##DIFF |
|
268 | ##DIFF | |
269 | <div class="table" > |
|
269 | <div class="table" > | |
270 | <div id="changeset_compare_view_content"> |
|
270 | <div id="changeset_compare_view_content"> | |
271 | ##CS |
|
271 | ##CS | |
272 | % if c.missing_requirements: |
|
272 | % if c.missing_requirements: | |
273 | <div class="box"> |
|
273 | <div class="box"> | |
274 | <div class="alert alert-warning"> |
|
274 | <div class="alert alert-warning"> | |
275 | <div> |
|
275 | <div> | |
276 | <strong>${_('Missing requirements:')}</strong> |
|
276 | <strong>${_('Missing requirements:')}</strong> | |
277 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} |
|
277 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} | |
278 | </div> |
|
278 | </div> | |
279 | </div> |
|
279 | </div> | |
280 | </div> |
|
280 | </div> | |
281 | % elif c.missing_commits: |
|
281 | % elif c.missing_commits: | |
282 | <div class="box"> |
|
282 | <div class="box"> | |
283 | <div class="alert alert-warning"> |
|
283 | <div class="alert alert-warning"> | |
284 | <div> |
|
284 | <div> | |
285 | <strong>${_('Missing commits')}:</strong> |
|
285 | <strong>${_('Missing commits')}:</strong> | |
286 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} |
|
286 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} | |
287 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} |
|
287 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} | |
288 | </div> |
|
288 | </div> | |
289 | </div> |
|
289 | </div> | |
290 | </div> |
|
290 | </div> | |
291 | % endif |
|
291 | % endif | |
292 | <div class="compare_view_commits_title"> |
|
292 | <div class="compare_view_commits_title"> | |
293 | % if c.allowed_to_update and not c.pull_request.is_closed(): |
|
293 | % if c.allowed_to_update and not c.pull_request.is_closed(): | |
294 | <button id="update_commits" class="btn btn-small">${_('Update commits')}</button> |
|
294 | <button id="update_commits" class="btn btn-small">${_('Update commits')}</button> | |
295 | % endif |
|
295 | % endif | |
296 | % if len(c.commit_ranges): |
|
296 | % if len(c.commit_ranges): | |
297 | <h2>${ungettext('Compare View: %s commit','Compare View: %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}</h2> |
|
297 | <h2>${ungettext('Compare View: %s commit','Compare View: %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}</h2> | |
298 | % endif |
|
298 | % endif | |
299 | </div> |
|
299 | </div> | |
300 | % if not c.missing_commits: |
|
300 | % if not c.missing_commits: | |
301 | <%include file="/compare/compare_commits.html" /> |
|
301 | <%include file="/compare/compare_commits.html" /> | |
302 | <div class="cs_files"> |
|
302 | <div class="cs_files"> | |
303 | <%namespace name="cbdiffs" file="/codeblocks/diffs.html"/> |
|
303 | <%namespace name="cbdiffs" file="/codeblocks/diffs.html"/> | |
304 | ${cbdiffs.render_diffset_menu()} |
|
304 | ${cbdiffs.render_diffset_menu()} | |
305 | ${cbdiffs.render_diffset( |
|
305 | ${cbdiffs.render_diffset( | |
306 | c.diffset, use_comments=True, |
|
306 | c.diffset, use_comments=True, | |
307 | collapse_when_files_over=30, |
|
307 | collapse_when_files_over=30, | |
308 | disable_new_comments=c.pull_request.is_closed())} |
|
308 | disable_new_comments=c.pull_request.is_closed())} | |
309 |
|
309 | |||
310 | </div> |
|
310 | </div> | |
311 | % endif |
|
311 | % endif | |
312 | </div> |
|
312 | </div> | |
313 |
|
313 | |||
314 | ## template for inline comment form |
|
314 | ## template for inline comment form | |
315 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
315 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
316 | ${comment.comment_inline_form()} |
|
316 | ${comment.comment_inline_form()} | |
317 |
|
317 | |||
318 | ## render comments and inlines |
|
318 | ## render comments and inlines | |
319 | ${comment.generate_comments(include_pull_request=True, is_pull_request=True)} |
|
319 | ${comment.generate_comments(include_pull_request=True, is_pull_request=True)} | |
320 |
|
320 | |||
321 | % if not c.pull_request.is_closed(): |
|
321 | % if not c.pull_request.is_closed(): | |
322 | ## main comment form and it status |
|
322 | ## main comment form and it status | |
323 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, |
|
323 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, | |
324 | pull_request_id=c.pull_request.pull_request_id), |
|
324 | pull_request_id=c.pull_request.pull_request_id), | |
325 | c.pull_request_review_status, |
|
325 | c.pull_request_review_status, | |
326 | is_pull_request=True, change_status=c.allowed_to_change_status)} |
|
326 | is_pull_request=True, change_status=c.allowed_to_change_status)} | |
327 | %endif |
|
327 | %endif | |
328 |
|
328 | |||
329 | <script type="text/javascript"> |
|
329 | <script type="text/javascript"> | |
330 | if (location.hash) { |
|
330 | if (location.hash) { | |
331 | var result = splitDelimitedHash(location.hash); |
|
331 | var result = splitDelimitedHash(location.hash); | |
332 | var line = $('html').find(result.loc); |
|
332 | var line = $('html').find(result.loc); | |
333 | if (line.length > 0){ |
|
333 | if (line.length > 0){ | |
334 | offsetScroll(line, 70); |
|
334 | offsetScroll(line, 70); | |
335 | } |
|
335 | } | |
336 | } |
|
336 | } | |
337 | $(function(){ |
|
337 | $(function(){ | |
338 | ReviewerAutoComplete('user'); |
|
338 | ReviewerAutoComplete('user'); | |
339 | // custom code mirror |
|
339 | // custom code mirror | |
340 | var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input'); |
|
340 | var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input'); | |
341 |
|
341 | |||
342 | var PRDetails = { |
|
342 | var PRDetails = { | |
343 | editButton: $('#open_edit_pullrequest'), |
|
343 | editButton: $('#open_edit_pullrequest'), | |
344 | closeButton: $('#close_edit_pullrequest'), |
|
344 | closeButton: $('#close_edit_pullrequest'), | |
345 | deleteButton: $('#delete_pullrequest'), |
|
345 | deleteButton: $('#delete_pullrequest'), | |
346 | viewFields: $('#pr-desc, #pr-title'), |
|
346 | viewFields: $('#pr-desc, #pr-title'), | |
347 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), |
|
347 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), | |
348 |
|
348 | |||
349 | init: function() { |
|
349 | init: function() { | |
350 | var that = this; |
|
350 | var that = this; | |
351 | this.editButton.on('click', function(e) { that.edit(); }); |
|
351 | this.editButton.on('click', function(e) { that.edit(); }); | |
352 | this.closeButton.on('click', function(e) { that.view(); }); |
|
352 | this.closeButton.on('click', function(e) { that.view(); }); | |
353 | }, |
|
353 | }, | |
354 |
|
354 | |||
355 | edit: function(event) { |
|
355 | edit: function(event) { | |
356 | this.viewFields.hide(); |
|
356 | this.viewFields.hide(); | |
357 | this.editButton.hide(); |
|
357 | this.editButton.hide(); | |
358 | this.deleteButton.hide(); |
|
358 | this.deleteButton.hide(); | |
359 | this.closeButton.show(); |
|
359 | this.closeButton.show(); | |
360 | this.editFields.show(); |
|
360 | this.editFields.show(); | |
361 | codeMirrorInstance.refresh(); |
|
361 | codeMirrorInstance.refresh(); | |
362 | }, |
|
362 | }, | |
363 |
|
363 | |||
364 | view: function(event) { |
|
364 | view: function(event) { | |
365 | this.editButton.show(); |
|
365 | this.editButton.show(); | |
366 | this.deleteButton.show(); |
|
366 | this.deleteButton.show(); | |
367 | this.editFields.hide(); |
|
367 | this.editFields.hide(); | |
368 | this.closeButton.hide(); |
|
368 | this.closeButton.hide(); | |
369 | this.viewFields.show(); |
|
369 | this.viewFields.show(); | |
370 | } |
|
370 | } | |
371 | }; |
|
371 | }; | |
372 |
|
372 | |||
373 | var ReviewersPanel = { |
|
373 | var ReviewersPanel = { | |
374 | editButton: $('#open_edit_reviewers'), |
|
374 | editButton: $('#open_edit_reviewers'), | |
375 | closeButton: $('#close_edit_reviewers'), |
|
375 | closeButton: $('#close_edit_reviewers'), | |
376 | addButton: $('#add_reviewer_input'), |
|
376 | addButton: $('#add_reviewer_input'), | |
377 | removeButtons: $('.reviewer_member_remove'), |
|
377 | removeButtons: $('.reviewer_member_remove'), | |
378 |
|
378 | |||
379 | init: function() { |
|
379 | init: function() { | |
380 | var that = this; |
|
380 | var that = this; | |
381 | this.editButton.on('click', function(e) { that.edit(); }); |
|
381 | this.editButton.on('click', function(e) { that.edit(); }); | |
382 | this.closeButton.on('click', function(e) { that.close(); }); |
|
382 | this.closeButton.on('click', function(e) { that.close(); }); | |
383 | }, |
|
383 | }, | |
384 |
|
384 | |||
385 | edit: function(event) { |
|
385 | edit: function(event) { | |
386 | this.editButton.hide(); |
|
386 | this.editButton.hide(); | |
387 | this.closeButton.show(); |
|
387 | this.closeButton.show(); | |
388 | this.addButton.show(); |
|
388 | this.addButton.show(); | |
389 | this.removeButtons.css('visibility', 'visible'); |
|
389 | this.removeButtons.css('visibility', 'visible'); | |
390 | }, |
|
390 | }, | |
391 |
|
391 | |||
392 | close: function(event) { |
|
392 | close: function(event) { | |
393 | this.editButton.show(); |
|
393 | this.editButton.show(); | |
394 | this.closeButton.hide(); |
|
394 | this.closeButton.hide(); | |
395 | this.addButton.hide(); |
|
395 | this.addButton.hide(); | |
396 | this.removeButtons.css('visibility', 'hidden'); |
|
396 | this.removeButtons.css('visibility', 'hidden'); | |
397 | }, |
|
397 | }, | |
398 | }; |
|
398 | }; | |
399 |
|
399 | |||
400 | PRDetails.init(); |
|
400 | PRDetails.init(); | |
401 | ReviewersPanel.init(); |
|
401 | ReviewersPanel.init(); | |
402 |
|
402 | |||
403 | $('#show-outdated-comments').on('click', function(e){ |
|
403 | $('#show-outdated-comments').on('click', function(e){ | |
404 | var button = $(this); |
|
404 | var button = $(this); | |
405 | var outdated = $('.outdated'); |
|
405 | var outdated = $('.outdated'); | |
406 | if (button.html() === "(Show)") { |
|
406 | if (button.html() === "(Show)") { | |
407 | button.html("(Hide)"); |
|
407 | button.html("(Hide)"); | |
408 | outdated.show(); |
|
408 | outdated.show(); | |
409 | } else { |
|
409 | } else { | |
410 | button.html("(Show)"); |
|
410 | button.html("(Show)"); | |
411 | outdated.hide(); |
|
411 | outdated.hide(); | |
412 | } |
|
412 | } | |
413 | }); |
|
413 | }); | |
414 |
|
414 | |||
415 | $('.show-inline-comments').on('change', function(e){ |
|
415 | $('.show-inline-comments').on('change', function(e){ | |
416 | var show = 'none'; |
|
416 | var show = 'none'; | |
417 | var target = e.currentTarget; |
|
417 | var target = e.currentTarget; | |
418 | if(target.checked){ |
|
418 | if(target.checked){ | |
419 | show = '' |
|
419 | show = '' | |
420 | } |
|
420 | } | |
421 | var boxid = $(target).attr('id_for'); |
|
421 | var boxid = $(target).attr('id_for'); | |
422 | var comments = $('#{0} .inline-comments'.format(boxid)); |
|
422 | var comments = $('#{0} .inline-comments'.format(boxid)); | |
423 | var fn_display = function(idx){ |
|
423 | var fn_display = function(idx){ | |
424 | $(this).css('display', show); |
|
424 | $(this).css('display', show); | |
425 | }; |
|
425 | }; | |
426 | $(comments).each(fn_display); |
|
426 | $(comments).each(fn_display); | |
427 | var btns = $('#{0} .inline-comments-button'.format(boxid)); |
|
427 | var btns = $('#{0} .inline-comments-button'.format(boxid)); | |
428 | $(btns).each(fn_display); |
|
428 | $(btns).each(fn_display); | |
429 | }); |
|
429 | }); | |
430 |
|
430 | |||
431 | // inject comments into their proper positions |
|
431 | // inject comments into their proper positions | |
432 | var file_comments = $('.inline-comment-placeholder'); |
|
432 | var file_comments = $('.inline-comment-placeholder'); | |
433 | %if c.pull_request.is_closed(): |
|
433 | %if c.pull_request.is_closed(): | |
434 | renderInlineComments(file_comments, false); |
|
434 | renderInlineComments(file_comments, false); | |
435 | %else: |
|
435 | %else: | |
436 | renderInlineComments(file_comments, true); |
|
436 | renderInlineComments(file_comments, true); | |
437 | %endif |
|
437 | %endif | |
438 | var commentTotals = {}; |
|
438 | var commentTotals = {}; | |
439 | $.each(file_comments, function(i, comment) { |
|
439 | $.each(file_comments, function(i, comment) { | |
440 | var path = $(comment).attr('path'); |
|
440 | var path = $(comment).attr('path'); | |
441 | var comms = $(comment).children().length; |
|
441 | var comms = $(comment).children().length; | |
442 | if (path in commentTotals) { |
|
442 | if (path in commentTotals) { | |
443 | commentTotals[path] += comms; |
|
443 | commentTotals[path] += comms; | |
444 | } else { |
|
444 | } else { | |
445 | commentTotals[path] = comms; |
|
445 | commentTotals[path] = comms; | |
446 | } |
|
446 | } | |
447 | }); |
|
447 | }); | |
448 | $.each(commentTotals, function(path, total) { |
|
448 | $.each(commentTotals, function(path, total) { | |
449 | var elem = $('.comment-bubble[data-path="'+ path +'"]'); |
|
449 | var elem = $('.comment-bubble[data-path="'+ path +'"]'); | |
450 | elem.css('visibility', 'visible'); |
|
450 | elem.css('visibility', 'visible'); | |
451 | elem.html(elem.html() + ' ' + total ); |
|
451 | elem.html(elem.html() + ' ' + total ); | |
452 | }); |
|
452 | }); | |
453 |
|
453 | |||
454 | $('#merge_pull_request_form').submit(function() { |
|
454 | $('#merge_pull_request_form').submit(function() { | |
455 | if (!$('#merge_pull_request').attr('disabled')) { |
|
455 | if (!$('#merge_pull_request').attr('disabled')) { | |
456 | $('#merge_pull_request').attr('disabled', 'disabled'); |
|
456 | $('#merge_pull_request').attr('disabled', 'disabled'); | |
457 | } |
|
457 | } | |
458 | return true; |
|
458 | return true; | |
459 | }); |
|
459 | }); | |
460 |
|
460 | |||
461 | $('#edit_pull_request').on('click', function(e){ |
|
461 | $('#edit_pull_request').on('click', function(e){ | |
462 | var title = $('#pr-title-input').val(); |
|
462 | var title = $('#pr-title-input').val(); | |
463 | var description = codeMirrorInstance.getValue(); |
|
463 | var description = codeMirrorInstance.getValue(); | |
464 | editPullRequest( |
|
464 | editPullRequest( | |
465 | "${c.repo_name}", "${c.pull_request.pull_request_id}", |
|
465 | "${c.repo_name}", "${c.pull_request.pull_request_id}", | |
466 | title, description); |
|
466 | title, description); | |
467 | }); |
|
467 | }); | |
468 |
|
468 | |||
469 | $('#update_pull_request').on('click', function(e){ |
|
469 | $('#update_pull_request').on('click', function(e){ | |
470 | updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
470 | updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
471 | }); |
|
471 | }); | |
472 |
|
472 | |||
473 | $('#update_commits').on('click', function(e){ |
|
473 | $('#update_commits').on('click', function(e){ | |
474 | var isDisabled = !$(e.currentTarget).attr('disabled'); |
|
474 | var isDisabled = !$(e.currentTarget).attr('disabled'); | |
475 | $(e.currentTarget).text(_gettext('Updating...')); |
|
475 | $(e.currentTarget).text(_gettext('Updating...')); | |
476 | $(e.currentTarget).attr('disabled', 'disabled'); |
|
476 | $(e.currentTarget).attr('disabled', 'disabled'); | |
477 | if(isDisabled){ |
|
477 | if(isDisabled){ | |
478 | updateCommits("${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
478 | updateCommits("${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
479 | } |
|
479 | } | |
480 |
|
480 | |||
481 | }); |
|
481 | }); | |
482 | // fixing issue with caches on firefox |
|
482 | // fixing issue with caches on firefox | |
483 | $('#update_commits').removeAttr("disabled"); |
|
483 | $('#update_commits').removeAttr("disabled"); | |
484 |
|
484 | |||
485 | $('#close_pull_request').on('click', function(e){ |
|
485 | $('#close_pull_request').on('click', function(e){ | |
486 | closePullRequest("${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
486 | closePullRequest("${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
487 | }); |
|
487 | }); | |
488 |
|
488 | |||
489 | $('.show-inline-comments').on('click', function(e){ |
|
489 | $('.show-inline-comments').on('click', function(e){ | |
490 | var boxid = $(this).attr('data-comment-id'); |
|
490 | var boxid = $(this).attr('data-comment-id'); | |
491 | var button = $(this); |
|
491 | var button = $(this); | |
492 |
|
492 | |||
493 | if(button.hasClass("comments-visible")) { |
|
493 | if(button.hasClass("comments-visible")) { | |
494 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
494 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
495 | $(this).hide(); |
|
495 | $(this).hide(); | |
496 | }); |
|
496 | }); | |
497 | button.removeClass("comments-visible"); |
|
497 | button.removeClass("comments-visible"); | |
498 | } else { |
|
498 | } else { | |
499 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
499 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
500 | $(this).show(); |
|
500 | $(this).show(); | |
501 | }); |
|
501 | }); | |
502 | button.addClass("comments-visible"); |
|
502 | button.addClass("comments-visible"); | |
503 | } |
|
503 | } | |
504 | }); |
|
504 | }); | |
505 | }) |
|
505 | }) | |
506 | </script> |
|
506 | </script> | |
507 |
|
507 | |||
508 | </div> |
|
508 | </div> | |
509 | </div> |
|
509 | </div> | |
510 |
|
510 | |||
511 | </%def> |
|
511 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now