2018-09-07 11:08:55 -04:00
- breadcrumb_title s_("Profiles|Edit Profile")
2017-06-22 10:47:50 -04:00
- @content_class = "limit-container-width" unless fluid_layout
2018-09-07 11:08:55 -04:00
- gravatar_link = link_to Gitlab.config.gravatar.host, 'https://' + Gitlab.config.gravatar.host
2016-06-28 14:17:29 -04:00
2019-02-01 11:24:11 -05:00
= bootstrap_form_for @user, url: profile_path, method: :put, html: { multipart: true, class: 'edit-user prepend-top-default js-quick-submit gl-show-field-errors' }, authenticity_token: true do |f|
2016-04-04 21:25:38 -04:00
= form_errors(@user)
2012-03-23 19:01:36 -04:00
.row
2017-06-22 10:47:50 -04:00
.col-lg-4.profile-settings-sidebar
2016-02-29 06:37:27 -05:00
%h4.prepend-top-0
2018-09-07 11:08:55 -04:00
= s_("Profiles|Public Avatar")
2016-02-29 06:37:27 -05:00
%p
- if @user.avatar?
2016-04-30 10:35:10 -04:00
- if gravatar_enabled?
2018-09-07 11:08:55 -04:00
= s_("Profiles|You can change your avatar here or remove the current avatar to revert to %{gravatar_link}").html_safe % { gravatar_link: gravatar_link }
- else
= s_("Profiles|You can change your avatar here")
2016-02-29 06:37:27 -05:00
- else
2016-04-30 10:35:10 -04:00
- if gravatar_enabled?
2018-09-07 11:08:55 -04:00
= s_("Profiles|You can upload your avatar here or change it at %{gravatar_link}").html_safe % { gravatar_link: gravatar_link }
- else
= s_("Profiles|You can upload your avatar here")
2017-06-22 10:47:50 -04:00
.col-lg-8
2016-02-29 06:37:27 -05:00
.clearfix.avatar-image.append-bottom-default
2018-02-09 05:43:12 -05:00
= link_to avatar_icon_for_user(@user, 400), target: '_blank', rel: 'noopener noreferrer' do
= image_tag avatar_icon_for_user(@user, 160), alt: '', class: 'avatar s160'
2018-09-07 11:08:55 -04:00
%h5.prepend-top-0= s_("Profiles|Upload new avatar")
2016-02-29 06:37:27 -05:00
.prepend-top-5.append-bottom-10
2018-09-07 11:08:55 -04:00
%button.btn.js-choose-user-avatar-button{ type: 'button' }= s_("Profiles|Choose file...")
%span.avatar-file-name.prepend-left-default.js-avatar-filename= s_("Profiles|No file chosen")
2017-04-28 11:33:23 -04:00
= f.file_field_without_bootstrap :avatar, class: 'js-user-avatar-input hidden', accept: 'image/*'
2018-09-07 11:08:55 -04:00
.form-text.text-muted= s_("Profiles|The maximum file size allowed is 200KB.")
2016-02-29 06:37:27 -05:00
- if @user.avatar?
%hr
2018-09-07 11:08:55 -04:00
= link_to s_("Profiles|Remove avatar"), profile_avatar_path, data: { confirm: s_("Profiles|Avatar will be removed. Are you sure?") }, method: :delete, class: 'btn btn-danger btn-inverted'
2018-07-24 10:16:09 -04:00
2018-07-31 04:21:53 -04:00
%hr
.row
.col-lg-4.profile-settings-sidebar
2018-09-07 11:08:55 -04:00
%h4.prepend-top-0= s_("Profiles|Current status")
2018-07-31 04:21:53 -04:00
%p= s_("Profiles|This emoji and message will appear on your profile and throughout the interface.")
.col-lg-8
= f.fields_for :status, @user.status do |status_form|
- emoji_button = button_tag type: :button,
class: 'js-toggle-emoji-menu emoji-menu-toggle-button btn has-tooltip',
title: s_("Profiles|Add status emoji") do
- if @user.status
= emoji_icon @user.status.emoji
%span#js-no-emoji-placeholder.no-emoji-placeholder{ class: ('hidden' if @user.status) }
= sprite_icon('emoji_slightly_smiling_face', css_class: 'award-control-icon-neutral')
= sprite_icon('emoji_smiley', css_class: 'award-control-icon-positive')
= sprite_icon('emoji_smile', css_class: 'award-control-icon-super-positive')
- reset_message_button = button_tag type: :button,
id: 'js-clear-user-status-button',
class: 'clear-user-status btn has-tooltip',
title: s_("Profiles|Clear status") do
= sprite_icon("close")
= status_form.hidden_field :emoji, id: 'js-status-emoji-field'
= status_form.text_field :message,
id: 'js-status-message-field',
class: 'form-control input-lg',
label: s_("Profiles|Your status"),
prepend: emoji_button,
append: reset_message_button,
placeholder: s_("Profiles|What's your status?")
2018-07-13 11:52:31 -04:00
%hr
2016-02-29 06:37:27 -05:00
.row
2017-06-22 10:47:50 -04:00
.col-lg-4.profile-settings-sidebar
2016-02-29 06:37:27 -05:00
%h4.prepend-top-0
2018-09-07 11:08:55 -04:00
= s_("Profiles|Main settings")
2016-02-29 06:37:27 -05:00
%p
2018-12-18 09:38:21 -05:00
= s_("Profiles|This information will appear on your profile")
2016-02-29 06:37:27 -05:00
- if current_user.ldap_user?
2018-09-07 11:08:55 -04:00
= s_("Profiles|Some options are unavailable for LDAP accounts")
2017-06-22 10:47:50 -04:00
.col-lg-8
2017-06-13 13:13:01 -04:00
.row
2017-08-29 04:57:41 -04:00
- if @user.read_only_attribute?(:name)
2019-02-01 11:24:11 -05:00
= f.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name' },
2018-12-18 09:38:21 -05:00
help: s_("Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you") % { provider_label: attribute_provider_label(:name) }
2017-08-29 04:57:41 -04:00
- else
2019-02-01 11:24:11 -05:00
= f.text_field :name, label: 'Full name', required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead"), wrapper: { class: 'col-md-9 qa-full-name' }, help: s_("Profiles|Enter your name, so people you know can recognize you")
2017-04-28 11:33:23 -04:00
= f.text_field :id, readonly: true, label: 'User ID', wrapper: { class: 'col-md-3' }
2017-06-13 13:13:01 -04:00
2017-08-29 04:57:41 -04:00
- if @user.read_only_attribute?(:email)
2018-12-18 09:38:21 -05:00
= f.text_field :email, required: true, class: 'input-lg', readonly: true, help: s_("Profiles|Your email address was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:email) }
2017-04-28 11:33:23 -04:00
- else
2018-12-18 09:38:21 -05:00
= f.text_field :email, required: true, class: 'input-lg', value: (@user.email unless @user.temp_oauth_email?),
2017-04-28 11:33:23 -04:00
help: user_email_help_text(@user)
= f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email),
2018-12-18 09:38:21 -05:00
{ help: s_("Profiles|This email will be displayed on your public profile"), include_blank: s_("Profiles|Do not show on profile") },
control_class: 'select2 input-lg'
2018-11-07 06:00:21 -05:00
- commit_email_docs_link = link_to s_('Profiles|Learn more'), help_page_path('user/profile/index', anchor: 'commit-email', target: '_blank')
= f.select :commit_email, options_for_select(commit_email_select_options(@user), selected: selected_commit_email(@user)),
{ help: s_("Profiles|This email will be used for web based operations, such as edits and merges. %{learn_more}").html_safe % { learn_more: commit_email_docs_link } },
2018-12-18 09:38:21 -05:00
control_class: 'select2 input-lg'
= f.text_field :skype, class: 'input-md', placeholder: s_("Profiles|username")
= f.text_field :linkedin, class: 'input-md', help: s_("Profiles|Your LinkedIn profile name from linkedin.com/in/profilename")
= f.text_field :twitter, class: 'input-md', placeholder: s_("Profiles|@username")
= f.text_field :website_url, class: 'input-lg', placeholder: s_("Profiles|website.com")
2017-08-29 04:57:41 -04:00
- if @user.read_only_attribute?(:location)
2018-12-18 09:38:21 -05:00
= f.text_field :location, readonly: true, help: s_("Profiles|Your location was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:location) }
2017-08-29 04:57:41 -04:00
- else
2018-12-18 09:38:21 -05:00
= f.text_field :location, class: 'input-lg', placeholder: s_("Profiles|City, country")
= f.text_field :organization, class: 'input-md', help: s_("Profiles|Who you represent or work for")
= f.text_area :bio, rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters")
2018-07-24 08:46:19 -04:00
%hr
2018-09-07 11:08:55 -04:00
%h5= ("Private profile")
2018-10-01 10:16:27 -04:00
.checkbox-icon-inline-wrapper
- private_profile_label = capture do
= s_("Profiles|Don't display activity-related personal information on your profiles")
= f.check_box :private_profile, label: private_profile_label
2018-07-24 08:46:19 -04:00
= link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'private-profile')
2018-09-07 11:08:55 -04:00
%h5= s_("Profiles|Private contributions")
= f.check_box :include_private_contributions, label: 'Include private contributions on my profile'
.help-block
2018-12-18 09:38:21 -05:00
= s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information")
2016-02-29 06:37:27 -05:00
.prepend-top-default.append-bottom-default
2018-09-07 11:08:55 -04:00
= f.submit s_("Profiles|Update profile settings"), class: 'btn btn-success'
= link_to _("Cancel"), user_path(current_user), class: 'btn btn-cancel'
2016-03-17 10:48:47 -04:00
.modal.modal-profile-crop
.modal-dialog
.modal-content
.modal-header
%h4.modal-title
2018-09-07 11:08:55 -04:00
= s_("Profiles|Position and size your new avatar")
%button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _("Close") }
2018-06-01 10:01:37 -04:00
%span{ "aria-hidden": true } ×
2016-03-17 10:48:47 -04:00
.modal-body
.profile-crop-image-container
2018-09-07 11:08:55 -04:00
%img.modal-profile-crop-image{ alt: s_("Profiles|Avatar cropper") }
2016-03-17 10:48:47 -04:00
.crop-controls
.btn-group
2017-04-28 11:33:23 -04:00
%button.btn.btn-primary{ data: { method: 'zoom', option: '0.1' } }
2016-03-17 10:48:47 -04:00
%span.fa.fa-search-plus
2017-04-28 11:33:23 -04:00
%button.btn.btn-primary{ data: { method: 'zoom', option: '-0.1' } }
2016-03-17 10:48:47 -04:00
%span.fa.fa-search-minus
.modal-footer
2017-04-28 11:33:23 -04:00
%button.btn.btn-primary.js-upload-user-avatar{ type: 'button' }
2018-09-07 11:08:55 -04:00
= s_("Profiles|Set new profile picture")