show.mustache 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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 do %><%= @user.short_name %><% end %>
  19. <% content_for :right_side do %>
  20. <div>
  21. <a href="<%= message_user_path(@user, @context) %>" class="btn button-sidebar-wide">
  22. <i class="icon-email"></i>
  23. <%= t 'links.message_user', "Message %{user}", :user => context_user_name(@context, @user) %>
  24. </a>
  25. <% if @domain_root_account.try_rescue(:enable_user_notes) and can_do(@user, @current_user, :read_user_notes) %>
  26. <a href="<%= user_user_notes_path(@user) %>" class="btn button-sidebar-wide">
  27. <%= t('buttons.faculty_journal_for', 'Faculty Journal for %{user}', :user => context_user_name(@context, @user)) %>
  28. </a>
  29. <% end %>
  30. </div>
  31. <% end %>
  32. <div>
  33. <h1 class="screenreader-only">{{#t}}User Profile{{/t}}</h1>
  34. <% if @context_account.is_a?(Account) && @context_account.has_outcomes? %>
  35. <div style="float: right;">
  36. <div>
  37. <a href="<%= context_url(@context_account, :context_user_outcomes_results_url, @user.id) %>" class=""><%= t('see_outcomes', 'See Outcome Results for %{user}', :user => @user.short_name) %></a>
  38. </div>
  39. </div>
  40. <% end %>
  41. <h2><%= @user.short_name %></h2>
  42. <% content_for :stylesheets do %>
  43. <style type="text/css" media="screen">
  44. #user-info-fieldsets{
  45. margin-bottom: 2em;
  46. }
  47. #user-info-fieldsets table th{
  48. text-align: left;
  49. padding-right: 2em;
  50. }
  51. ul.context_list .subtitle {
  52. line-height: 1.0em;
  53. }
  54. </style>
  55. <% end %>
  56. <% css_bundle :roster_user, :context_list %>
  57. <div id="user-info-fieldsets">
  58. {{> views/users/name}}
  59. {{> views/users/logins}}
  60. <fieldset id="courses" class="">
  61. <legend>{{#t}}Enrollments{{/t}}</legend>
  62. <% num_enrollments = 0 %>
  63. <div style="overflow: hidden; font-size: 0.8em;" id="content">
  64. <div id="courses_list" style="<%= hidden if @enrollments.empty? %>">
  65. <h3>{{#t}}Courses{{/t}} <%= count_if_any(@enrollments.count) %></h3>
  66. <div class="courses" style="font-size: 1.2em">
  67. <ul class="unstyled_list context_list" style="margin-left: 5px; font-size: 0.9em; margin-bottom: 10px; max-height: 200px; overflow: auto;">
  68. <% @enrollments.each do |enrollment| %>
  69. <% num_enrollments += 1 %>
  70. {{> views/enrollment}}
  71. <% end %>
  72. </ul>
  73. </div>
  74. </div>
  75. <% if @user.adminable_accounts && !@user.adminable_accounts.empty? %>
  76. <h3>{{#t}}Accounts{{/t}} <%= count_if_any(@user.adminable_accounts.count) %></h3>
  77. <div class="accounts" style="font-size: 1.2em">
  78. <ul class="unstyled_list context_list" style="margin-left: 5px; font-size: 0.9em; margin-bottom: 10px; max-height: 200px; overflow: auto;">
  79. <% @user.adminable_accounts.each do |account| %>
  80. <% num_enrollments += 1 %>
  81. <li>
  82. <a href="<%= url_for(account) %>">
  83. <span class="name ellipsis"><%= account.name %></span>
  84. <span class="subtitle ellipsis"></span>
  85. </a>
  86. </li>
  87. <% end %>
  88. </ul>
  89. </div>
  90. <% end %>
  91. <% if !@group_memberships.empty? %>
  92. <h3>{{#t}}Groups{{/t}} <%= count_if_any(@group_memberships.count) %></h3>
  93. <div class="groups" style="font-size: 1.2em">
  94. <ul class="unstyled_list context_list" style="margin-left: 5px; font-size: 0.9em; margin-bottom: 10px; max-height: 200px; overflow: auto;">
  95. <% @group_memberships.each do |membership| %>
  96. <% num_enrollments += 1 %>
  97. <li>
  98. <a href="<%= group_path(membership.group) %>">
  99. <span class="name ellipsis"><%= membership.group.name %></span>
  100. <span class="subtitle ellipsis"><%= membership.group.context.name rescue "" %></span>
  101. </a>
  102. </li>
  103. <% end %>
  104. </ul>
  105. </div>
  106. <% end %>
  107. <% if num_enrollments == 0 %>
  108. <div style="font-size: 1.2em;">{{#t}}None yet.{{/t}}</div>
  109. <% end %>
  110. </div>
  111. </fieldset>
  112. </div>
  113. <% if can_do(@user, @current_user, :view_statistics) && page_views_enabled? %>
  114. <h3>
  115. {{#t}}Page Views{{/t}}
  116. </h3>
  117. {{> views/page_views/table}}
  118. <% end %>
  119. </div>
  120. <% js_bundle :user %>