<% # 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 . %> <% content_for(:page_title) do %> <%= t("User Settings") %> <% end %> <% provide :right_side do %> <% if @current_user.registered? %> <%= render :partial => "ways_to_contact" %>

<%= t('links.edit_settings', "Edit Settings") %> <% if current_mfa_settings != :disabled %> <%= @user.otp_secret_key ? t('links.reconfigure_mfa', "Reconfigure Multi-Factor Authentication") : t('links.configure_mfa', "Set Up Multi-Factor Authentication") %> <% end %> <% if current_mfa_settings == :optional && @user.otp_secret_key %> <%= t('links.disable_mfa', "Disable Multi-Factor Authentication") %> <% end %> <% if current_mfa_settings != :disabled && @user.otp_secret_key %> <%= t('links.otp_backup_codes', "Multi-Factor Authentication Backup Codes") %> <% end %> <%= t("Download Submissions") %> <% if @user.has_student_enrollment? && @domain_root_account && @domain_root_account.self_registration? && @user.grants_right?(@current_user, :generate_observer_pairing_code) %>
<% end %> <% if @domain_root_account.feature_allowed?(:epub_export) && !@domain_root_account.enable_offline_web_export? %> <%= link_to epub_exports_path, class: 'btn button-sidebar-wide' do %> <%= t("Download Course Content") %> <% end %> <% end %>
<% end %> <% end %> <% js_env folder_id: @user.profile_pics_folder.id, PASSWORD_POLICY: @domain_root_account.password_policy, PASSWORD_POLICIES: Hash[@password_pseudonyms.map{ |p| [p.id, p.account.password_policy]}], PROFILE: @user_data, INTERNATIONAL_SMS_ENABLED: @user.account.feature_enabled?(:international_sms) %> <% deferred_js_bundle :profile %> <% css_bundle :profile_edit, :pairing_code %> <% if service_enabled?(:avatars) %> <% if @user_data[:can_edit_avatar] %> <%= avatar(@user, url: '#', edit: true, class: "profile_pic_link #{@user.avatar_state}", sr_content: t('Click to change profile picture for %{display_name}', :display_name => @user.short_name)) %> <% else %> <%= avatar(@user, url: nil, edit: false, class: "profile_pic") %> <% end %> <% end %>

<%= t("%{user_with_genitive} Settings", :user => @user.short_name, :user_with_genitive => I18n.form_proper_noun_singular_genitive(@user.short_name)) %>

<%= form_for @user, :url => profile_path, :html => {:id => "update_profile_form", :style => "margin-bottom: 20px;", :class => 'form-inline'} do |f| %> <% editable_name = @user.user_can_edit_name? %> <%# 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] %> <% end %> <% active_email_channels = @email_channels.select { |cc| cc.active? } %> <% if active_email_channels.length > 1 %> <% end %> <% if available_locales.size > 1 %> <% end %> <% if @user.shard.database_server.maintenance_window_start_hour %> <% end %> <% if @domain_root_account == Account.default %> <% end %> <% if !@password_pseudonyms.empty? %> <% @domain_root_account.password_policy.each do |key, value| %> <% if key == :minimum_character_length %> <% end %> <% if key == :require_number_characters %> <% end %> <% if key == :require_symbol_characters %> <% end %> <% end %> <% end %>
<%= f.blabel :name, :en => "Full Name" %> id="name"<% end %> class="full_name <%= editable_name ? 'display_data' : 'edit_or_show_data' %>"><%=h @user.name %> <%= f.text_field :name, :class => "edit_data", :maxlength => 255, :size => 30, "aria-describedby" => "hints_name" if editable_name %>
<%= t('hints.name', "This name will be used for grading.") %>
<%= f.blabel :short_name, :en => "Display Name" %> id="short_name"<% end %> class="short_name <%= editable_name ? 'display_data' : 'edit_or_show_data' %>"><%=h @user.short_name %> <%= f.text_field :short_name, :class => "edit_data", :maxlength => 255, :size => 30, "aria-describedby" => "hints_short_name" if editable_name %>
<%= t('hints.short_name', "People will see this name in discussions, messages and comments.") %>
<%= f.blabel :sortable_name, :en => "Sortable Name" %> id="sortable_name"<% end %> class="sortable_name <%= editable_name ? 'display_data' : 'edit_or_show_data' %>"><%=h @user.sortable_name %> <%= f.text_field :sortable_name, :class => "edit_data", :maxlength => 255, :size => 30, "aria-describedby" => "hints_sortable_name" if editable_name %>
<%= t('hints.sortable_name', "This name appears in sorted lists.") %>
<%= f.blabel :pronouns, :en => "Pronouns" %> <% if @domain_root_account.grants_right?(@current_user, :manage_courses_admin) %> <%= @user.pronouns || t("None") %> <% if @domain_root_account.can_add_pronouns? %> <%= f.select( :pronouns, options_for_select(([[t("None"), '']] + @domain_root_account.pronouns + [@user.pronouns]).compact.uniq, @user.pronouns)) %> <% end %> <% else %> <%= @user.pronouns || t("None") %> <% if @domain_root_account.can_change_pronouns? %> <%= f.select( :pronouns, options_for_select(([[t("None"), '']] + @domain_root_account.pronouns + [@user.pronouns]).compact.uniq, @user.pronouns)) %> <% end %> <% end %>
<%= t("This pronoun will appear after your name when enabled") %>
<%=h @default_email_channel.path %>
<%= f.blabel :locale, :en => "Language" %> <% no_language = t("System Default (%{language})", :language => available_locales[infer_locale(:root_account => @domain_root_account, :accept_language => request.headers['Accept-Language'])]) %> <%= @user.locale ? available_locales[@user.locale] : no_language %> <%= f.select :locale, [[no_language, nil]] + available_locales.invert.sort_by { |desc, _| Canvas::ICU.collation_key(desc) }, {:selected => @user.locale}, {:class => 'locale', "aria-describedby" => "hints_language"} %> <%= render :partial => 'shared/locale_warning' %>
<%= t('hints.language', "This will override any browser or account settings.") %>
<%= f.blabel :time_zone, :en => "Time Zone" %> <% if name = @user.time_zone.try(:name) %> <%= I18n.send(:translate, I18nTimeZone[name].keyify, name.dup) %> <% else %> <%= t(:none, "None") %> <% end %> <%= f.time_zone_select :time_zone, I18nTimeZone.us_zones, :model => I18nTimeZone, :default => (@domain_root_account.try(:default_time_zone) || "Mountain Time (US & Canada)") %>
<%= render partial: 'shared/maintenance_window', locals: { database_server: @user.shard.database_server, local_zone: ::Time.zone } %>
<% end %> <% if @current_user.registered? %>

