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