##// END OF EJS Templates
reviewers: colorify the groups
marcink -
r2485:590df012 default
parent child Browse files
Show More
@@ -22,7 +22,8 b''
22 22 *usage::
23 23 * var CG = new ColorGenerator();
24 24 * var col = CG.getColor(key); //returns array of RGB
25 * 'rgb({0})'.format(col.join(',')
25 * CG.asRGB(col) === 'rgb({0})'.format(col.join(',')
26 *
26 27 *
27 28 * @returns {ColorGenerator}
28 29 */
@@ -47,6 +48,9 b' ColorGenerator.prototype = {'
47 48 return this.cacheColorMap[key];
48 49 }
49 50 },
51 asRGB:function(color_tuple) {
52 return 'rgb({0})'.format(color_tuple.join(','));
53 },
50 54 _hsvToRgb:function(h,s,v){
51 55 if (s === 0.0)
52 56 return [v, v, v];
@@ -26,11 +26,24 b' if (show_disabled) {'
26 26
27 27 </script>
28 28
29 <script>
30 var CG = new ColorGenerator();
31 </script>
29 32
30 33 <script id="ejs_reviewMemberEntry" type="text/template" class="ejsTemplate">
31 34
32 35 <li id="reviewer_<%= member.user_id %>" class="reviewer_entry">
33 <div class="reviewers_member">
36 <%
37
38 if (member.user_group && member.user_group.vote_rule) {
39 var groupStyle = 'border-left: 1px solid '+CG.asRGB(CG.getColor(member.user_group.vote_rule));
40 } else {
41 var groupStyle = 'border-left: 1px solid white';
42 }
43
44 %>
45
46 <div class="reviewers_member" style="<%= groupStyle%>" >
34 47 <div class="reviewer_status tooltip" title="<%= review_status_label %>">
35 48 <div class="flag_status <%= review_status %> pull-left reviewer_member_status"></div>
36 49 </div>
@@ -41,15 +54,6 b' if (show_disabled) {'
41 54 </div>
42 55 <% } %>
43 56
44 <%if (member.user_group && member.user_group.vote_rule) {%>
45 <div style="float:right">
46 <%if (member.user_group.vote_rule == -1) {%>
47 Min votes: ALL
48 <%} else {%>
49 Min votes: <%= member.user_group.vote_rule %>
50 <%}%>
51 </div>
52 <%}%>
53 57 <%-
54 58 renderTemplate('gravatarWithUser', {
55 59 'size': 16,
@@ -62,6 +66,18 b' if (show_disabled) {'
62 66
63 67 <input type="hidden" name="__start__" value="reviewer:mapping">
64 68
69
70 <%if (member.user_group && member.user_group.vote_rule) {%>
71 <div class="reviewer_reason">
72
73 <%if (member.user_group.vote_rule == -1) {%>
74 - group votes required: ALL
75 <%} else {%>
76 - group votes required: <%= member.user_group.vote_rule %>
77 <%}%>
78 </div>
79 <%}%>
80
65 81 <input type="hidden" name="__start__" value="reasons:sequence">
66 82 <% for (var i = 0; i < reasons.length; i++) { %>
67 83 <% var reason = reasons[i] %>
@@ -106,4 +122,4 b' if (show_disabled) {'
106 122 registerTemplates();
107 123 </script>
108 124
109 </%text> No newline at end of file
125 </%text>
General Comments 0
You need to be logged in to leave comments. Login now