%
# 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 %>
<% if can_do(@membership, @current_user, :read_grades) && @membership.is_a?(StudentEnrollment) %>
<% end %>
<% if @domain_root_account.enable_user_notes and can_do(@user, @current_user, :read_user_notes) %>
<% 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) %>
<% 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) %>
<% end %>
<% end %>
<% if can_do(@context, @current_user, :read_reports) %>
<% end %>
<% if @context.is_a?(Course) && @context.has_outcomes? && can_do(@context, @current_user, :manage) %>
<% end %>
<% if @user.grants_right?(@current_user, :view_statistics) %>
<% end %>
<% roster_user_custom_links(@user).each do |link| %>
<% end %>
<% if @user.grants_right?(@current_user, :generate_observer_pairing_code) &&
@user.has_student_enrollment? &&
@domain_root_account.self_registration? %>
<% end %>