<% # 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 . %> <% provide :page_title do %><%= @user.short_name %><% end %> <% provide :right_side do %>
<%= t 'links.message_user', "Message %{user}", :user => context_user_name(@context, @user) %>
<% if @context_account.is_a?(Account) && @user.grants_right?(@current_user, :generate_observer_pairing_code) && @user.has_student_enrollment? && @context_account.root_account.self_registration? %>
<% end %>
<% end %>

<%= t(:page_header_title, "User Profile") %>

<% if @context_account.is_a?(Account) && @context_account.has_outcomes? %>
<%= t('see_outcomes', 'See Outcome Results for %{user}', :user => @user.short_name) %>
<% end %> <% if @user.workflow_state == 'deleted' %>
<%= t("This user has been deleted.") %> <% if @user.merged_into_user %> <%= t("They were merged into *%{other_user}*.", other_user: @user.merged_into_user.name, wrapper: { '*' => link_to('\1', user_path(@user.merged_into_user)) }) %> <% end %>
<% end %>

<%= @user.short_name %> <% if @user.pronouns %>(<%= @user.pronouns %>)<% end %>

<% css_bundle :roster_user, :context_list, :pairing_code %> <% js_env user_suspend_status: { pseudonyms: @user.all_active_pseudonyms.reject do |p| p.sis_user_id.present? && !can_do(p, @current_user, :manage_sis) end.map { |p| { id: p.id, workflow_state: p.workflow_state, unique_id: p.unique_id } } } %>
<%= render :partial => 'users/name' %> <%= render :partial => 'users/logins' %> <% if @domain_root_account.feature_enabled?(:temporary_enrollments) && @enrollments.detect(&:temporary_enrollment_source_user_id).present? && @context_account.grants_any_right?(@current_user, *RoleOverride::MANAGE_TEMPORARY_ENROLLMENT_PERMISSIONS)%>
<%= t('Temporary Enrollments') %> <% num_enrollments = 0 %>

<%= t('courses', 'Courses') %> <%= count_if_any(@enrollments.select(&:temporary_enrollment?).count) %>

    <% @enrollments.each do |enrollment| %> <% num_enrollments += 1 %> <%= render :partial => "enrollment", :object => enrollment if enrollment.temporary_enrollment? %> <% end %>
<% end %>
<%= t('enrollments', 'Enrollments') %> <% num_enrollments = 0 %>

<%= t('courses', 'Courses') %> <%= count_if_any(@enrollments.reject(&:temporary_enrollment?).count) %>

    <% @enrollments.each do |enrollment| %> <% num_enrollments += 1 %> <%= render :partial => "enrollment", :object => enrollment unless enrollment.temporary_enrollment? %> <% end %>
<% if @user.adminable_accounts && !@user.adminable_accounts.empty? %>

<%= t('accounts', 'Accounts') %> <%= count_if_any(@user.adminable_accounts.count) %>

    <% @user.adminable_accounts.each do |account| %> <% num_enrollments += 1 %>
  • <%= account.name %>
  • <% end %>
<% end %> <% if !@group_memberships.empty? %>

<%= t('groups', 'Groups') %> <%= count_if_any(@group_memberships.count) %>

<% end %> <% if num_enrollments == 0 %>
<%= t('none_yet', 'None yet.') %>
<% end %>
<% if @show_page_views %>

<%= t('page_views', 'Page Views') %>

<%= render :partial => 'page_views/table' %> <% end %>
<% js_bundle :user %>