<%= t('headers.ways_to_log_in', "Ways to Log In") %>

<% @pseudonyms.each do |p| %> <% if p.first? || p.account_id %> <% end %> <% end %>
<%= t('headers.organization', "Organization") %> <%= t('headers.login', "Login") %>
<%= p.account.name %>
<%= t('links.add_account', "Add Account") %>
<% if @user.associated_root_accounts.any? { |a| a.feature_enabled?(:allow_opt_out_of_inbox) } %>

<%= t('headers.inbox_opt_out', "Conversations Inbox Opt-out" ) %>

<% end %> <% unless (@domain_root_account && @domain_root_account.service_enabled?(:none)) %>

<%= t('headers.web_services', "Web Services") %>

<%= t(:web_services, <<~TEXT) Canvas can make your life a lot easier by tying itself in with the web tools you already use. Click any of the services in "Other Services" to see what we mean. TEXT %>

/>

<%= t('headers.registered_services', "Registered Services") %>

<%= t(:no_registered_services, "No Registered Services") if @user.user_services.empty? %>

<%= t('headers.other_services', "Other Services") %>

<%= before_label(:other_services, "Click any service below to register") %> <% services = @user.user_services.map{|s| s.service} %>
  • "> <%= image_tag "google_drive_icon.png", :alt => '' %> <%= t('links.google_drive', "Google Drive") %>
  • "> <%= image_tag "skype_icon.png", :alt => '' %> <%= t('links.skype', "Skype") %>
  • "> <%= image_tag "diigo_icon.png", :alt => '' %> <%= t('links.diigo', "Diigo") %>
<% end %>

<%= before_label(:'headers.approved_integrations', "Approved Integrations") %>

<% if AccessToken.visible_tokens(@user.access_tokens).empty? %>
<%= t(:no_approved_integrations, <<~TEXT) Third-party applications can request permission to access the Canvas site on your behalf. As you begin authorizing applications you will see them listed here. TEXT %>
<% end %>
<%= t(:approved_integrations, <<~TEXT) These are the third-party applications you have authorized to access the Canvas site on your behalf: TEXT %> <% if @current_user&.account.feature_enabled?(:admin_manage_access_tokens) %> <% end %> <%= render :partial => "access_token", :collection => AccessToken.visible_tokens(@user.access_tokens) %> <%= render :partial => "access_token" %>
<%= t('headers.application_abbrev', "App") %><%= t('headers.state', "Status") %><%= t('headers.purpose', "Purpose") %> <%= t('headers.dates', "Dates") %> <%= t('headers.action', "Details") %> <%= t('headers.remove', "Remove") %>
<% allow_token_creation = @current_user.access_tokens.temp_record.grants_right?(logged_in_user, :create) %> <% prohibit_info_text = t("Your Canvas administrators have chosen to limit your ability to generate your own access token. Please reach out to your Canvas administrators to have them generate an access token on your behalf.") %>
> <%= t('buttons.new_access_token', "New Access Token") %>
<% else %> <% js_bundle :confirm_email %>

<%= t <<~TEXT, :email => @current_user.email, :wrapper => {'*' => '\1'} Before you can edit your profile, you need to verify your email address (%{email}) by clicking the link in the email we sent you. If you don't see it, *click to re-send the email*, and make sure to check your spam box. TEXT %>

<% end %>