<% # Copyright (C) 2011 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see . %> <% unless @read_only account = @context && (@context.is_a?(Account) ? @context : @context.account) # Note: we'd like to pick :allow_course_admin_actions or :manage_admin_users depending on # whether or not the :granular_permissions_manage_users FF is on for the root account, but # we need the permission in order to even figure out what the appropriate root account is. # So in this case, we'll take either; this appears to be safe because the permission check # is not used anywhere else in this view. managed_accounts = @user.associated_root_accounts.select{|a| can_do(a, @current_user, :allow_course_admin_actions, :manage_admin_users) } account ||= managed_accounts.first root_account = account.root_account if account end %> <% js_bundle :user_name %>
<%= t('titles.name_and_email', 'Name and Email') %> <% if service_enabled?(:avatars) %> <% end %> <% if @context.grants_right? @current_user, :read_email_addresses %> <% end %> <% unless @read_only %> <%# order important: the can_do(...) check filters out contexts that don't respond to root_account (e.g. User) %> <% first = true %> <% end %>
<%= before_label('full_name', 'Full Name') %> <%=h @user.name %>
<%= before_label('display_name', 'Display Name') %> <%=h @user.short_name %>
<%= before_label('sortable_name', 'Sortable Name') %> <%=h @user.sortable_name %>
<%= before_label('profile_picture', 'Profile Picture') %> <%= avatar @user, url: nil %> <% if can_do(@user, @current_user, :remove_avatar) %> <%= t('remove_avatar', 'Remove avatar picture') %> <% elsif !session["reported_#{@user.id}"] %> <%= t('report_naughtiness', 'Report inappropriate picture') %> <% end %>
<%= before_label('default_email', 'Default Email') %> <%=h @user.email %>
<%= before_label('time_zone', 'Time Zone') %> <%= @user.time_zone.try(:name) || t('none', "None") %>
<% unless @read_only %> <% end %>