roster_user_usage.mustache 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. <% content_for :page_title, t('titles.access_report', 'Access Report') %>
  19. <% add_crumb(t('#crumbs.people', 'People'), context_url(@context, :context_users_url))
  20. add_crumb(@user.name, context_url(@context, :context_user_url, @user))
  21. @active_tab="people"
  22. add_crumb(t('#crumbs.access_report', "Access Report"))
  23. css_bundle :roster_user_usage
  24. %>
  25. <% content_for :right_side do %>
  26. <a class="btn button-sidebar-wide" href="<%= context_url(@context, :context_user_url, @user) %>">
  27. <i class="icon-arrow-left"></i>
  28. {{#t}}Back to User Page{{/t}}
  29. </a>
  30. <% end %>
  31. <h1><%= t 'headings.user_access_report', '%{user} Access Report', :user => @user.name %></h1>
  32. <div id="usage_report">
  33. <table class="ic-Table">
  34. <thead>
  35. <tr>
  36. <th>{{#t}}Content{{/t}}</th>
  37. <th style="text-align: right;">{{#t}}Times Viewed{{/t}}</th>
  38. <th style="text-align: right;">{{#t}}Times Participated{{/t}}</th>
  39. <th>{{#t}}Last Viewed{{/t}}</th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. <% @accesses.each do |access| %>
  44. <tr class="access <%= access.asset_class_name %>">
  45. <td class="name_holder">
  46. <i class="icon <%= access.icon %>" aria-hidden="true"></i>
  47. <span class="readable_name"><%= access.readable_name %></span>
  48. </td>
  49. <td class="view_score"><%= round_if_whole(access.corrected_view_score) %></td>
  50. <td class="participate_score"><%= access.participate_score %></td>
  51. <td class="last_viewed time_ago_date" data-timestamp="<%= access.last_access.try_rescue(:iso8601) %>"><%= datetime_string(access.last_access) %></td>
  52. </tr>
  53. <% end %>
  54. <tr class="access blank" style="display: none;">
  55. <td class="name_holder">
  56. <i class="icon" aria-hidden="true"></i>
  57. <span class="readable_name">&nbsp;</span>
  58. </td>
  59. <td class="view_score">&nbsp;</td>
  60. <td class="participate_score">&nbsp;</td>
  61. <td class="last_viewed time_ago_date">&nbsp;</td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. </div>
  66. <%= will_paginate(@accesses) %>
  67. <% js_bundle 'legacy/context_roster_usage' %>