<% # 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 %><%= join_title context_user_name(@context, @user), @context.name %><% end %> <% provide :right_side do %>

<%= t 'links.more_about_this_user', "More About This User" %>

<% if can_do(@membership, @current_user, :read_grades) && @membership.is_a?(StudentEnrollment) %> <%= t 'links.user_grades', "Grades" %> <% end %> <% if can_do(@context, @current_user, :send_messages) %> <%= t 'links.message_user', "Send Message" %> <% end %> <% if @context.is_a?(Course)%> <% if @context.user_is_instructor?(@user) && can_do(@user, @current_user, :read_reports) && can_do(@context, @current_user, :view_all_grades) %> <%= t 'links.teacher_activity', 'Student Interactions Report' %> <% elsif @context.user_has_been_student?(@user) && @context.user_is_instructor?(@current_user) && can_do(@context, @current_user, :read_reports) && can_do(@context, @current_user, :view_all_grades) %> <%= link_to(user_student_teacher_activity_url(@current_user, @user)) do %> <%= t('Interactions Report') %> <% end %> <% end %> <% end %> <% if can_do(@context, @current_user, :read_reports) %> <%= t 'links.access_report', "Access Report" %> <% end %> <% if @context.is_a?(Course) && @context.has_outcomes? && can_do(@context, @current_user, :manage) %> <%= t "Outcomes Report" %> <% end %> <% if @user.grants_right?(@current_user, :view_statistics) %> <%= t('links.user_account_details', %{User Account Details}) %> <% end %> <% roster_user_custom_links(@user).each do |link| %> <%= link[:text] %> <% end %> <% if @user.grants_right?(@current_user, :generate_observer_pairing_code) && @user.has_student_enrollment? && @domain_root_account.self_registration? %>
<% end %>

<%= t 'headings.user_services', "Registered Web Services" %>

<% services = @membership.user.user_services.to_a.select{|s| feature_and_service_enabled?(s.service)} %> <% if can_do(@membership, @current_user, :read_services) && !services.empty? %>

<% services.each do |service| %> <% service_name = service.service.titleize rescue 'Unknown' %> <%= image_tag "#{service.service}_icon.png", :alt => service_name %> <% end %>

<% else %> <% if !services.empty? %>

<%= t 'services_not_visible', "%{user}'s registered services are not visible to you at this time.", :user => @user.short_name %>

<% else %>

<%= t 'no_services', "%{user} hasn't linked any external services to their account yet.", :user => @user.short_name %>

<% end %> <% end %> <% if @current_user && @current_user == @user && @current_user.user_services.select{|s| feature_and_service_enabled?(s.service)}.empty? %>

<%= t 'help.services', %{You haven't linked your user profile to any external services. You can link your Canvas account to services like X.com. This will make it easier for fellow course and group members to link up with you outside of class.} %>

<%= t('links.link_services', %{Link web services to my account}) %>

<% elsif @current_user && @current_user == @user && !@current_user.show_user_services %>

<%= t 'help.list_services', %{You haven't enabled your list of registered services. Enabling this list will let fellow course and group members more easily link up with you outside of class.} %>

<% end %>
<% end %>

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

<% manage_perm = @context.root_account.feature_enabled?(:granular_permissions_manage_users) ? :allow_course_admin_actions : :manage_admin_users %> <% can_manage_students = can_do(@context, @current_user, :manage_students) %> <% can_manage_admins = can_do(@context, @current_user, manage_perm) %> <% if !@context.is_a?(Group) && (can_manage_students || can_manage_admins) %> <%= render :partial => 'users/name' %> <%= t('links.more_user_details', %{more user details...}) %>
 
<% elsif service_enabled?(:avatars) %>
<%= avatar(@user, url: nil) %> <% if can_do(@user, @current_user, :remove_avatar) %> <%= t('links.remove_avatar', %{Remove avatar picture}) %> <% else %> <%= t('links.report_avatar', %{Report inappropriate picture}) %> <% end %>
<% end %> <% if @messages %>

<%= t('headings.recent_messages', %{Recent Messages}) %>

<%= t('no_messages', "No Messages") if @messages.empty? %> <% @messages.each do |message| %> <%= render :partial => 'discussion_topics/entry', :object => message, :locals => {:out_of_context => true, :show_context => true, :assignment_visible_to_user => message.discussion_topic.visible_for?(@current_user)} %> <% end %> <% end %>