avatars.mustache 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <%
  2. # Copyright (C) 2011 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <% add_crumb t(:page_title, 'Profile Pictures') %>
  19. <% content_for :page_title do %>{{#t}}Profile Pictures{{/t}}<% end %>
  20. <% content_for :stylesheets do %>
  21. <style>
  22. .views .selected {
  23. font-weight: bold;
  24. font-size: 1.1em;
  25. }
  26. #avatars {
  27. width: 100%;
  28. border-collapse: collapse;
  29. margin-top: 10px;
  30. }
  31. #avatars tr .avatar_state {
  32. width: 50px;
  33. }
  34. #avatars td {
  35. border-bottom: 1px dotted #ddd;
  36. padding: 2px 0;
  37. }
  38. #avatars td.link_holder {
  39. text-align: right;
  40. }
  41. </style>
  42. <% end %>
  43. <h1>{{#t}}Profile Pictures{{/t}}</h1>
  44. <div class="views">
  45. <span style="padding-right: 10px; font-weight: bold;"><%= before_label :show, 'Show' %> </span>
  46. <a href="?avatar_state=submitted" id="submitted_profile" class="<%= 'selected' if @avatar_state == 'submitted' %>"><%= t(:submitted_link, { :zero => "Submitted", :one => "Submitted %{count}", :other => "Submitted %{count}" }, :count => @avatar_counts[:submitted] || 0) %></a> |
  47. <a href="?avatar_state=reported" id="reported_profile"class="<%= 'selected' if @avatar_state == 'reported' %>"><%= t(:reported_link, { :zero => "Reported", :one => "Reported %{count}", :other => "Reported %{count}" }, :count => @avatar_counts[:reported] || 0) %></a> |
  48. <a href="?avatar_state=re_reported" id="re_reported_profile" class="<%= 'selected' if @avatar_state == 're_reported' %>"><%= t(:re_reported_link, { :zero => "Approved, Re-Reported", :one => "Approved, Re-Reported %{count}", :other => "Approved, Re-Reported %{count}"}, :count => @avatar_counts[:re_reported] || 0) %></a> |
  49. <a href="?avatar_state=any" id="any_profile" class="<%= 'selected' if @avatar_state == 'any' %>"><%= t(:all_link, { :zero => "All", :one => "All %{count}", :other => "All %{count}" }, :count => @avatar_counts[:all] || 0) %></a>
  50. </div>
  51. <% if @users.empty? %>
  52. <h2 style="padding-top: 20px;">{{#t}}No Profile Pics to Show{{/t}}</h2>
  53. <% end %>
  54. <table id="avatars">
  55. <% @users.each do |user| %>
  56. <tr class="<%= user.avatar_state %>">
  57. <td style="width: 54px;">
  58. <%= avatar user, url: nil %>
  59. </td>
  60. <td class="avatar_state">
  61. <% if user.avatar_state == :reported %>
  62. <i class="icon-warning" aria-hidden="true"></i>
  63. <% end %>
  64. <% if user.avatar_state == :re_reported %>
  65. <i class="icon-warning" aria-hidden="true"></i>
  66. <% end %>
  67. <% if user.avatar_state == :locked %>
  68. <i class="icon-lock" aria-hidden="true"></i>
  69. <% end %>
  70. <% if user.avatar_state == :approved %>
  71. <i class="icon-check" aria-hidden="true"></i>
  72. <% end %>
  73. </td>
  74. <td>
  75. <div class="name"><a href="<%= user_url(user.id) %>"><%= user.name %></a></div>
  76. <div class="email"><%= user.email %></div>
  77. </td>
  78. <td class="link_holder">
  79. <div class="links">
  80. <a href="#" class="update_avatar_link approve_avatar_link" data-state="approved" style="<%= hidden unless user.avatar_approvable? %>">{{#t}}approve{{/t}}</a>
  81. <a href="#" class="update_avatar_link lock_avatar_link" data-state="locked" style="<%= hidden if user.avatar_state == :locked %>">{{#t}}lock{{/t}}</a>
  82. <a href="#" class="update_avatar_link unlock_avatar_link" data-state="approved" style="<%= hidden unless user.avatar_state == :locked %>">{{#t}}unlock{{/t}}</a>
  83. <a href="#" class="update_avatar_link reject_avatar_link" data-state="none">{{#t}}delete{{/t}}</a>
  84. <div style="display: none;">
  85. <a href="<%= update_avatar_image_url(user.id) %>" class="user_avatar_url">&nbsp;</a>
  86. </div>
  87. </div>
  88. <div class="progress" style="visibility: hidden;">
  89. {{#t}}Saving...{{/t}}"
  90. </div>
  91. </td>
  92. </tr>
  93. <% end %>
  94. </table>
  95. <%= will_paginate(@users, :style=>"margin-bottom: 1em;") %>
  96. <% js_bundle :manage_avatars %>