templates.html
169 lines
| 4.9 KiB
| text/html
|
HtmlLexer
r2484 | <%text> | |||
<div style="display: none"> | ||||
<script id="ejs_gravatarWithUser" type="text/template" class="ejsTemplate"> | ||||
<% | ||||
if (size > 16) { | ||||
var gravatar_class = 'gravatar gravatar-large'; | ||||
} else { | ||||
var gravatar_class = 'gravatar'; | ||||
} | ||||
r4026 | ||||
if (tooltip) { | ||||
var gravatar_class = gravatar_class + ' tooltip-hovercard'; | ||||
} | ||||
var data_hovercard_alt = username; | ||||
r2484 | %> | |||
<% | ||||
if (show_disabled) { | ||||
var user_cls = 'user user-disabled'; | ||||
} else { | ||||
var user_cls = 'user'; | ||||
} | ||||
r4026 | var data_hovercard_url = pyroutes.url('hovercard_user', {"user_id": user_id}) | |||
r2484 | %> | |||
<div class="rc-user"> | ||||
r4026 | <img class="<%= gravatar_class %>" height="<%= size %>" width="<%= size %>" data-hovercard-url="<%= data_hovercard_url %>" data-hovercard-alt="<%= data_hovercard_alt %>" src="<%- gravatar_url -%>"> | |||
r2484 | <span class="<%= user_cls %>"> <%- user_link -%> </span> | |||
</div> | ||||
</script> | ||||
r2485 | <script> | |||
var CG = new ColorGenerator(); | ||||
</script> | ||||
r2484 | ||||
<script id="ejs_reviewMemberEntry" type="text/template" class="ejsTemplate"> | ||||
r4481 | <% | |||
if (create) { | ||||
var edit_visibility = 'visible'; | ||||
} else { | ||||
var edit_visibility = 'hidden'; | ||||
} | ||||
r2485 | ||||
r4481 | if (member.user_group && member.user_group.vote_rule) { | |||
var groupStyle = 'border-right: 2px solid '+CG.asRGB(CG.getColor(member.user_group.vote_rule)); | ||||
} else { | ||||
var groupStyle = 'border-right: 2px solid transparent'; | ||||
} | ||||
%> | ||||
r2485 | ||||
r4481 | <li id="reviewer_<%= member.user_id %>" class="reviewer_entry" style="<%= groupStyle%>" tooltip="Review Group"> | |||
<div class="reviewers_member"> | ||||
r2484 | <div class="reviewer_status tooltip" title="<%= review_status_label %>"> | |||
r3939 | <i class="icon-circle review-status-<%= review_status %>"></i> | |||
r4481 | ||||
r2484 | </div> | |||
<div id="reviewer_<%= member.user_id %>_name" class="reviewer_name"> | ||||
<% if (mandatory) { %> | ||||
<div class="reviewer_member_mandatory tooltip" title="Mandatory reviewer"> | ||||
<i class="icon-lock"></i> | ||||
</div> | ||||
<% } %> | ||||
<%- | ||||
renderTemplate('gravatarWithUser', { | ||||
'size': 16, | ||||
'show_disabled': false, | ||||
r4026 | 'tooltip': true, | |||
'username': member.username, | ||||
'user_id': member.user_id, | ||||
r2484 | 'user_link': member.user_link, | |||
'gravatar_url': member.gravatar_link | ||||
}) | ||||
%> | ||||
</div> | ||||
<input type="hidden" name="__start__" value="reviewer:mapping"> | ||||
r2485 | ||||
<%if (member.user_group && member.user_group.vote_rule) {%> | ||||
<div class="reviewer_reason"> | ||||
<%if (member.user_group.vote_rule == -1) {%> | ||||
- group votes required: ALL | ||||
<%} else {%> | ||||
- group votes required: <%= member.user_group.vote_rule %> | ||||
<%}%> | ||||
</div> | ||||
<%}%> | ||||
r2484 | <input type="hidden" name="__start__" value="reasons:sequence"> | |||
<% for (var i = 0; i < reasons.length; i++) { %> | ||||
<% var reason = reasons[i] %> | ||||
<div class="reviewer_reason">- <%= reason %></div> | ||||
<input type="hidden" name="reason" value="<%= reason %>"> | ||||
<% } %> | ||||
<input type="hidden" name="__end__" value="reasons:sequence"> | ||||
<input type="hidden" name="__start__" value="rules:sequence"> | ||||
<% for (var i = 0; i < member.rules.length; i++) { %> | ||||
<% var rule = member.rules[i] %> | ||||
<input type="hidden" name="rule_id" value="<%= rule %>"> | ||||
<% } %> | ||||
<input type="hidden" name="__end__" value="rules:sequence"> | ||||
<input id="reviewer_<%= member.user_id %>_input" type="hidden" value="<%= member.user_id %>" name="user_id" /> | ||||
<input type="hidden" name="mandatory" value="<%= mandatory %>"/> | ||||
<input type="hidden" name="__end__" value="reviewer:mapping"> | ||||
<% if (mandatory) { %> | ||||
r2504 | <div class="reviewer_member_mandatory_remove" style="visibility: <%= edit_visibility %>;"> | |||
r3798 | <i class="icon-remove"></i> | |||
r2484 | </div> | |||
<% } else { %> | ||||
<% if (allowed_to_update) { %> | ||||
r2504 | <div class="reviewer_member_remove action_button" onclick="reviewersController.removeReviewMember(<%= member.user_id %>, true)" style="visibility: <%= edit_visibility %>;"> | |||
r3798 | <i class="icon-remove" ></i> | |||
r2484 | </div> | |||
<% } %> | ||||
<% } %> | ||||
</div> | ||||
</li> | ||||
</script> | ||||
r4408 | <script id="ejs_commentVersion" type="text/template" class="ejsTemplate"> | |||
<% | ||||
if (size > 16) { | ||||
var gravatar_class = 'gravatar gravatar-large'; | ||||
} else { | ||||
var gravatar_class = 'gravatar'; | ||||
} | ||||
%> | ||||
<% | ||||
if (show_disabled) { | ||||
var user_cls = 'user user-disabled'; | ||||
} else { | ||||
var user_cls = 'user'; | ||||
} | ||||
%> | ||||
<div style='line-height: 20px'> | ||||
<img style="margin: -3px 0" class="<%= gravatar_class %>" height="<%= size %>" width="<%= size %>" src="<%- gravatar_url -%>"> | ||||
<strong><%- user_name -%></strong>, <code>v<%- version -%></code> edited <%- timeago_component -%> | ||||
</div> | ||||
</script> | ||||
r2484 | </div> | |||
<script> | ||||
// registers the templates into global cache | ||||
registerTemplates(); | ||||
</script> | ||||
r2485 | </%text> | |||