##// END OF EJS Templates
reviewers: fixed UI issues on reviewers for big screens.
milka -
r4577:40ea091b stable
parent child Browse files
Show More
@@ -1,267 +1,266 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 <td style="width: 20px">
69 <td style="width: 20px">
69 <div class="tooltip presence-state" style="display: none; position: absolute; left: 2px" title="This users is currently at this page">
70 <div class="tooltip presence-state" style="display: none; position: absolute; left: 2px" title="This users is currently at this page">
70 <i class="icon-eye" style="color: #0ac878"></i>
71 <i class="icon-eye" style="color: #0ac878"></i>
71 </div>
72 </div>
72 <% if (role === 'reviewer') { %>
73 <% if (role === 'reviewer') { %>
73 <div class="reviewer_status tooltip" title="<%= review_status_label %>">
74 <div class="reviewer_status tooltip" title="<%= review_status_label %>">
74 <i class="icon-circle review-status-<%= review_status %>"></i>
75 <i class="icon-circle review-status-<%= review_status %>"></i>
75 </div>
76 </div>
76 <% } else if (role === 'observer') { %>
77 <% } else if (role === 'observer') { %>
77 <div class="tooltip" title="Observer without voting right.">
78 <div class="tooltip" title="Observer without voting right.">
78 <i class="icon-circle-thin"></i>
79 <i class="icon-circle-thin"></i>
79 </div>
80 </div>
80 <% } %>
81 <% } %>
81 </td>
82 </td>
83 <% } %>
84
85 <% if (mandatory) { %>
86 <td style="text-align: right;width: 10px;">
87 <div class="reviewer_member_mandatory tooltip" title="Mandatory reviewer">
88 <i class="icon-lock"></i>
89 </div>
90 </td>
91
92 <% } else { %>
93 <td style="text-align: right;width: 10px;">
94 <% if (allowed_to_update) { %>
95 <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>
97 </div>
98 <% } %>
99 </td>
100 <% } %>
82
101
83 <td>
102 <td>
84 <div id="reviewer_<%= member.user_id %>_name" class="reviewer_name">
103 <div id="reviewer_<%= member.user_id %>_name" class="reviewer_name">
85 <%-
104 <%-
86 renderTemplate('gravatarWithUser', {
105 renderTemplate('gravatarWithUser', {
87 'size': 16,
106 'size': 16,
88 'show_disabled': false,
107 'show_disabled': false,
89 'tooltip': true,
108 'tooltip': true,
90 'username': member.username,
109 'username': member.username,
91 'user_id': member.user_id,
110 'user_id': member.user_id,
92 'user_link': member.user_link,
111 'user_link': member.user_link,
93 'gravatar_url': member.gravatar_link
112 'gravatar_url': member.gravatar_link
94 })
113 })
95 %>
114 %>
96 </div>
115 </div>
97 </td>
98
99 <td style="width: 10px">
100 <% if (reviewGroup !== null) { %>
116 <% if (reviewGroup !== null) { %>
101 <span class="tooltip" title="Member of review group from rule: `<%= member.user_group.name %>`" style="color: <%= reviewGroupColor %>">
117 <span class="tooltip" title="Member of review group from rule: `<%= member.user_group.name %>`" style="color: <%= reviewGroupColor %>">
102 <%- reviewGroup %>
118 <%- reviewGroup %>
103 </span>
119 </span>
104 <% } %>
120 <% } %>
105 </td>
121 </td>
106
122
107 <% if (mandatory) { %>
108 <td style="text-align: right;width: 10px;">
109 <div class="reviewer_member_mandatory tooltip" title="Mandatory reviewer">
110 <i class="icon-lock"></i>
111 </div>
112 </td>
113
114 <% } else { %>
115 <td style="text-align: right;width: 10px;">
116 <% if (allowed_to_update) { %>
117 <div class="<%=role %>_member_remove" onclick="reviewersController.removeMember(<%= member.user_id %>, true)" style="visibility: <%= edit_visibility %>;">
118 <i class="icon-remove"></i>
119 </div>
120 <% } %>
121 </td>
122 <% } %>
123
124 </tr>
123 </tr>
125
124
126 <tr id="reviewer_<%= member.user_id %>_rules">
125 <tr id="reviewer_<%= member.user_id %>_rules">
127 <td colspan="4" style="display: <%= rule_visibility %>" class="pr-user-rule-container">
126 <td colspan="4" style="display: <%= rule_visibility %>" class="pr-user-rule-container">
128 <input type="hidden" name="__start__" value="reviewer:mapping">
127 <input type="hidden" name="__start__" value="reviewer:mapping">
129
128
130 <%if (member.user_group && member.user_group.vote_rule) { %>
129 <%if (member.user_group && member.user_group.vote_rule) { %>
131 <div class="reviewer_reason">
130 <div class="reviewer_reason">
132
131
133 <%if (member.user_group.vote_rule == -1) {%>
132 <%if (member.user_group.vote_rule == -1) {%>
134 - group votes required: ALL
133 - group votes required: ALL
135 <%} else {%>
134 <%} else {%>
136 - group votes required: <%= member.user_group.vote_rule %>
135 - group votes required: <%= member.user_group.vote_rule %>
137 <%}%>
136 <%}%>
138 </div>
137 </div>
139 <%} %>
138 <%} %>
140
139
141 <input type="hidden" name="__start__" value="reasons:sequence">
140 <input type="hidden" name="__start__" value="reasons:sequence">
142 <% for (var i = 0; i < reasons.length; i++) { %>
141 <% for (var i = 0; i < reasons.length; i++) { %>
143 <% var reason = reasons[i] %>
142 <% var reason = reasons[i] %>
144 <div class="reviewer_reason">- <%= reason %></div>
143 <div class="reviewer_reason">- <%= reason %></div>
145 <input type="hidden" name="reason" value="<%= reason %>">
144 <input type="hidden" name="reason" value="<%= reason %>">
146 <% } %>
145 <% } %>
147 <input type="hidden" name="__end__" value="reasons:sequence">
146 <input type="hidden" name="__end__" value="reasons:sequence">
148
147
149 <input type="hidden" name="__start__" value="rules:sequence">
148 <input type="hidden" name="__start__" value="rules:sequence">
150 <% for (var i = 0; i < member.rules.length; i++) { %>
149 <% for (var i = 0; i < member.rules.length; i++) { %>
151 <% var rule = member.rules[i] %>
150 <% var rule = member.rules[i] %>
152 <input type="hidden" name="rule_id" value="<%= rule %>">
151 <input type="hidden" name="rule_id" value="<%= rule %>">
153 <% } %>
152 <% } %>
154 <input type="hidden" name="__end__" value="rules:sequence">
153 <input type="hidden" name="__end__" value="rules:sequence">
155
154
156 <input id="reviewer_<%= member.user_id %>_input" type="hidden" value="<%= member.user_id %>" name="user_id" />
155 <input id="reviewer_<%= member.user_id %>_input" type="hidden" value="<%= member.user_id %>" name="user_id" />
157 <input type="hidden" name="mandatory" value="<%= mandatory %>"/>
156 <input type="hidden" name="mandatory" value="<%= mandatory %>"/>
158 <input type="hidden" name="role" value="<%= role %>"/>
157 <input type="hidden" name="role" value="<%= role %>"/>
159
158
160 <input type="hidden" name="__end__" value="reviewer:mapping">
159 <input type="hidden" name="__end__" value="reviewer:mapping">
161 </td>
160 </td>
162 </tr>
161 </tr>
163
162
164 </script>
163 </script>
165
164
166 <script id="ejs_commentVersion" type="text/template" class="ejsTemplate">
165 <script id="ejs_commentVersion" type="text/template" class="ejsTemplate">
167
166
168 <%
167 <%
169 if (size > 16) {
168 if (size > 16) {
170 var gravatar_class = 'gravatar gravatar-large';
169 var gravatar_class = 'gravatar gravatar-large';
171 } else {
170 } else {
172 var gravatar_class = 'gravatar';
171 var gravatar_class = 'gravatar';
173 }
172 }
174
173
175 %>
174 %>
176
175
177 <%
176 <%
178 if (show_disabled) {
177 if (show_disabled) {
179 var user_cls = 'user user-disabled';
178 var user_cls = 'user user-disabled';
180 } else {
179 } else {
181 var user_cls = 'user';
180 var user_cls = 'user';
182 }
181 }
183
182
184 %>
183 %>
185
184
186 <div style='line-height: 20px'>
185 <div style='line-height: 20px'>
187 <img style="margin: -3px 0" class="<%= gravatar_class %>" height="<%= size %>" width="<%= size %>" src="<%- gravatar_url -%>">
186 <img style="margin: -3px 0" class="<%= gravatar_class %>" height="<%= size %>" width="<%= size %>" src="<%- gravatar_url -%>">
188 <strong><%- user_name -%></strong>, <code>v<%- version -%></code> edited <%- timeago_component -%>
187 <strong><%- user_name -%></strong>, <code>v<%- version -%></code> edited <%- timeago_component -%>
189 </div>
188 </div>
190
189
191 </script>
190 </script>
192
191
193
192
194 <script id="ejs_sideBarCommentHovercard" type="text/template" class="ejsTemplate">
193 <script id="ejs_sideBarCommentHovercard" type="text/template" class="ejsTemplate">
195
194
196 <div>
195 <div>
197 <% if (is_todo) { %>
196 <% if (is_todo) { %>
198 <% if (inline) { %>
197 <% if (inline) { %>
199 <strong>Inline</strong> TODO on line: <%= line_no %>
198 <strong>Inline</strong> TODO on line: <%= line_no %>
200 <% if (version_info) { %>
199 <% if (version_info) { %>
201 <%= version_info %>
200 <%= version_info %>
202 <% } %>
201 <% } %>
203 <br/>
202 <br/>
204 File: <code><%- file_name -%></code>
203 File: <code><%- file_name -%></code>
205 <% } else { %>
204 <% } else { %>
206 <% if (review_status) { %>
205 <% if (review_status) { %>
207 <i class="icon-circle review-status-<%= review_status %>"></i>
206 <i class="icon-circle review-status-<%= review_status %>"></i>
208 <% } %>
207 <% } %>
209 <strong>General</strong> TODO
208 <strong>General</strong> TODO
210 <% if (version_info) { %>
209 <% if (version_info) { %>
211 <%= version_info %>
210 <%= version_info %>
212 <% } %>
211 <% } %>
213 <% } %>
212 <% } %>
214 <% } else { %>
213 <% } else { %>
215 <% if (inline) { %>
214 <% if (inline) { %>
216 <strong>Inline</strong> comment on line: <%= line_no %>
215 <strong>Inline</strong> comment on line: <%= line_no %>
217 <% if (version_info) { %>
216 <% if (version_info) { %>
218 <%= version_info %>
217 <%= version_info %>
219 <% } %>
218 <% } %>
220 <br/>
219 <br/>
221 File: <code><%- file_name -%></code>
220 File: <code><%- file_name -%></code>
222 <% } else { %>
221 <% } else { %>
223 <% if (review_status) { %>
222 <% if (review_status) { %>
224 <i class="icon-circle review-status-<%= review_status %>"></i>
223 <i class="icon-circle review-status-<%= review_status %>"></i>
225 <% } %>
224 <% } %>
226 <strong>General</strong> comment
225 <strong>General</strong> comment
227 <% if (version_info) { %>
226 <% if (version_info) { %>
228 <%= version_info %>
227 <%= version_info %>
229 <% } %>
228 <% } %>
230 <% } %>
229 <% } %>
231 <% } %>
230 <% } %>
232 <br/>
231 <br/>
233 Created:
232 Created:
234 <time class="timeago" title="<%= created_on %>" datetime="<%= datetime %>"><%= $.timeago(datetime) %></time>
233 <time class="timeago" title="<%= created_on %>" datetime="<%= datetime %>"><%= $.timeago(datetime) %></time>
235
234
236 </div>
235 </div>
237
236
238 </script>
237 </script>
239
238
240 <script id="ejs_commentHelpHovercard" type="text/template" class="ejsTemplate">
239 <script id="ejs_commentHelpHovercard" type="text/template" class="ejsTemplate">
241
240
242 <div>
241 <div>
243 Use <strong>@username</strong> mention syntax to send direct notification to this RhodeCode user.<br/>
242 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/>
243 Typing / starts autocomplete for certain action, e.g set review status, or comment type. <br/>
245 <br/>
244 <br/>
246 Use <strong>Cmd/ctrl+enter</strong> to submit comment, or <strong>Shift+Cmd/ctrl+enter</strong> to submit a draft.<br/>
245 Use <strong>Cmd/ctrl+enter</strong> to submit comment, or <strong>Shift+Cmd/ctrl+enter</strong> to submit a draft.<br/>
247 <br/>
246 <br/>
248 <strong>Draft comments</strong> are private to the author, and trigger no notification to others.<br/>
247 <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/>
248 They are permanent until deleted, or converted to regular comments.<br/>
250 <br/>
249 <br/>
251 <br/>
250 <br/>
252 </div>
251 </div>
253
252
254 </script>
253 </script>
255
254
256
255
257
256
258 ##// END OF EJS Templates
257 ##// END OF EJS Templates
259 </div>
258 </div>
260
259
261
260
262 <script>
261 <script>
263 // registers the templates into global cache
262 // registers the templates into global cache
264 registerTemplates();
263 registerTemplates();
265 </script>
264 </script>
266
265
267 </%text>
266 </%text>
General Comments 0
You need to be logged in to leave comments. Login now