account_user.mustache 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. <% account_user ||= nil %>
  19. <li class="user" id="enrollment_<%= account_user ? account_user.id : 'blank' %>"<%= ' style="display: none;"' unless account_user %>>
  20. <a href="<%= user_url(account_user ? account_user.user_id : '{{ user_id }}') %>" class="user_name name"><%= account_user.try(:user).try(:name) %></a>
  21. <% if !account_user || can_do(account_user, @current_user, :destroy) %>
  22. <a
  23. href="<%= account_remove_account_user_url(@context.id, account_user ? account_user.id : '{{ id }}') %>"
  24. class="remove_account_user_link no-hover"
  25. title="{{#t}}Remove this admin{{/t}}"
  26. >
  27. <i aria-hidden="true" class="icon-end standalone-icon"></i>
  28. <span class="screenreader-only">
  29. <%= t("Remove %{name} as an admin", :name => account_user.try(:user).try(:name)) %>
  30. </span>
  31. </a>
  32. <% end -%>
  33. <span class="membership_type"><%= account_user.try(:readable_type) %></span>
  34. <span class="email"><%= account_user.try(:user).try(:email) %></span>
  35. </li>