Show More
@@ -1,621 +1,621 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 | <span id="open_edit_pullrequest" class="block-right action_button">${_('Edit')}</span> |
|
50 | <span id="open_edit_pullrequest" class="block-right action_button">${_('Edit')}</span> | |
51 | <span id="close_edit_pullrequest" class="block-right action_button" style="display: none;">${_('Close')}</span> |
|
51 | <span id="close_edit_pullrequest" class="block-right action_button" style="display: none;">${_('Close')}</span> | |
52 | %endif |
|
52 | %endif | |
53 | </div> |
|
53 | </div> | |
54 |
|
54 | |||
55 | <div id="summary" class="fields pr-details-content"> |
|
55 | <div id="summary" class="fields pr-details-content"> | |
56 | <div class="field"> |
|
56 | <div class="field"> | |
57 | <div class="label-summary"> |
|
57 | <div class="label-summary"> | |
58 | <label>${_('Origin')}:</label> |
|
58 | <label>${_('Origin')}:</label> | |
59 | </div> |
|
59 | </div> | |
60 | <div class="input"> |
|
60 | <div class="input"> | |
61 | <div class="pr-origininfo"> |
|
61 | <div class="pr-origininfo"> | |
62 | ## branch link is only valid if it is a branch |
|
62 | ## branch link is only valid if it is a branch | |
63 | <span class="tag"> |
|
63 | <span class="tag"> | |
64 | %if c.pull_request.source_ref_parts.type == 'branch': |
|
64 | %if c.pull_request.source_ref_parts.type == 'branch': | |
65 | <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> |
|
65 | <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> | |
66 | %else: |
|
66 | %else: | |
67 | ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} |
|
67 | ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} | |
68 | %endif |
|
68 | %endif | |
69 | </span> |
|
69 | </span> | |
70 | <span class="clone-url"> |
|
70 | <span class="clone-url"> | |
71 | <a href="${h.url('summary_home', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> |
|
71 | <a href="${h.url('summary_home', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> | |
72 | </span> |
|
72 | </span> | |
73 | </div> |
|
73 | </div> | |
74 | <div class="pr-pullinfo"> |
|
74 | <div class="pr-pullinfo"> | |
75 | %if h.is_hg(c.pull_request.source_repo): |
|
75 | %if h.is_hg(c.pull_request.source_repo): | |
76 | <input type="text" value="hg pull -r ${h.short_id(c.source_ref)} ${c.pull_request.source_repo.clone_url()}" readonly="readonly"> |
|
76 | <input type="text" value="hg pull -r ${h.short_id(c.source_ref)} ${c.pull_request.source_repo.clone_url()}" readonly="readonly"> | |
77 | %elif h.is_git(c.pull_request.source_repo): |
|
77 | %elif h.is_git(c.pull_request.source_repo): | |
78 | <input type="text" value="git pull ${c.pull_request.source_repo.clone_url()} ${c.pull_request.source_ref_parts.name}" readonly="readonly"> |
|
78 | <input type="text" value="git pull ${c.pull_request.source_repo.clone_url()} ${c.pull_request.source_ref_parts.name}" readonly="readonly"> | |
79 | %endif |
|
79 | %endif | |
80 | </div> |
|
80 | </div> | |
81 | </div> |
|
81 | </div> | |
82 | </div> |
|
82 | </div> | |
83 | <div class="field"> |
|
83 | <div class="field"> | |
84 | <div class="label-summary"> |
|
84 | <div class="label-summary"> | |
85 | <label>${_('Target')}:</label> |
|
85 | <label>${_('Target')}:</label> | |
86 | </div> |
|
86 | </div> | |
87 | <div class="input"> |
|
87 | <div class="input"> | |
88 | <div class="pr-targetinfo"> |
|
88 | <div class="pr-targetinfo"> | |
89 | ## branch link is only valid if it is a branch |
|
89 | ## branch link is only valid if it is a branch | |
90 | <span class="tag"> |
|
90 | <span class="tag"> | |
91 | %if c.pull_request.target_ref_parts.type == 'branch': |
|
91 | %if c.pull_request.target_ref_parts.type == 'branch': | |
92 | <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> |
|
92 | <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> | |
93 | %else: |
|
93 | %else: | |
94 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} |
|
94 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} | |
95 | %endif |
|
95 | %endif | |
96 | </span> |
|
96 | </span> | |
97 | <span class="clone-url"> |
|
97 | <span class="clone-url"> | |
98 | <a href="${h.url('summary_home', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> |
|
98 | <a href="${h.url('summary_home', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> | |
99 | </span> |
|
99 | </span> | |
100 | </div> |
|
100 | </div> | |
101 | </div> |
|
101 | </div> | |
102 | </div> |
|
102 | </div> | |
103 |
|
103 | |||
104 | ## Clone link of the shadow repository. |
|
104 | ## Clone link of the shadow repository. | |
105 | %if not c.pull_request.is_closed(): |
|
105 | %if not c.pull_request.is_closed(): | |
106 | <div class="field"> |
|
106 | <div class="field"> | |
107 | <div class="label-summary"> |
|
107 | <div class="label-summary"> | |
108 | <label>${_('Shadow')}:</label> |
|
108 | <label>${_('Shadow')}:</label> | |
109 | </div> |
|
109 | </div> | |
110 | <div class="input"> |
|
110 | <div class="input"> | |
111 | <div class="pr-shadowinfo"> |
|
111 | <div class="pr-shadowinfo"> | |
112 | %if h.is_hg(c.pull_request.target_repo): |
|
112 | %if h.is_hg(c.pull_request.target_repo): | |
113 | <input type="text" value="hg clone ${c.shadow_clone_url}" readonly="readonly"> |
|
113 | <input type="text" value="hg clone ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly"> | |
114 | %elif h.is_git(c.pull_request.target_repo): |
|
114 | %elif h.is_git(c.pull_request.target_repo): | |
115 | <input type="text" value="git clone ${c.shadow_clone_url}" readonly="readonly"> |
|
115 | <input type="text" value="git clone ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly"> | |
116 | %endif |
|
116 | %endif | |
117 | </div> |
|
117 | </div> | |
118 | </div> |
|
118 | </div> | |
119 | </div> |
|
119 | </div> | |
120 | %endif |
|
120 | %endif | |
121 |
|
121 | |||
122 | <div class="field"> |
|
122 | <div class="field"> | |
123 | <div class="label-summary"> |
|
123 | <div class="label-summary"> | |
124 | <label>${_('Review')}:</label> |
|
124 | <label>${_('Review')}:</label> | |
125 | </div> |
|
125 | </div> | |
126 | <div class="input"> |
|
126 | <div class="input"> | |
127 | %if c.pull_request_review_status: |
|
127 | %if c.pull_request_review_status: | |
128 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> |
|
128 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> | |
129 | <span class="changeset-status-lbl tooltip"> |
|
129 | <span class="changeset-status-lbl tooltip"> | |
130 | %if c.pull_request.is_closed(): |
|
130 | %if c.pull_request.is_closed(): | |
131 | ${_('Closed')}, |
|
131 | ${_('Closed')}, | |
132 | %endif |
|
132 | %endif | |
133 | ${h.commit_status_lbl(c.pull_request_review_status)} |
|
133 | ${h.commit_status_lbl(c.pull_request_review_status)} | |
134 | </span> |
|
134 | </span> | |
135 | - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} |
|
135 | - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} | |
136 | %endif |
|
136 | %endif | |
137 | </div> |
|
137 | </div> | |
138 | </div> |
|
138 | </div> | |
139 | <div class="field"> |
|
139 | <div class="field"> | |
140 | <div class="pr-description-label label-summary"> |
|
140 | <div class="pr-description-label label-summary"> | |
141 | <label>${_('Description')}:</label> |
|
141 | <label>${_('Description')}:</label> | |
142 | </div> |
|
142 | </div> | |
143 | <div id="pr-desc" class="input"> |
|
143 | <div id="pr-desc" class="input"> | |
144 | <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div> |
|
144 | <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div> | |
145 | </div> |
|
145 | </div> | |
146 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> |
|
146 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> | |
147 | <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea> |
|
147 | <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea> | |
148 | </div> |
|
148 | </div> | |
149 | </div> |
|
149 | </div> | |
150 | <div class="field"> |
|
150 | <div class="field"> | |
151 | <div class="label-summary"> |
|
151 | <div class="label-summary"> | |
152 | <label>${_('Comments')}:</label> |
|
152 | <label>${_('Comments')}:</label> | |
153 | </div> |
|
153 | </div> | |
154 | <div class="input"> |
|
154 | <div class="input"> | |
155 | <div> |
|
155 | <div> | |
156 | <div class="comments-number"> |
|
156 | <div class="comments-number"> | |
157 | %if c.comments: |
|
157 | %if c.comments: | |
158 | <a href="#comments">${ungettext("%d Pull request comment", "%d Pull request comments", len(c.comments)) % len(c.comments)}</a>, |
|
158 | <a href="#comments">${ungettext("%d Pull request comment", "%d Pull request comments", len(c.comments)) % len(c.comments)}</a>, | |
159 | %else: |
|
159 | %else: | |
160 | ${ungettext("%d Pull request comment", "%d Pull request comments", len(c.comments)) % len(c.comments)} |
|
160 | ${ungettext("%d Pull request comment", "%d Pull request comments", len(c.comments)) % len(c.comments)} | |
161 | %endif |
|
161 | %endif | |
162 | %if c.inline_cnt: |
|
162 | %if c.inline_cnt: | |
163 | ## this is replaced with a proper link to first comment via JS linkifyComments() func |
|
163 | ## this is replaced with a proper link to first comment via JS linkifyComments() func | |
164 | <a href="#inline-comments" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a> |
|
164 | <a href="#inline-comments" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a> | |
165 | %else: |
|
165 | %else: | |
166 | ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt} |
|
166 | ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt} | |
167 | %endif |
|
167 | %endif | |
168 |
|
168 | |||
169 | % if c.outdated_cnt: |
|
169 | % if c.outdated_cnt: | |
170 | ,${ungettext("%d Outdated Comment", "%d Outdated Comments", c.outdated_cnt) % c.outdated_cnt} <span id="show-outdated-comments" class="btn btn-link">${_('(Show)')}</span> |
|
170 | ,${ungettext("%d Outdated Comment", "%d Outdated Comments", c.outdated_cnt) % c.outdated_cnt} <span id="show-outdated-comments" class="btn btn-link">${_('(Show)')}</span> | |
171 | % endif |
|
171 | % endif | |
172 | </div> |
|
172 | </div> | |
173 | </div> |
|
173 | </div> | |
174 | </div> |
|
174 | </div> | |
175 | </div> |
|
175 | </div> | |
176 | <div id="pr-save" class="field" style="display: none;"> |
|
176 | <div id="pr-save" class="field" style="display: none;"> | |
177 | <div class="label-summary"></div> |
|
177 | <div class="label-summary"></div> | |
178 | <div class="input"> |
|
178 | <div class="input"> | |
179 | <span id="edit_pull_request" class="btn btn-small">${_('Save Changes')}</span> |
|
179 | <span id="edit_pull_request" class="btn btn-small">${_('Save Changes')}</span> | |
180 | </div> |
|
180 | </div> | |
181 | </div> |
|
181 | </div> | |
182 | </div> |
|
182 | </div> | |
183 | </div> |
|
183 | </div> | |
184 | <div> |
|
184 | <div> | |
185 | ## AUTHOR |
|
185 | ## AUTHOR | |
186 | <div class="reviewers-title block-right"> |
|
186 | <div class="reviewers-title block-right"> | |
187 | <div class="pr-details-title"> |
|
187 | <div class="pr-details-title"> | |
188 | ${_('Author')} |
|
188 | ${_('Author')} | |
189 | </div> |
|
189 | </div> | |
190 | </div> |
|
190 | </div> | |
191 | <div class="block-right pr-details-content reviewers"> |
|
191 | <div class="block-right pr-details-content reviewers"> | |
192 | <ul class="group_members"> |
|
192 | <ul class="group_members"> | |
193 | <li> |
|
193 | <li> | |
194 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} |
|
194 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} | |
195 | </li> |
|
195 | </li> | |
196 | </ul> |
|
196 | </ul> | |
197 | </div> |
|
197 | </div> | |
198 | ## REVIEWERS |
|
198 | ## REVIEWERS | |
199 | <div class="reviewers-title block-right"> |
|
199 | <div class="reviewers-title block-right"> | |
200 | <div class="pr-details-title"> |
|
200 | <div class="pr-details-title"> | |
201 | ${_('Pull request reviewers')} |
|
201 | ${_('Pull request reviewers')} | |
202 | %if c.allowed_to_update: |
|
202 | %if c.allowed_to_update: | |
203 | <span id="open_edit_reviewers" class="block-right action_button">${_('Edit')}</span> |
|
203 | <span id="open_edit_reviewers" class="block-right action_button">${_('Edit')}</span> | |
204 | <span id="close_edit_reviewers" class="block-right action_button" style="display: none;">${_('Close')}</span> |
|
204 | <span id="close_edit_reviewers" class="block-right action_button" style="display: none;">${_('Close')}</span> | |
205 | %endif |
|
205 | %endif | |
206 | </div> |
|
206 | </div> | |
207 | </div> |
|
207 | </div> | |
208 | <div id="reviewers" class="block-right pr-details-content reviewers"> |
|
208 | <div id="reviewers" class="block-right pr-details-content reviewers"> | |
209 | ## members goes here ! |
|
209 | ## members goes here ! | |
210 | <input type="hidden" name="__start__" value="review_members:sequence"> |
|
210 | <input type="hidden" name="__start__" value="review_members:sequence"> | |
211 | <ul id="review_members" class="group_members"> |
|
211 | <ul id="review_members" class="group_members"> | |
212 | %for member,reasons,status in c.pull_request_reviewers: |
|
212 | %for member,reasons,status in c.pull_request_reviewers: | |
213 | <li id="reviewer_${member.user_id}"> |
|
213 | <li id="reviewer_${member.user_id}"> | |
214 | <div class="reviewers_member"> |
|
214 | <div class="reviewers_member"> | |
215 | <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> |
|
215 | <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> | |
216 | <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div> |
|
216 | <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div> | |
217 | </div> |
|
217 | </div> | |
218 | <div id="reviewer_${member.user_id}_name" class="reviewer_name"> |
|
218 | <div id="reviewer_${member.user_id}_name" class="reviewer_name"> | |
219 | ${self.gravatar_with_user(member.email, 16)} |
|
219 | ${self.gravatar_with_user(member.email, 16)} | |
220 | </div> |
|
220 | </div> | |
221 | <input type="hidden" name="__start__" value="reviewer:mapping"> |
|
221 | <input type="hidden" name="__start__" value="reviewer:mapping"> | |
222 | <input type="hidden" name="__start__" value="reasons:sequence"> |
|
222 | <input type="hidden" name="__start__" value="reasons:sequence"> | |
223 | %for reason in reasons: |
|
223 | %for reason in reasons: | |
224 | <div class="reviewer_reason">- ${reason}</div> |
|
224 | <div class="reviewer_reason">- ${reason}</div> | |
225 | <input type="hidden" name="reason" value="${reason}"> |
|
225 | <input type="hidden" name="reason" value="${reason}"> | |
226 |
|
226 | |||
227 | %endfor |
|
227 | %endfor | |
228 | <input type="hidden" name="__end__" value="reasons:sequence"> |
|
228 | <input type="hidden" name="__end__" value="reasons:sequence"> | |
229 | <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" /> |
|
229 | <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" /> | |
230 | <input type="hidden" name="__end__" value="reviewer:mapping"> |
|
230 | <input type="hidden" name="__end__" value="reviewer:mapping"> | |
231 | %if c.allowed_to_update: |
|
231 | %if c.allowed_to_update: | |
232 | <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id}, true)" style="visibility: hidden;"> |
|
232 | <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id}, true)" style="visibility: hidden;"> | |
233 | <i class="icon-remove-sign" ></i> |
|
233 | <i class="icon-remove-sign" ></i> | |
234 | </div> |
|
234 | </div> | |
235 | %endif |
|
235 | %endif | |
236 | </div> |
|
236 | </div> | |
237 | </li> |
|
237 | </li> | |
238 | %endfor |
|
238 | %endfor | |
239 | </ul> |
|
239 | </ul> | |
240 | <input type="hidden" name="__end__" value="review_members:sequence"> |
|
240 | <input type="hidden" name="__end__" value="review_members:sequence"> | |
241 | %if not c.pull_request.is_closed(): |
|
241 | %if not c.pull_request.is_closed(): | |
242 | <div id="add_reviewer_input" class='ac' style="display: none;"> |
|
242 | <div id="add_reviewer_input" class='ac' style="display: none;"> | |
243 | %if c.allowed_to_update: |
|
243 | %if c.allowed_to_update: | |
244 | <div class="reviewer_ac"> |
|
244 | <div class="reviewer_ac"> | |
245 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer'))} |
|
245 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer'))} | |
246 | <div id="reviewers_container"></div> |
|
246 | <div id="reviewers_container"></div> | |
247 | </div> |
|
247 | </div> | |
248 | <div> |
|
248 | <div> | |
249 | <span id="update_pull_request" class="btn btn-small">${_('Save Changes')}</span> |
|
249 | <span id="update_pull_request" class="btn btn-small">${_('Save Changes')}</span> | |
250 | </div> |
|
250 | </div> | |
251 | %endif |
|
251 | %endif | |
252 | </div> |
|
252 | </div> | |
253 | %endif |
|
253 | %endif | |
254 | </div> |
|
254 | </div> | |
255 | </div> |
|
255 | </div> | |
256 | </div> |
|
256 | </div> | |
257 | <div class="box"> |
|
257 | <div class="box"> | |
258 | ##DIFF |
|
258 | ##DIFF | |
259 | <div class="table" > |
|
259 | <div class="table" > | |
260 | <div id="changeset_compare_view_content"> |
|
260 | <div id="changeset_compare_view_content"> | |
261 | ##CS |
|
261 | ##CS | |
262 | % if c.missing_requirements: |
|
262 | % if c.missing_requirements: | |
263 | <div class="box"> |
|
263 | <div class="box"> | |
264 | <div class="alert alert-warning"> |
|
264 | <div class="alert alert-warning"> | |
265 | <div> |
|
265 | <div> | |
266 | <strong>${_('Missing requirements:')}</strong> |
|
266 | <strong>${_('Missing requirements:')}</strong> | |
267 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} |
|
267 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} | |
268 | </div> |
|
268 | </div> | |
269 | </div> |
|
269 | </div> | |
270 | </div> |
|
270 | </div> | |
271 | % elif c.missing_commits: |
|
271 | % elif c.missing_commits: | |
272 | <div class="box"> |
|
272 | <div class="box"> | |
273 | <div class="alert alert-warning"> |
|
273 | <div class="alert alert-warning"> | |
274 | <div> |
|
274 | <div> | |
275 | <strong>${_('Missing commits')}:</strong> |
|
275 | <strong>${_('Missing commits')}:</strong> | |
276 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} |
|
276 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} | |
277 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} |
|
277 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} | |
278 | </div> |
|
278 | </div> | |
279 | </div> |
|
279 | </div> | |
280 | </div> |
|
280 | </div> | |
281 | % endif |
|
281 | % endif | |
282 | <div class="compare_view_commits_title"> |
|
282 | <div class="compare_view_commits_title"> | |
283 | % if c.allowed_to_update and not c.pull_request.is_closed(): |
|
283 | % if c.allowed_to_update and not c.pull_request.is_closed(): | |
284 | <button id="update_commits" class="btn btn-small">${_('Update commits')}</button> |
|
284 | <button id="update_commits" class="btn btn-small">${_('Update commits')}</button> | |
285 | % endif |
|
285 | % endif | |
286 | % if len(c.commit_ranges): |
|
286 | % if len(c.commit_ranges): | |
287 | <h2>${ungettext('Compare View: %s commit','Compare View: %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}</h2> |
|
287 | <h2>${ungettext('Compare View: %s commit','Compare View: %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}</h2> | |
288 | % endif |
|
288 | % endif | |
289 | </div> |
|
289 | </div> | |
290 | % if not c.missing_commits: |
|
290 | % if not c.missing_commits: | |
291 | <%include file="/compare/compare_commits.html" /> |
|
291 | <%include file="/compare/compare_commits.html" /> | |
292 | ## FILES |
|
292 | ## FILES | |
293 | <div class="cs_files_title"> |
|
293 | <div class="cs_files_title"> | |
294 | <span class="cs_files_expand"> |
|
294 | <span class="cs_files_expand"> | |
295 | <span id="expand_all_files">${_('Expand All')}</span> | <span id="collapse_all_files">${_('Collapse All')}</span> |
|
295 | <span id="expand_all_files">${_('Expand All')}</span> | <span id="collapse_all_files">${_('Collapse All')}</span> | |
296 | </span> |
|
296 | </span> | |
297 | <h2> |
|
297 | <h2> | |
298 | ${diff_block.diff_summary_text(len(c.files), c.lines_added, c.lines_deleted, c.limited_diff)} |
|
298 | ${diff_block.diff_summary_text(len(c.files), c.lines_added, c.lines_deleted, c.limited_diff)} | |
299 | </h2> |
|
299 | </h2> | |
300 | </div> |
|
300 | </div> | |
301 | % endif |
|
301 | % endif | |
302 | <div class="cs_files"> |
|
302 | <div class="cs_files"> | |
303 | %if not c.files and not c.missing_commits: |
|
303 | %if not c.files and not c.missing_commits: | |
304 | <span class="empty_data">${_('No files')}</span> |
|
304 | <span class="empty_data">${_('No files')}</span> | |
305 | %endif |
|
305 | %endif | |
306 | <table class="compare_view_files"> |
|
306 | <table class="compare_view_files"> | |
307 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
307 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
308 | %for FID, change, path, stats in c.files: |
|
308 | %for FID, change, path, stats in c.files: | |
309 | <tr class="cs_${change} collapse_file" fid="${FID}"> |
|
309 | <tr class="cs_${change} collapse_file" fid="${FID}"> | |
310 | <td class="cs_icon_td"> |
|
310 | <td class="cs_icon_td"> | |
311 | <span class="collapse_file_icon" fid="${FID}"></span> |
|
311 | <span class="collapse_file_icon" fid="${FID}"></span> | |
312 | </td> |
|
312 | </td> | |
313 | <td class="cs_icon_td"> |
|
313 | <td class="cs_icon_td"> | |
314 | <div class="flag_status not_reviewed hidden"></div> |
|
314 | <div class="flag_status not_reviewed hidden"></div> | |
315 | </td> |
|
315 | </td> | |
316 | <td class="cs_${change}" id="a_${FID}"> |
|
316 | <td class="cs_${change}" id="a_${FID}"> | |
317 | <div class="node"> |
|
317 | <div class="node"> | |
318 | <a href="#a_${FID}"> |
|
318 | <a href="#a_${FID}"> | |
319 | <i class="icon-file-${change.lower()}"></i> |
|
319 | <i class="icon-file-${change.lower()}"></i> | |
320 | ${h.safe_unicode(path)} |
|
320 | ${h.safe_unicode(path)} | |
321 | </a> |
|
321 | </a> | |
322 | </div> |
|
322 | </div> | |
323 | </td> |
|
323 | </td> | |
324 | <td> |
|
324 | <td> | |
325 | <div class="changes pull-right">${h.fancy_file_stats(stats)}</div> |
|
325 | <div class="changes pull-right">${h.fancy_file_stats(stats)}</div> | |
326 | <div class="comment-bubble pull-right" data-path="${path}"> |
|
326 | <div class="comment-bubble pull-right" data-path="${path}"> | |
327 | <i class="icon-comment"></i> |
|
327 | <i class="icon-comment"></i> | |
328 | </div> |
|
328 | </div> | |
329 | </td> |
|
329 | </td> | |
330 | </tr> |
|
330 | </tr> | |
331 | <tr fid="${FID}" id="diff_${FID}" class="diff_links"> |
|
331 | <tr fid="${FID}" id="diff_${FID}" class="diff_links"> | |
332 | <td></td> |
|
332 | <td></td> | |
333 | <td></td> |
|
333 | <td></td> | |
334 | <td class="cs_${change}"> |
|
334 | <td class="cs_${change}"> | |
335 | %if c.target_repo.repo_name == c.repo_name: |
|
335 | %if c.target_repo.repo_name == c.repo_name: | |
336 | ${diff_block.diff_menu(c.repo_name, h.safe_unicode(path), c.target_ref, c.source_ref, change)} |
|
336 | ${diff_block.diff_menu(c.repo_name, h.safe_unicode(path), c.target_ref, c.source_ref, change)} | |
337 | %else: |
|
337 | %else: | |
338 | ## this is slightly different case later, since the other repo can have this |
|
338 | ## this is slightly different case later, since the other repo can have this | |
339 | ## file in other state than the origin repo |
|
339 | ## file in other state than the origin repo | |
340 | ${diff_block.diff_menu(c.target_repo.repo_name, h.safe_unicode(path), c.target_ref, c.source_ref, change)} |
|
340 | ${diff_block.diff_menu(c.target_repo.repo_name, h.safe_unicode(path), c.target_ref, c.source_ref, change)} | |
341 | %endif |
|
341 | %endif | |
342 | </td> |
|
342 | </td> | |
343 | <td class="td-actions rc-form"> |
|
343 | <td class="td-actions rc-form"> | |
344 | <div data-comment-id="${FID}" class="btn-link show-inline-comments comments-visible"> |
|
344 | <div data-comment-id="${FID}" class="btn-link show-inline-comments comments-visible"> | |
345 | <span class="comments-show">${_('Show comments')}</span> |
|
345 | <span class="comments-show">${_('Show comments')}</span> | |
346 | <span class="comments-hide">${_('Hide comments')}</span> |
|
346 | <span class="comments-hide">${_('Hide comments')}</span> | |
347 | </div> |
|
347 | </div> | |
348 | </td> |
|
348 | </td> | |
349 | </tr> |
|
349 | </tr> | |
350 | <tr id="tr_${FID}"> |
|
350 | <tr id="tr_${FID}"> | |
351 | <td></td> |
|
351 | <td></td> | |
352 | <td></td> |
|
352 | <td></td> | |
353 | <td class="injected_diff" colspan="2"> |
|
353 | <td class="injected_diff" colspan="2"> | |
354 | ${diff_block.diff_block_simple([c.changes[FID]])} |
|
354 | ${diff_block.diff_block_simple([c.changes[FID]])} | |
355 | </td> |
|
355 | </td> | |
356 | </tr> |
|
356 | </tr> | |
357 |
|
357 | |||
358 | ## Loop through inline comments |
|
358 | ## Loop through inline comments | |
359 | % if c.outdated_comments.get(path,False): |
|
359 | % if c.outdated_comments.get(path,False): | |
360 | <tr class="outdated"> |
|
360 | <tr class="outdated"> | |
361 | <td></td> |
|
361 | <td></td> | |
362 | <td></td> |
|
362 | <td></td> | |
363 | <td colspan="2"> |
|
363 | <td colspan="2"> | |
364 | <p>${_('Outdated Inline Comments')}:</p> |
|
364 | <p>${_('Outdated Inline Comments')}:</p> | |
365 | </td> |
|
365 | </td> | |
366 | </tr> |
|
366 | </tr> | |
367 | <tr class="outdated"> |
|
367 | <tr class="outdated"> | |
368 | <td></td> |
|
368 | <td></td> | |
369 | <td></td> |
|
369 | <td></td> | |
370 | <td colspan="2" class="outdated_comment_block"> |
|
370 | <td colspan="2" class="outdated_comment_block"> | |
371 | % for line, comments in c.outdated_comments[path].iteritems(): |
|
371 | % for line, comments in c.outdated_comments[path].iteritems(): | |
372 | <div class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> |
|
372 | <div class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> | |
373 | % for co in comments: |
|
373 | % for co in comments: | |
374 | ${comment.comment_block_outdated(co)} |
|
374 | ${comment.comment_block_outdated(co)} | |
375 | % endfor |
|
375 | % endfor | |
376 | </div> |
|
376 | </div> | |
377 | % endfor |
|
377 | % endfor | |
378 | </td> |
|
378 | </td> | |
379 | </tr> |
|
379 | </tr> | |
380 | % endif |
|
380 | % endif | |
381 | %endfor |
|
381 | %endfor | |
382 | ## Loop through inline comments for deleted files |
|
382 | ## Loop through inline comments for deleted files | |
383 | %for path in c.deleted_files: |
|
383 | %for path in c.deleted_files: | |
384 | <tr class="outdated deleted"> |
|
384 | <tr class="outdated deleted"> | |
385 | <td></td> |
|
385 | <td></td> | |
386 | <td></td> |
|
386 | <td></td> | |
387 | <td>${path}</td> |
|
387 | <td>${path}</td> | |
388 | </tr> |
|
388 | </tr> | |
389 | <tr class="outdated deleted"> |
|
389 | <tr class="outdated deleted"> | |
390 | <td></td> |
|
390 | <td></td> | |
391 | <td></td> |
|
391 | <td></td> | |
392 | <td>(${_('Removed')})</td> |
|
392 | <td>(${_('Removed')})</td> | |
393 | </tr> |
|
393 | </tr> | |
394 | % if path in c.outdated_comments: |
|
394 | % if path in c.outdated_comments: | |
395 | <tr class="outdated deleted"> |
|
395 | <tr class="outdated deleted"> | |
396 | <td></td> |
|
396 | <td></td> | |
397 | <td></td> |
|
397 | <td></td> | |
398 | <td colspan="2"> |
|
398 | <td colspan="2"> | |
399 | <p>${_('Outdated Inline Comments')}:</p> |
|
399 | <p>${_('Outdated Inline Comments')}:</p> | |
400 | </td> |
|
400 | </td> | |
401 | </tr> |
|
401 | </tr> | |
402 | <tr class="outdated"> |
|
402 | <tr class="outdated"> | |
403 | <td></td> |
|
403 | <td></td> | |
404 | <td></td> |
|
404 | <td></td> | |
405 | <td colspan="2" class="outdated_comment_block"> |
|
405 | <td colspan="2" class="outdated_comment_block"> | |
406 | % for line, comments in c.outdated_comments[path].iteritems(): |
|
406 | % for line, comments in c.outdated_comments[path].iteritems(): | |
407 | <div class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> |
|
407 | <div class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> | |
408 | % for co in comments: |
|
408 | % for co in comments: | |
409 | ${comment.comment_block_outdated(co)} |
|
409 | ${comment.comment_block_outdated(co)} | |
410 | % endfor |
|
410 | % endfor | |
411 | </div> |
|
411 | </div> | |
412 | % endfor |
|
412 | % endfor | |
413 | </td> |
|
413 | </td> | |
414 | </tr> |
|
414 | </tr> | |
415 | % endif |
|
415 | % endif | |
416 | %endfor |
|
416 | %endfor | |
417 | </table> |
|
417 | </table> | |
418 | </div> |
|
418 | </div> | |
419 | % if c.limited_diff: |
|
419 | % if c.limited_diff: | |
420 | <h5>${_('Commit was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a huge diff might take some time and resources")}')">${_('Show full diff')}</a></h5> |
|
420 | <h5>${_('Commit was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a huge diff might take some time and resources")}')">${_('Show full diff')}</a></h5> | |
421 | % endif |
|
421 | % endif | |
422 | </div> |
|
422 | </div> | |
423 | </div> |
|
423 | </div> | |
424 |
|
424 | |||
425 | % if c.limited_diff: |
|
425 | % if c.limited_diff: | |
426 | <p>${_('Commit was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a huge diff might take some time and resources")}')">${_('Show full diff')}</a></p> |
|
426 | <p>${_('Commit was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a huge diff might take some time and resources")}')">${_('Show full diff')}</a></p> | |
427 | % endif |
|
427 | % endif | |
428 |
|
428 | |||
429 | ## template for inline comment form |
|
429 | ## template for inline comment form | |
430 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
430 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
431 | ${comment.comment_inline_form()} |
|
431 | ${comment.comment_inline_form()} | |
432 |
|
432 | |||
433 | ## render comments and inlines |
|
433 | ## render comments and inlines | |
434 | ${comment.generate_comments(include_pull_request=True, is_pull_request=True)} |
|
434 | ${comment.generate_comments(include_pull_request=True, is_pull_request=True)} | |
435 |
|
435 | |||
436 | % if not c.pull_request.is_closed(): |
|
436 | % if not c.pull_request.is_closed(): | |
437 | ## main comment form and it status |
|
437 | ## main comment form and it status | |
438 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, |
|
438 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, | |
439 | pull_request_id=c.pull_request.pull_request_id), |
|
439 | pull_request_id=c.pull_request.pull_request_id), | |
440 | c.pull_request_review_status, |
|
440 | c.pull_request_review_status, | |
441 | is_pull_request=True, change_status=c.allowed_to_change_status)} |
|
441 | is_pull_request=True, change_status=c.allowed_to_change_status)} | |
442 | %endif |
|
442 | %endif | |
443 |
|
443 | |||
444 | <script type="text/javascript"> |
|
444 | <script type="text/javascript"> | |
445 | if (location.hash) { |
|
445 | if (location.hash) { | |
446 | var result = splitDelimitedHash(location.hash); |
|
446 | var result = splitDelimitedHash(location.hash); | |
447 | var line = $('html').find(result.loc); |
|
447 | var line = $('html').find(result.loc); | |
448 | if (line.length > 0){ |
|
448 | if (line.length > 0){ | |
449 | offsetScroll(line, 70); |
|
449 | offsetScroll(line, 70); | |
450 | } |
|
450 | } | |
451 | } |
|
451 | } | |
452 | $(function(){ |
|
452 | $(function(){ | |
453 | ReviewerAutoComplete('user'); |
|
453 | ReviewerAutoComplete('user'); | |
454 | // custom code mirror |
|
454 | // custom code mirror | |
455 | var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input'); |
|
455 | var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input'); | |
456 |
|
456 | |||
457 | var PRDetails = { |
|
457 | var PRDetails = { | |
458 | editButton: $('#open_edit_pullrequest'), |
|
458 | editButton: $('#open_edit_pullrequest'), | |
459 | closeButton: $('#close_edit_pullrequest'), |
|
459 | closeButton: $('#close_edit_pullrequest'), | |
460 | viewFields: $('#pr-desc, #pr-title'), |
|
460 | viewFields: $('#pr-desc, #pr-title'), | |
461 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), |
|
461 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), | |
462 |
|
462 | |||
463 | init: function() { |
|
463 | init: function() { | |
464 | var that = this; |
|
464 | var that = this; | |
465 | this.editButton.on('click', function(e) { that.edit(); }); |
|
465 | this.editButton.on('click', function(e) { that.edit(); }); | |
466 | this.closeButton.on('click', function(e) { that.view(); }); |
|
466 | this.closeButton.on('click', function(e) { that.view(); }); | |
467 | }, |
|
467 | }, | |
468 |
|
468 | |||
469 | edit: function(event) { |
|
469 | edit: function(event) { | |
470 | this.viewFields.hide(); |
|
470 | this.viewFields.hide(); | |
471 | this.editButton.hide(); |
|
471 | this.editButton.hide(); | |
472 | this.editFields.show(); |
|
472 | this.editFields.show(); | |
473 | codeMirrorInstance.refresh(); |
|
473 | codeMirrorInstance.refresh(); | |
474 | }, |
|
474 | }, | |
475 |
|
475 | |||
476 | view: function(event) { |
|
476 | view: function(event) { | |
477 | this.editFields.hide(); |
|
477 | this.editFields.hide(); | |
478 | this.closeButton.hide(); |
|
478 | this.closeButton.hide(); | |
479 | this.viewFields.show(); |
|
479 | this.viewFields.show(); | |
480 | } |
|
480 | } | |
481 | }; |
|
481 | }; | |
482 |
|
482 | |||
483 | var ReviewersPanel = { |
|
483 | var ReviewersPanel = { | |
484 | editButton: $('#open_edit_reviewers'), |
|
484 | editButton: $('#open_edit_reviewers'), | |
485 | closeButton: $('#close_edit_reviewers'), |
|
485 | closeButton: $('#close_edit_reviewers'), | |
486 | addButton: $('#add_reviewer_input'), |
|
486 | addButton: $('#add_reviewer_input'), | |
487 | removeButtons: $('.reviewer_member_remove'), |
|
487 | removeButtons: $('.reviewer_member_remove'), | |
488 |
|
488 | |||
489 | init: function() { |
|
489 | init: function() { | |
490 | var that = this; |
|
490 | var that = this; | |
491 | this.editButton.on('click', function(e) { that.edit(); }); |
|
491 | this.editButton.on('click', function(e) { that.edit(); }); | |
492 | this.closeButton.on('click', function(e) { that.close(); }); |
|
492 | this.closeButton.on('click', function(e) { that.close(); }); | |
493 | }, |
|
493 | }, | |
494 |
|
494 | |||
495 | edit: function(event) { |
|
495 | edit: function(event) { | |
496 | this.editButton.hide(); |
|
496 | this.editButton.hide(); | |
497 | this.closeButton.show(); |
|
497 | this.closeButton.show(); | |
498 | this.addButton.show(); |
|
498 | this.addButton.show(); | |
499 | this.removeButtons.css('visibility', 'visible'); |
|
499 | this.removeButtons.css('visibility', 'visible'); | |
500 | }, |
|
500 | }, | |
501 |
|
501 | |||
502 | close: function(event) { |
|
502 | close: function(event) { | |
503 | this.editButton.show(); |
|
503 | this.editButton.show(); | |
504 | this.closeButton.hide(); |
|
504 | this.closeButton.hide(); | |
505 | this.addButton.hide(); |
|
505 | this.addButton.hide(); | |
506 | this.removeButtons.css('visibility', 'hidden'); |
|
506 | this.removeButtons.css('visibility', 'hidden'); | |
507 | } |
|
507 | } | |
508 | }; |
|
508 | }; | |
509 |
|
509 | |||
510 | PRDetails.init(); |
|
510 | PRDetails.init(); | |
511 | ReviewersPanel.init(); |
|
511 | ReviewersPanel.init(); | |
512 |
|
512 | |||
513 | $('#show-outdated-comments').on('click', function(e){ |
|
513 | $('#show-outdated-comments').on('click', function(e){ | |
514 | var button = $(this); |
|
514 | var button = $(this); | |
515 | var outdated = $('.outdated'); |
|
515 | var outdated = $('.outdated'); | |
516 | if (button.html() === "(Show)") { |
|
516 | if (button.html() === "(Show)") { | |
517 | button.html("(Hide)"); |
|
517 | button.html("(Hide)"); | |
518 | outdated.show(); |
|
518 | outdated.show(); | |
519 | } else { |
|
519 | } else { | |
520 | button.html("(Show)"); |
|
520 | button.html("(Show)"); | |
521 | outdated.hide(); |
|
521 | outdated.hide(); | |
522 | } |
|
522 | } | |
523 | }); |
|
523 | }); | |
524 |
|
524 | |||
525 | $('.show-inline-comments').on('change', function(e){ |
|
525 | $('.show-inline-comments').on('change', function(e){ | |
526 | var show = 'none'; |
|
526 | var show = 'none'; | |
527 | var target = e.currentTarget; |
|
527 | var target = e.currentTarget; | |
528 | if(target.checked){ |
|
528 | if(target.checked){ | |
529 | show = '' |
|
529 | show = '' | |
530 | } |
|
530 | } | |
531 | var boxid = $(target).attr('id_for'); |
|
531 | var boxid = $(target).attr('id_for'); | |
532 | var comments = $('#{0} .inline-comments'.format(boxid)); |
|
532 | var comments = $('#{0} .inline-comments'.format(boxid)); | |
533 | var fn_display = function(idx){ |
|
533 | var fn_display = function(idx){ | |
534 | $(this).css('display', show); |
|
534 | $(this).css('display', show); | |
535 | }; |
|
535 | }; | |
536 | $(comments).each(fn_display); |
|
536 | $(comments).each(fn_display); | |
537 | var btns = $('#{0} .inline-comments-button'.format(boxid)); |
|
537 | var btns = $('#{0} .inline-comments-button'.format(boxid)); | |
538 | $(btns).each(fn_display); |
|
538 | $(btns).each(fn_display); | |
539 | }); |
|
539 | }); | |
540 |
|
540 | |||
541 | // inject comments into their proper positions |
|
541 | // inject comments into their proper positions | |
542 | var file_comments = $('.inline-comment-placeholder'); |
|
542 | var file_comments = $('.inline-comment-placeholder'); | |
543 | %if c.pull_request.is_closed(): |
|
543 | %if c.pull_request.is_closed(): | |
544 | renderInlineComments(file_comments, false); |
|
544 | renderInlineComments(file_comments, false); | |
545 | %else: |
|
545 | %else: | |
546 | renderInlineComments(file_comments, true); |
|
546 | renderInlineComments(file_comments, true); | |
547 | %endif |
|
547 | %endif | |
548 | var commentTotals = {}; |
|
548 | var commentTotals = {}; | |
549 | $.each(file_comments, function(i, comment) { |
|
549 | $.each(file_comments, function(i, comment) { | |
550 | var path = $(comment).attr('path'); |
|
550 | var path = $(comment).attr('path'); | |
551 | var comms = $(comment).children().length; |
|
551 | var comms = $(comment).children().length; | |
552 | if (path in commentTotals) { |
|
552 | if (path in commentTotals) { | |
553 | commentTotals[path] += comms; |
|
553 | commentTotals[path] += comms; | |
554 | } else { |
|
554 | } else { | |
555 | commentTotals[path] = comms; |
|
555 | commentTotals[path] = comms; | |
556 | } |
|
556 | } | |
557 | }); |
|
557 | }); | |
558 | $.each(commentTotals, function(path, total) { |
|
558 | $.each(commentTotals, function(path, total) { | |
559 | var elem = $('.comment-bubble[data-path="'+ path +'"]'); |
|
559 | var elem = $('.comment-bubble[data-path="'+ path +'"]'); | |
560 | elem.css('visibility', 'visible'); |
|
560 | elem.css('visibility', 'visible'); | |
561 | elem.html(elem.html() + ' ' + total ); |
|
561 | elem.html(elem.html() + ' ' + total ); | |
562 | }); |
|
562 | }); | |
563 |
|
563 | |||
564 | $('#merge_pull_request_form').submit(function() { |
|
564 | $('#merge_pull_request_form').submit(function() { | |
565 | if (!$('#merge_pull_request').attr('disabled')) { |
|
565 | if (!$('#merge_pull_request').attr('disabled')) { | |
566 | $('#merge_pull_request').attr('disabled', 'disabled'); |
|
566 | $('#merge_pull_request').attr('disabled', 'disabled'); | |
567 | } |
|
567 | } | |
568 | return true; |
|
568 | return true; | |
569 | }); |
|
569 | }); | |
570 |
|
570 | |||
571 | $('#edit_pull_request').on('click', function(e){ |
|
571 | $('#edit_pull_request').on('click', function(e){ | |
572 | var title = $('#pr-title-input').val(); |
|
572 | var title = $('#pr-title-input').val(); | |
573 | var description = codeMirrorInstance.getValue(); |
|
573 | var description = codeMirrorInstance.getValue(); | |
574 | editPullRequest( |
|
574 | editPullRequest( | |
575 | "${c.repo_name}", "${c.pull_request.pull_request_id}", |
|
575 | "${c.repo_name}", "${c.pull_request.pull_request_id}", | |
576 | title, description); |
|
576 | title, description); | |
577 | }); |
|
577 | }); | |
578 |
|
578 | |||
579 | $('#update_pull_request').on('click', function(e){ |
|
579 | $('#update_pull_request').on('click', function(e){ | |
580 | updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
580 | updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
581 | }); |
|
581 | }); | |
582 |
|
582 | |||
583 | $('#update_commits').on('click', function(e){ |
|
583 | $('#update_commits').on('click', function(e){ | |
584 | var isDisabled = !$(e.currentTarget).attr('disabled'); |
|
584 | var isDisabled = !$(e.currentTarget).attr('disabled'); | |
585 | $(e.currentTarget).text(_gettext('Updating...')); |
|
585 | $(e.currentTarget).text(_gettext('Updating...')); | |
586 | $(e.currentTarget).attr('disabled', 'disabled'); |
|
586 | $(e.currentTarget).attr('disabled', 'disabled'); | |
587 | if(isDisabled){ |
|
587 | if(isDisabled){ | |
588 | updateCommits("${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
588 | updateCommits("${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
589 | } |
|
589 | } | |
590 |
|
590 | |||
591 | }); |
|
591 | }); | |
592 | // fixing issue with caches on firefox |
|
592 | // fixing issue with caches on firefox | |
593 | $('#update_commits').removeAttr("disabled"); |
|
593 | $('#update_commits').removeAttr("disabled"); | |
594 |
|
594 | |||
595 | $('#close_pull_request').on('click', function(e){ |
|
595 | $('#close_pull_request').on('click', function(e){ | |
596 | closePullRequest("${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
596 | closePullRequest("${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
597 | }); |
|
597 | }); | |
598 |
|
598 | |||
599 | $('.show-inline-comments').on('click', function(e){ |
|
599 | $('.show-inline-comments').on('click', function(e){ | |
600 | var boxid = $(this).attr('data-comment-id'); |
|
600 | var boxid = $(this).attr('data-comment-id'); | |
601 | var button = $(this); |
|
601 | var button = $(this); | |
602 |
|
602 | |||
603 | if(button.hasClass("comments-visible")) { |
|
603 | if(button.hasClass("comments-visible")) { | |
604 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
604 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
605 | $(this).hide(); |
|
605 | $(this).hide(); | |
606 | }) |
|
606 | }) | |
607 | button.removeClass("comments-visible"); |
|
607 | button.removeClass("comments-visible"); | |
608 | } else { |
|
608 | } else { | |
609 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
609 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
610 | $(this).show(); |
|
610 | $(this).show(); | |
611 | }) |
|
611 | }) | |
612 | button.addClass("comments-visible"); |
|
612 | button.addClass("comments-visible"); | |
613 | } |
|
613 | } | |
614 | }); |
|
614 | }); | |
615 | }) |
|
615 | }) | |
616 | </script> |
|
616 | </script> | |
617 |
|
617 | |||
618 | </div> |
|
618 | </div> | |
619 | </div> |
|
619 | </div> | |
620 |
|
620 | |||
621 | </%def> |
|
621 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now