<% # 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 . %> <% css_bundle :profile_show, :tinymce js_bundle :profile_show add_body_class 'not-editing' js_env PROFILE: @user_data if @user_data[:can_edit] js_env(folder_id: @user.profile_pics_folder.id) if @user == @current_user %> <%= form_tag update_profile_profile_path, { :method => :put, :id => :edit_profile_form, :class => "ic-Form-control" } do %>
<% if @user_data[:can_edit_avatar] %> <%= avatar(@user_data[:id], size: 128, url: '#', edit: true, class: "profile-link", title: t('titles.click_to_change_profile_pic', "Click to change profile pic"), sr_content: t('Click to change profile picture for %{display_name}', :display_name => @user.short_name)) %> <% elsif @user != @current_user %> <%= avatar(@user, size: 128, url: report_avatar_image_url(@user.id), class: "report_avatar_link", show_flag: true, title: t("Click to report profile picture"), sr_content: t('Click to report profile picture for %{display_name}', :display_name => @user.short_name)) %> <% else %> <%= avatar(@user_data[:id], size: 128, url: nil) %> <% end %>
<% if @user_data[:can_edit_name] %>

<%= @user_data[:short_name] %> <% if @user_data[:pronouns] %>(<%= @user_data[:pronouns] %>)<% 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? %> <% end %>

<%= @user_data[:title] %>

<% else %>

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

<%= @user_data[:title] %>

<% 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] %>
<%= raw format_message(@user_data[:bio]).first %>
<% else %>

<%= t('user_has_no_bio', "%{user} hasn't added a bio", :user => @user_data[:short_name]) %>

<% 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 %>