index.mustache 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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('crumbs.users', "Users") %>
  19. <% @active_tab = "users" %>
  20. <% content_for :page_title do %>
  21. <% if @query %>
  22. <%= t('search_for_user', 'User Search results for %{user_name}', :user_name => (params[:user][:name] rescue '')) %>
  23. <% else %>
  24. {{#t}}All Users{{/t}}
  25. <% end %>
  26. <% end %>
  27. <% content_for :right_side do %>
  28. <div class="rs-margin-bottom">
  29. <% if can_do(@context, @current_user, :manage_groups) %>
  30. <a href="<%= context_url(@context, :context_groups_url) %>" class="btn button-sidebar-wide user_groups"><i class="icon-group"></i> {{#t}}View User Groups{{/t}}</a>
  31. <% end %>
  32. <% if service_enabled?(:avatars) %>
  33. <a href="<%= context_url(@context, :context_avatars_url) %>" class="btn button-sidebar-wide manage_profile_pictures"><i class="icon-user"></i> {{#t}}Manage Profile Pictures{{/t}}</a>
  34. <% end %>
  35. </div>
  36. <% if @enrollment_terms.size > 1 %>
  37. <h2>{{#t}}Choose Term{{/t}}</h2>
  38. <div class="rs-margin-bottom">
  39. <label for="enrollment_term"><%= before_label('show_users_for_term', 'Show users with enrollments in the term') %></label><br />
  40. <%= form_tag(account_users_path, :method => :get) do %>
  41. <input name="focus" type="hidden" value="enrollment_term_id"/>
  42. {{> views/shared/enrollment_term_select}}
  43. <% end %>
  44. </div>
  45. <% end %>
  46. {{> views/shared/accounts_right_side_shared}}
  47. {{> views/accounts/add_course_or_user}}
  48. <% end %>
  49. <% if @query %>
  50. <h1><%= t('titles.search_results', 'Search results for "%{search_term}"', :search_term => (params[:user][:name] rescue '')) %></h1>
  51. <%= t('no_results_found', "No Results Found") if @users.empty? %>
  52. <% else %>
  53. <h1>{{#t}}All Users{{/t}}</h1>
  54. <% end %>
  55. <%= will_paginate(@users, :style=>"margin-bottom: 1em;") %>
  56. <ul class="users">
  57. <% @users.each do |user| %>
  58. <li id="user_<%= user.id %>" class="user">
  59. <%= link_to(user.last_name_first_or_unnamed, context_url(@context, :context_user_url, user)) %>
  60. </li>
  61. <% end %>
  62. </ul>
  63. <%= will_paginate(@users, :style=>"margin-top: 1em;") %>
  64. <% js_bundle 'legacy/users_index' %>
  65. <% js_bundle 'focus_helper' %>