2018-09-07 15:08:55 +00:00
- breadcrumb_title s_("Profiles|Edit Profile")
2020-06-22 12:08:47 +00:00
- page_title s_("Profiles|Edit Profile")
2017-06-22 14:47:50 +00:00
- @content_class = "limit-container-width" unless fluid_layout
2018-09-07 15:08:55 +00:00
- gravatar_link = link_to Gitlab.config.gravatar.host, 'https://' + Gitlab.config.gravatar.host
2020-11-17 15:09:28 +00:00
- availability = availability_values
- custom_emoji = show_status_emoji?(@user.status)
2016-06-28 18:17:29 +00:00
2021-09-29 12:11:22 +00:00
= bootstrap_form_for @user, url: profile_path, method: :put, html: { multipart: true, class: 'edit-user gl-mt-3 js-quick-submit gl-show-field-errors js-password-prompt-form', remote: true }, authenticity_token: true do |f|
2016-04-05 01:25:38 +00:00
= form_errors(@user)
2021-02-02 21:09:04 +00:00
.row.js-search-settings-section
2017-06-22 14:47:50 +00:00
.col-lg-4.profile-settings-sidebar
2020-05-21 18:08:27 +00:00
%h4.gl-mt-0
2021-05-19 18:10:39 +00:00
= s_("Profiles|Public avatar")
2016-02-29 11:37:27 +00:00
%p
- if @user.avatar?
2016-04-30 14:35:10 +00:00
- if gravatar_enabled?
2018-09-07 15:08:55 +00: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 11:37:27 +00:00
- else
2016-04-30 14:35:10 +00:00
- if gravatar_enabled?
2018-09-07 15:08:55 +00: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")
2020-04-28 15:09:29 +00:00
- if current_appearance&.profile_image_guidelines?
.md
= brand_profile_image_guidelines
2017-06-22 14:47:50 +00:00
.col-lg-8
2021-05-19 18:10:39 +00:00
.avatar-image
2018-02-09 10:43:12 +00:00
= link_to avatar_icon_for_user(@user, 400), target: '_blank', rel: 'noopener noreferrer' do
2021-05-19 18:10:39 +00:00
= image_tag avatar_icon_for_user(@user, 96), alt: '', class: 'avatar s96'
2020-05-21 18:08:27 +00:00
%h5.gl-mt-0= s_("Profiles|Upload new avatar")
2021-05-19 18:10:39 +00:00
.gl-my-3
%button.gl-button.btn.btn-default.js-choose-user-avatar-button{ type: 'button' }= s_("Profiles|Choose file...")
2021-03-17 18:09:01 +00:00
%span.avatar-file-name.gl-ml-3.js-avatar-filename= s_("Profiles|No file chosen.")
2017-04-28 15:33:23 +00:00
= f.file_field_without_bootstrap :avatar, class: 'js-user-avatar-input hidden', accept: 'image/*'
2021-05-19 18:10:39 +00:00
.gl-text-gray-500= s_("Profiles|The maximum file size allowed is 200KB.")
2016-02-29 11:37:27 +00:00
- if @user.avatar?
2021-05-19 18:10:39 +00:00
= link_to s_("Profiles|Remove avatar"), profile_avatar_path, data: { confirm: s_("Profiles|Avatar will be removed. Are you sure?") }, method: :delete, class: 'gl-button btn btn-danger-secondary btn-sm gl-mt-5'
2021-02-02 21:09:04 +00:00
.col-lg-12
%hr
.row.js-search-settings-section
2018-07-31 08:21:53 +00:00
.col-lg-4.profile-settings-sidebar
2020-05-21 18:08:27 +00:00
%h4.gl-mt-0= s_("Profiles|Current status")
2018-07-31 08:21:53 +00: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,
2021-02-18 21:10:43 +00:00
class: 'js-toggle-emoji-menu emoji-menu-toggle-button btn gl-button btn-default has-tooltip',
2018-07-31 08:21:53 +00:00
title: s_("Profiles|Add status emoji") do
2020-11-17 15:09:28 +00:00
- if custom_emoji
2021-02-18 21:10:43 +00:00
= emoji_icon(@user.status.emoji, class: 'gl-mr-0!')
2020-11-17 15:09:28 +00:00
%span#js-no-emoji-placeholder.no-emoji-placeholder{ class: ('hidden' if custom_emoji) }
2019-05-23 12:29:32 +00:00
= sprite_icon('slight-smile', css_class: 'award-control-icon-neutral')
= sprite_icon('smiley', css_class: 'award-control-icon-positive')
= sprite_icon('smile', css_class: 'award-control-icon-super-positive')
2018-07-31 08:21:53 +00:00
- reset_message_button = button_tag type: :button,
id: 'js-clear-user-status-button',
2021-02-18 21:10:43 +00:00
class: 'clear-user-status btn gl-button btn-default has-tooltip',
2018-07-31 08:21:53 +00:00
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',
2021-02-11 12:08:52 +00:00
class: 'form-control gl-form-input input-lg',
2018-07-31 08:21:53 +00:00
label: s_("Profiles|Your status"),
prepend: emoji_button,
append: reset_message_button,
placeholder: s_("Profiles|What's your status?")
2021-04-28 09:10:13 +00:00
.checkbox-icon-inline-wrapper
= status_form.check_box :availability, { data: { testid: "user-availability-checkbox" }, label: s_("Profiles|Busy"), wrapper_class: 'gl-mr-0 gl-font-weight-bold' }, availability["busy"], availability["not_set"]
2021-10-25 18:12:16 +00:00
.gl-text-gray-600.gl-ml-5= s_('Profiles|An indicator appears next to your name and avatar')
2021-07-07 06:08:23 +00:00
.col-lg-12
%hr
2021-02-02 21:09:04 +00:00
.row.user-time-preferences.js-search-settings-section
.col-lg-4.profile-settings-sidebar
%h4.gl-mt-0= s_("Profiles|Time settings")
2021-08-04 03:09:14 +00:00
%p= s_("Profiles|Set your local time zone")
2021-02-02 21:09:04 +00:00
.col-lg-8
2021-04-09 09:09:10 +00:00
%h5= _("Time zone")
2021-10-01 15:12:53 +00:00
= dropdown_tag(_("Select a time zone"), options: { toggle_class: 'gl-button btn js-timezone-dropdown input-lg gl-w-full!', title: _("Select a time zone"), filter: true, placeholder: s_("OfSearchInADropdown|Filter"), data: { data: timezone_data } } )
2021-02-02 21:09:04 +00:00
%input.hidden{ :type => 'hidden', :id => 'user_timezone', :name => 'user[timezone]', value: @user.timezone }
.col-lg-12
%hr
.row.js-search-settings-section
2017-06-22 14:47:50 +00:00
.col-lg-4.profile-settings-sidebar
2020-05-21 18:08:27 +00:00
%h4.gl-mt-0
2018-09-07 15:08:55 +00:00
= s_("Profiles|Main settings")
2016-02-29 11:37:27 +00:00
%p
2018-12-18 14:38:21 +00:00
= s_("Profiles|This information will appear on your profile")
2016-02-29 11:37:27 +00:00
- if current_user.ldap_user?
2018-09-07 15:08:55 +00:00
= s_("Profiles|Some options are unavailable for LDAP accounts")
2017-06-22 14:47:50 +00:00
.col-lg-8
2017-06-13 17:13:01 +00:00
.row
2020-01-13 06:08:10 +00:00
= render 'profiles/name', form: f, user: @user
2021-02-11 12:08:52 +00:00
= f.text_field :id, class: 'gl-form-input', readonly: true, label: s_('Profiles|User ID'), wrapper: { class: 'col-md-3' }
2017-06-13 17:13:01 +00:00
2021-12-31 12:12:14 +00:00
= f.text_field :pronouns, label: s_('Profiles|Pronouns'), class: 'input-md gl-form-input', help: s_("Profiles|Enter your pronouns to let people know how to refer to you")
= f.text_field :pronunciation, label: s_('Profiles|Pronunciation'), class: 'input-md gl-form-input', help: s_("Profiles|Enter how your name is pronounced to help people address you correctly")
2021-09-17 12:12:06 +00:00
= render_if_exists 'profiles/extra_settings', form: f
2019-03-20 10:36:22 +00:00
= render_if_exists 'profiles/email_settings', form: f
2021-02-11 12:08:52 +00:00
= f.text_field :skype, class: 'input-md gl-form-input', placeholder: s_("Profiles|username")
= f.text_field :linkedin, class: 'input-md gl-form-input', help: s_("Profiles|Your LinkedIn profile name from linkedin.com/in/profilename")
= f.text_field :twitter, class: 'input-md gl-form-input', placeholder: s_("Profiles|@username")
2021-12-31 12:12:14 +00:00
= f.text_field :website_url, label: s_('Profiles|Website url'), class: 'input-lg gl-form-input', placeholder: s_("Profiles|https://website.com")
2017-08-29 08:57:41 +00:00
- if @user.read_only_attribute?(:location)
2021-02-11 12:08:52 +00:00
= f.text_field :location, class: 'gl-form-input', 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 08:57:41 +00:00
- else
2021-02-11 12:08:52 +00:00
= f.text_field :location, label: s_('Profiles|Location'), class: 'input-lg gl-form-input', placeholder: s_("Profiles|City, country")
2021-12-31 12:12:14 +00:00
= f.text_field :job_title, label: s_('Profiles|Job title'), class: 'input-md gl-form-input'
2021-02-11 12:08:52 +00:00
= f.text_field :organization, label: s_('Profiles|Organization'), class: 'input-md gl-form-input', help: s_("Profiles|Who you represent or work for")
= f.text_area :bio, class: 'gl-form-input', label: s_('Profiles|Bio'), rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters")
2018-07-24 12:46:19 +00:00
%hr
2021-08-30 12:09:48 +00:00
%h5= _('Private profile')
2018-10-01 14:16:27 +00:00
.checkbox-icon-inline-wrapper
- private_profile_label = capture do
2021-11-25 15:09:54 +00:00
= s_("Profiles|Don't display activity-related personal information on your profile")
2019-03-25 20:23:50 +00:00
= f.check_box :private_profile, label: private_profile_label, inline: true, wrapper_class: 'mr-0'
2021-03-12 21:09:12 +00:00
= link_to sprite_icon('question-o'), help_page_path('user/profile/index.md', anchor: 'make-your-user-profile-page-private')
2018-09-07 15:08:55 +00:00
%h5= s_("Profiles|Private contributions")
2019-05-09 08:39:08 +00:00
= f.check_box :include_private_contributions, label: s_('Profiles|Include private contributions on my profile'), wrapper_class: 'mb-2', inline: true
2018-09-07 15:08:55 +00:00
.help-block
2018-12-18 14:38:21 +00:00
= s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information")
2021-08-18 15:11:07 +00:00
%hr
2021-09-29 12:11:22 +00:00
= f.submit s_("Profiles|Update profile settings"), class: 'gl-button btn btn-confirm gl-mr-3 js-password-prompt-btn'
2021-08-18 15:11:07 +00:00
= link_to _("Cancel"), user_path(current_user), class: 'gl-button btn btn-default btn-cancel'
2016-03-17 14:48:47 +00:00
2021-09-29 12:11:22 +00:00
#password-prompt-modal
2020-10-05 12:08:47 +00:00
.modal.modal-profile-crop{ data: { cropper_css_path: ActionController::Base.helpers.stylesheet_path('lazy_bundles/cropper.css') } }
2016-03-17 14:48:47 +00:00
.modal-dialog
.modal-content
.modal-header
%h4.modal-title
2018-09-07 15:08:55 +00:00
= s_("Profiles|Position and size your new avatar")
%button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _("Close") }
2021-05-27 21:10:59 +00:00
%span{ "aria-hidden": "true" } ×
2016-03-17 14:48:47 +00:00
.modal-body
.profile-crop-image-container
2018-09-07 15:08:55 +00:00
%img.modal-profile-crop-image{ alt: s_("Profiles|Avatar cropper") }
2016-03-17 14:48:47 +00:00
.crop-controls
.btn-group
2022-01-10 12:15:34 +00:00
%button.btn.gl-button.btn-default{ data: { method: 'zoom', option: '-0.1' } }
2020-08-31 12:10:39 +00:00
%span
= sprite_icon('search-minus')
2022-01-10 12:15:34 +00:00
%button.btn.gl-button.btn-default{ data: { method: 'zoom', option: '0.1' } }
2020-08-31 12:10:39 +00:00
%span
= sprite_icon('search-plus')
2016-03-17 14:48:47 +00:00
.modal-footer
2021-01-27 21:09:12 +00:00
%button.btn.gl-button.btn-confirm.js-upload-user-avatar{ type: 'button' }
2018-09-07 15:08:55 +00:00
= s_("Profiles|Set new profile picture")