%
# 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" %>
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.") %>
<%# 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] %>
<%= 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") %>
<% end %>
<% active_email_channels = @email_channels.select { |cc| cc.active? } %>
<% if active_email_channels.length > 1 %>
<% 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(:google_drive_description, <<~TEXT)
Once you authorize us to see your Google Drive you'll be able to submit your assignments
directly from Google Drive, and create and share documents with members of your classes.
TEXT
%>
<%= t('headers.share_skype_id', "Share your Skype ID") %>
<%= t(:skype_description, <<~TEXT)
Skype offers free online voice and video calls. Lots of students use
Skype as a free, easy way to communicate. If you register your Skype Name
and enable visibility, then other students can easily find your contact
and call or add you using Skype.
TEXT
%>
<%= t(:diigo_description, <<~TEXT)
Diigo is a social bookmarking tool tailored specifically to research and
education.
Canvas's rich content editor will let you search your Diigo tags
to easily link from within Canvas to other resources you find useful.
TEXT
%>
<% 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
%>
<%= t('headers.application_abbrev', "App") %>
<% if @current_user&.account.feature_enabled?(:admin_manage_access_tokens) %>
<% 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(<<~TEXT, :wrapper => '\1')
Access tokens can be used to allow other applications to make API calls
on your behalf. You can also generate access tokens and *use the Canvas
Open API* to come up with your own integrations.
TEXT
%>
<%= mt(:full_token_warning, <<~TEXT)
**Copy this token down now**. Once you leave this page you won't be able to
retrieve the full token anymore, you'll have to regenerate it to get a new
value.
TEXT
%>
<%= t('headers.generate_access_token', "Generate an Access Token") %>
<%= mt(:generate_access_token_description, <<~TEXT, :documentation_url => 'https://canvas.instructure.com/doc/api/index.html')
Access tokens are what allow third-party applications to access Canvas
resources on your behalf. These tokens are normally created automatically for
applications as needed, but if [you're developing a new or limited
project](%{documentation_url}) you can just generate the token from here.
TEXT
%>
<%= form_for :token, :url => api_v1_tokens_url("self"), :html => {:id => "access_token_form", :style => "margin-top: 10px;"} do |f| %>
<%= t('links.upload_new_image', "Upload a new Image") %>
<%= form_for :attachment, :url => context_url(@user, :context_files_url, :format => 'json'), :html => {:id => "add_pic_form", :style => "display: none;"} do |f| %>
<%= f.file_field :uploaded_data %>
<% end %>
<% 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
%>