<% # Copyright (C) 2012 - 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 . %> <%= form_tag update_profile_profile_path, { :method => :put, :id => :edit_profile_form, :class => "ic-Form-control" } do %>
<% if @user_data[:can_edit_name] %>

<%= @user_data[:short_name] %> <% if @user_data[:pronouns] %>(<%= @user_data[:pronouns] %>)<% end %>

<% if @user.can_change_pronunciation?(@domain_root_account) %>

<%= t('name_pronunciation_label_tip', 'To confirm the correct pronunciation of your name, enter a phonetic pronunciation.') %>

<% end %> <%# even if @domain_root_account.settings[:can_add_pronouns] is false, we still want to let someone that has pronouns set to see this so they can unset them %> <% if @user.pronouns || @domain_root_account.settings[:can_add_pronouns] %> <%= select_tag :pronouns, options_for_select(([[t("None"), '']] + @domain_root_account.pronouns + [@user.pronouns]).compact.uniq, @user.pronouns), class:"show-if-editing", disabled:!@domain_root_account.can_change_pronouns? && (!@domain_root_account.can_add_pronouns? || !@domain_root_account.grants_right?(@current_user, :manage_courses_admin)) %> <% end %>

<%= @user_data[:title] %> <%# Do not convert these to inferred-key translations, "title" is most often used in canvas for things like document titles, but personal titles can be translated differently in some languages. %>

<% else %>

<%= @user_data[:short_name] %> <% if @user_data[:pronouns] %>(<%= @user_data[:pronouns] %>)<% end %>

<% if @user.can_change_pronunciation?(@domain_root_account) %>

<%= t('name_pronunciation_header', 'Name Pronunciation') %>

<%= t('name_pronunciation_header_tip', 'To confirm the correct pronunciation of your name, enter a phonetic pronunciation.') %>
<% end %> <% if @user_data[:title] %>

<%= @user_data[:title] %>

<% end %> <% end %> <% if @user != @current_user %> <% if can_do(@user, @current_user, :remove_avatar) %> <%= I18n.t('Remove avatar picture') %> <% elsif !session["reported_#{@user.id}"] %> <%= I18n.t('Report inappropriate picture') %> <% else %>
<%= I18n.t('This image has been reported.') %>
<% end %> <% end %> <% if @domain_root_account.settings[:enable_name_pronunciation] %>

<%= t('name_pronunciation', 'Name Pronunciation') %>

<% if @user_data[:pronunciation].present? && @user_data[:pronunciation] != "" %>

<%= @user_data[:pronunciation] %>

<% else %>

<%= t('no_name_pronunciation', 'No name pronunciation provided') %>

<% end %>
<% end %>

<%= t('#profile.ways_to_contact_me', "Contact") %>

<% if @user_data[:user_services].present? %> <% else %>

<%= t('#profile.you_have_no_services', "No registered services, you can add some on the *settings* page.", :name => @user_data[:short_name], :wrapper => link_to('\1', settings_profile_path)) %>

<% end %>

<%= t :ways_to_contact_user, "Contact" %>

<% if @user_data[:user_services].blank? && @user == @current_user %>

<%= t('#profile.you_have_no_services', "No registered services, you can add some on the *settings* page.", :name => @user_data[:short_name], :wrapper => link_to('\1', settings_profile_path)) %>

<% else %> <% end %>

<%= t :bio, "Biography" %>

<% if @user_data[:bio] && @user_data[:bio] != "" %>
<%= raw format_message(@user_data[:bio]).first %>
<% else %>

<%= t('user_has_no_bio', "No biography has been added") %>

<% end %> <% if @user_data[:can_edit] %>
<% end %>
<% if @user != @current_user %>

<%= t :user_enrolled, "Enrollments" %>

<% if @user_data[:common_contexts] %>
    <% @user_data[:common_contexts].each do |context| %>
  • <%= context[:roles].join(', ') %> in <%= context[:name] %>
  • <% end %>
<% else %>

<%= t('nothing_in_common', "You don't have anything in common") %>

<% end %>
<% end %>
<% if @user_data[:can_edit] %>
<% end %>
<% end %>