<commit_before><%
# 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 <http://www.gnu.org/licenses/>.
%>

<% provide :page_title do %><%= join_title context_user_name(@context, @user), @context.name %><% end %>
<% provide :right_side do %>
  <h2><%= t 'links.more_about_this_user', "More About This User" %></h2>
  <div class="page-action-list rs-margin-bottom" id="right_nav">
    <% if can_do(@membership, @current_user, :read_grades) && @membership.is_a?(StudentEnrollment) %>
      <a href="<%= context_url(@context, :controller => :gradebooks, :action => :grade_summary, :id => @user.id) %>">
        <i class="icon-check-plus" aria-hidden="true"></i>
        <%= t 'links.user_grades', "Grades" %>
      </a>
    <% end %>
    <% if can_do(@context, @current_user, :send_messages) %>
      <a href="<%= message_user_path(@user) %>">
        <i class="icon-email" aria-hidden="true"></i>
        <%= t 'links.message_user', "Send Message" %>
      </a>
    <% end %>
    <% if @domain_root_account.enable_user_notes and can_do(@user, @current_user, :read_user_notes) %>
      <a href="<%= user_user_notes_path(@user) %>"> <%= t 'links.faculty_journal', "Faculty Journal" %></a>
    <% end %>
    <% if @context.is_a?(Course)%>
      <% if @context.user_is_instructor?(@user) && can_do(@user, @current_user, :read_reports) %>
        <a href="<%= user_course_teacher_activity_url(@user, @context) %>">
          <i class="icon-chat" aria-hidden="true"></i>
          <%= t 'links.teacher_activity', 'Student Interactions Report' %>
        </a>
      <% elsif @context.user_has_been_student?(@user) && @context.user_is_instructor?(@current_user) && can_do(@context, @current_user, :read_reports) %>
        <%= link_to(user_student_teacher_activity_url(@current_user, @user)) do %>
          <i class="icon-chat" aria-hidden="true"></i>
          <%= t('Interactions Report') %>
        <% end %>
      <% end %>
    <% end %>
    <% if can_do(@context, @current_user, :read_reports) %>
      <a href="<%= context_url(@context, :context_user_usage_url, @user) %>">
        <i class="icon-clock" aria-hidden="true"></i>
        <%= t 'links.access_report', "Access Report" %>
      </a>
    <% end %>
    <% if @context.is_a?(Course) && @context.has_outcomes? && can_do(@context, @current_user, :manage) %>
      <a href="<%= context_url(@context, :context_user_outcomes_results_url, @user.id) %>">
        <i class="icon-outcomes" aria-hidden="true"></i>
        <%= t "Outcomes Report" %>
      </a>
    <% end %>
    <% if @user.grants_right?(@current_user, :view_statistics) %>
      <a href="<%= user_path(@user.id) %>">
        <i class="icon-user" aria-hidden="true"></i>
        <%= t('links.user_account_details', %{User Account Details}) %>
      </a>
    <% end %>
    <% roster_user_custom_links(@user).each do |link| %>
      <a href="<%= link[:url] %>">
        <i class="<%= link[:icon_class] %>" aria-hidden="true"></i>
        <%= link[:text] %>
      </a>
    <% end %>
    <% if @user.grants_right?(@current_user, :generate_observer_pairing_code) &&
          @user.has_student_enrollment? &&
          @domain_root_account.self_registration? %>
      <div id="pairing-code"></div>
    <% end %>
  </div>
  <a href="<%= user_profile_path(@current_user) %>" class="profile_url" style="display: none;">&nbsp;</a>
  <h2><%= t 'headings.user_services', "Registered Web Services" %></h2>
  <div>
    <% if can_do(@membership, @current_user, :read_services) && !@membership.user.user_services.empty? %>
      <p>
      <% @membership.user.user_services.each do |service| %>
        <% service_name = service.service.titleize rescue 'Unknown' %>
        <a href="<%= service.service_user_link %>" title="<%= service_name %>" class="no-hover"><%= image_tag "#{service.service}_icon.png", :alt => service_name %></a>
      <% end %>
      </p>
    <% else %>
      <% if !@membership.user.user_services.empty?  %>
        <p>
          <%= t 'services_not_visible', "%{user}'s registered services are not visible to you at this time.", :user => @user.short_name %>
        </p>
      <% else %>
        <p>
          <%= t 'no_services', "%{user} hasn't linked any external services to their account yet.", :user => @user.short_name %>
        </p>
      <% end %>
    <% end %>
    <% if @current_user && @current_user == @user && @current_user.user_services.empty? %>
      <p>
        <%= t 'help.services', %{You haven't linked your user profile to any external services. You can link your Canvas account to services like Twitter. This will make it easier for fellow course and group members to link up with you outside of class.} %>
      </p>
      <p>
        <a href="<%= user_profile_path(@current_user) %>#registered_web_services" class="btn btn-primary"><i class="icon-link"></i> <%= t('links.link_services', %{Link web services to my account}) %></a>
      </p>
    <% elsif @current_user && @current_user == @user && !@current_user.show_user_services %>
      <p>
        <%= 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.} %>
      </p>
      <p>
        <input type="checkbox" id="show_user_services" class="show_user_services_checkbox"/><label for="show_user_services"><%= t('labels.public_list_services', %{Let fellow course/group members see which services I've linked to my profile}) %></label>
      </p>
    <% end %>
  </div>
<% end %>

<h1><%= @user.name %></h1>
<% can_manage_students = can_do(@context, @current_user, :manage_students) %>
<% can_manage_admins = can_do(@context, @current_user, :manage_admin_users) %>

<% if !@context.is_a?(Group) && (can_manage_students || can_manage_admins) %>
<%= render :partial => 'users/name' %>
<a href="#" class="more_user_information_link"><%= t('links.more_user_details', %{more user details...}) %></a>
  <div class="more_user_information" style="display: none;">
    <% if @context.is_a?(Course) %>
      <fieldset>
        <legend><h3><%= t('legends.memberships', %{Membership(s)}) %></h3></legend><commit_msg>add user pronouns to roster page<commit_after><%
# 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 <http://www.gnu.org/licenses/>.
%>

<% provide :page_title do %><%= join_title context_user_name(@context, @user), @context.name %><% end %>
<% provide :right_side do %>
  <h2><%= t 'links.more_about_this_user', "More About This User" %></h2>
  <div class="page-action-list rs-margin-bottom" id="right_nav">
    <% if can_do(@membership, @current_user, :read_grades) && @membership.is_a?(StudentEnrollment) %>
      <a href="<%= context_url(@context, :controller => :gradebooks, :action => :grade_summary, :id => @user.id) %>">
        <i class="icon-check-plus" aria-hidden="true"></i>
        <%= t 'links.user_grades', "Grades" %>
      </a>
    <% end %>
    <% if can_do(@context, @current_user, :send_messages) %>
      <a href="<%= message_user_path(@user) %>">
        <i class="icon-email" aria-hidden="true"></i>
        <%= t 'links.message_user', "Send Message" %>
      </a>
    <% end %>
    <% if @domain_root_account.enable_user_notes and can_do(@user, @current_user, :read_user_notes) %>
      <a href="<%= user_user_notes_path(@user) %>"> <%= t 'links.faculty_journal', "Faculty Journal" %></a>
    <% end %>
    <% if @context.is_a?(Course)%>
      <% if @context.user_is_instructor?(@user) && can_do(@user, @current_user, :read_reports) %>
        <a href="<%= user_course_teacher_activity_url(@user, @context) %>">
          <i class="icon-chat" aria-hidden="true"></i>
          <%= t 'links.teacher_activity', 'Student Interactions Report' %>
        </a>
      <% elsif @context.user_has_been_student?(@user) && @context.user_is_instructor?(@current_user) && can_do(@context, @current_user, :read_reports) %>
        <%= link_to(user_student_teacher_activity_url(@current_user, @user)) do %>
          <i class="icon-chat" aria-hidden="true"></i>
          <%= t('Interactions Report') %>
        <% end %>
      <% end %>
    <% end %>
    <% if can_do(@context, @current_user, :read_reports) %>
      <a href="<%= context_url(@context, :context_user_usage_url, @user) %>">
        <i class="icon-clock" aria-hidden="true"></i>
        <%= t 'links.access_report', "Access Report" %>
      </a>
    <% end %>
    <% if @context.is_a?(Course) && @context.has_outcomes? && can_do(@context, @current_user, :manage) %>
      <a href="<%= context_url(@context, :context_user_outcomes_results_url, @user.id) %>">
        <i class="icon-outcomes" aria-hidden="true"></i>
        <%= t "Outcomes Report" %>
      </a>
    <% end %>
    <% if @user.grants_right?(@current_user, :view_statistics) %>
      <a href="<%= user_path(@user.id) %>">
        <i class="icon-user" aria-hidden="true"></i>
        <%= t('links.user_account_details', %{User Account Details}) %>
      </a>
    <% end %>
    <% roster_user_custom_links(@user).each do |link| %>
      <a href="<%= link[:url] %>">
        <i class="<%= link[:icon_class] %>" aria-hidden="true"></i>
        <%= link[:text] %>
      </a>
    <% end %>
    <% if @user.grants_right?(@current_user, :generate_observer_pairing_code) &&
          @user.has_student_enrollment? &&
          @domain_root_account.self_registration? %>
      <div id="pairing-code"></div>
    <% end %>
  </div>
  <a href="<%= user_profile_path(@current_user) %>" class="profile_url" style="display: none;">&nbsp;</a>
  <h2><%= t 'headings.user_services', "Registered Web Services" %></h2>
  <div>
    <% if can_do(@membership, @current_user, :read_services) && !@membership.user.user_services.empty? %>
      <p>
      <% @membership.user.user_services.each do |service| %>
        <% service_name = service.service.titleize rescue 'Unknown' %>
        <a href="<%= service.service_user_link %>" title="<%= service_name %>" class="no-hover"><%= image_tag "#{service.service}_icon.png", :alt => service_name %></a>
      <% end %>
      </p>
    <% else %>
      <% if !@membership.user.user_services.empty?  %>
        <p>
          <%= t 'services_not_visible', "%{user}'s registered services are not visible to you at this time.", :user => @user.short_name %>
        </p>
      <% else %>
        <p>
          <%= t 'no_services', "%{user} hasn't linked any external services to their account yet.", :user => @user.short_name %>
        </p>
      <% end %>
    <% end %>
    <% if @current_user && @current_user == @user && @current_user.user_services.empty? %>
      <p>
        <%= t 'help.services', %{You haven't linked your user profile to any external services. You can link your Canvas account to services like Twitter. This will make it easier for fellow course and group members to link up with you outside of class.} %>
      </p>
      <p>
        <a href="<%= user_profile_path(@current_user) %>#registered_web_services" class="btn btn-primary"><i class="icon-link"></i> <%= t('links.link_services', %{Link web services to my account}) %></a>
      </p>
    <% elsif @current_user && @current_user == @user && !@current_user.show_user_services %>
      <p>
        <%= 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.} %>
      </p>
      <p>
        <input type="checkbox" id="show_user_services" class="show_user_services_checkbox"/><label for="show_user_services"><%= t('labels.public_list_services', %{Let fellow course/group members see which services I've linked to my profile}) %></label>
      </p>
    <% end %>
  </div>
<% end %>

<h1><%= @user.name %> <% if @user.pronouns %><i>(<%= @user.pronouns %>)</i><% end %></h1>
<% can_manage_students = can_do(@context, @current_user, :manage_students) %>
<% can_manage_admins = can_do(@context, @current_user, :manage_admin_users) %>

<% if !@context.is_a?(Group) && (can_manage_students || can_manage_admins) %>
<%= render :partial => 'users/name' %>
<a href="#" class="more_user_information_link"><%= t('links.more_user_details', %{more user details...}) %></a>
  <div class="more_user_information" style="display: none;">
    <% if @context.is_a?(Course) %>
      <fieldset>
        <legend><h3><%= t('legends.memberships', %{Membership(s)}) %></h3></legend>
{'fraction_non_alphanumeric': 0.18377899246565224, 'fraction_numerical': 0.001920520017727877, 'mean_word_length': 3.6192425793244625, 'pattern_counts': {'":': 0, '<': 324, '<?xml version=': 0, '>': 338, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '915966', 'n_tokens_mistral': 4741, 'n_tokens_neox': 4385, 'n_words': 1076}