debian-mirror-gitlab/app/views/profiles/show.html.haml

147 lines
8 KiB
Text
Raw Normal View History

2018-11-20 20:47:30 +05:30
- breadcrumb_title s_("Profiles|Edit Profile")
2020-07-28 23:09:34 +05:30
- page_title s_("Profiles|Edit Profile")
2017-09-10 17:25:29 +05:30
- @content_class = "limit-container-width" unless fluid_layout
2018-11-20 20:47:30 +05:30
- gravatar_link = link_to Gitlab.config.gravatar.host, 'https://' + Gitlab.config.gravatar.host
2016-08-24 12:49:21 +05:30
2020-07-28 23:09:34 +05:30
= 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' }, authenticity_token: true do |f|
2016-06-02 11:05:42 +05:30
= form_errors(@user)
2014-09-02 18:07:02 +05:30
.row
2017-09-10 17:25:29 +05:30
.col-lg-4.profile-settings-sidebar
2020-06-23 00:09:42 +05:30
%h4.gl-mt-0
2018-11-20 20:47:30 +05:30
= s_("Profiles|Public Avatar")
2016-06-02 11:05:42 +05:30
%p
- if @user.avatar?
- if gravatar_enabled?
2018-11-20 20:47:30 +05:30
= 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-06-02 11:05:42 +05:30
- else
- if gravatar_enabled?
2018-11-20 20:47:30 +05:30
= 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-05-24 23:13:21 +05:30
- if current_appearance&.profile_image_guidelines?
.md
= brand_profile_image_guidelines
2017-09-10 17:25:29 +05:30
.col-lg-8
2020-07-28 23:09:34 +05:30
.clearfix.avatar-image.gl-mb-3
2018-03-27 19:54:05 +05:30
= 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'
2020-06-23 00:09:42 +05:30
%h5.gl-mt-0= s_("Profiles|Upload new avatar")
2020-10-24 23:57:45 +05:30
.gl-mt-2.gl-mb-3
2018-11-20 20:47:30 +05:30
%button.btn.js-choose-user-avatar-button{ type: 'button' }= s_("Profiles|Choose file...")
2020-07-28 23:09:34 +05:30
%span.avatar-file-name.gl-ml-3.js-avatar-filename= s_("Profiles|No file chosen")
2017-09-10 17:25:29 +05:30
= f.file_field_without_bootstrap :avatar, class: 'js-user-avatar-input hidden', accept: 'image/*'
2018-11-20 20:47:30 +05:30
.form-text.text-muted= s_("Profiles|The maximum file size allowed is 200KB.")
2016-06-02 11:05:42 +05:30
- if @user.avatar?
%hr
2021-01-03 14:25:43 +05:30
= 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 btn-inverted'
2018-11-18 11:00:15 +05:30
%hr
.row
.col-lg-4.profile-settings-sidebar
2020-06-23 00:09:42 +05:30
%h4.gl-mt-0= s_("Profiles|Current status")
2018-11-18 11:00:15 +05:30
%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-01-03 14:25:43 +05:30
class: 'js-toggle-emoji-menu emoji-menu-toggle-button gl-button btn has-tooltip',
2018-11-18 11:00:15 +05:30
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) }
2019-09-04 21:01:54 +05:30
= 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-11-18 11:00:15 +05:30
- reset_message_button = button_tag type: :button,
id: 'js-clear-user-status-button',
2021-01-03 14:25:43 +05:30
class: 'clear-user-status gl-button btn has-tooltip',
2018-11-18 11:00:15 +05:30
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?")
2019-07-31 22:56:46 +05:30
- if Feature.enabled?(:user_time_settings)
%hr
.row.user-time-preferences
.col-lg-4.profile-settings-sidebar
2020-06-23 00:09:42 +05:30
%h4.gl-mt-0= s_("Profiles|Time settings")
2019-07-31 22:56:46 +05:30
%p= s_("Profiles|You can set your current timezone here")
.col-lg-8
-# TODO: might need an entry in user/profile.md to describe some of these settings
2019-12-04 20:38:33 +05:30
-# https://gitlab.com/gitlab-org/gitlab-foss/issues/60070
2019-07-31 22:56:46 +05:30
%h5= ("Time zone")
2021-01-03 14:25:43 +05:30
= dropdown_tag(_("Select a timezone"), options: { toggle_class: 'gl-button btn js-timezone-dropdown input-lg', title: _("Select a timezone"), filter: true, placeholder: s_("OfSearchInADropdown|Filter"), data: { data: timezone_data } } )
2019-07-31 22:56:46 +05:30
%input.hidden{ :type => 'hidden', :id => 'user_timezone', :name => 'user[timezone]', value: @user.timezone }
2018-11-18 11:00:15 +05:30
2016-06-02 11:05:42 +05:30
%hr
.row
2017-09-10 17:25:29 +05:30
.col-lg-4.profile-settings-sidebar
2020-06-23 00:09:42 +05:30
%h4.gl-mt-0
2018-11-20 20:47:30 +05:30
= s_("Profiles|Main settings")
2016-06-02 11:05:42 +05:30
%p
2019-02-15 15:39:39 +05:30
= s_("Profiles|This information will appear on your profile")
2016-06-02 11:05:42 +05:30
- if current_user.ldap_user?
2018-11-20 20:47:30 +05:30
= s_("Profiles|Some options are unavailable for LDAP accounts")
2017-09-10 17:25:29 +05:30
.col-lg-8
.row
2020-03-13 15:44:24 +05:30
= render 'profiles/name', form: f, user: @user
2019-09-04 21:01:54 +05:30
= f.text_field :id, readonly: true, label: s_('Profiles|User ID'), wrapper: { class: 'col-md-3' }
2014-09-02 18:07:02 +05:30
2019-07-07 11:18:12 +05:30
= render_if_exists 'profiles/email_settings', form: f
2019-02-15 15:39:39 +05:30
= 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")
2018-03-17 18:26:18 +05:30
- if @user.read_only_attribute?(:location)
2019-02-15 15:39:39 +05:30
= 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) }
2018-03-17 18:26:18 +05:30
- else
2019-09-04 21:01:54 +05:30
= f.text_field :location, label: s_('Profiles|Location'), class: 'input-lg', placeholder: s_("Profiles|City, country")
2020-04-08 14:13:33 +05:30
= f.text_field :job_title, class: 'input-md'
2020-05-24 23:13:21 +05:30
= f.text_field :organization, label: s_('Profiles|Organization'), class: 'input-md', help: s_("Profiles|Who you represent or work for")
2019-09-04 21:01:54 +05:30
= f.text_area :bio, label: s_('Profiles|Bio'), rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters")
2018-11-18 11:00:15 +05:30
%hr
2019-09-04 21:01:54 +05:30
%h5= s_("Private profile")
2018-12-05 23:21:45 +05:30
.checkbox-icon-inline-wrapper
- private_profile_label = capture do
= s_("Profiles|Don't display activity-related personal information on your profiles")
2019-07-07 11:18:12 +05:30
= f.check_box :private_profile, label: private_profile_label, inline: true, wrapper_class: 'mr-0'
2020-11-24 15:15:51 +05:30
= link_to sprite_icon('question-o'), help_page_path('user/profile/index.md', anchor: 'private-profile')
2018-11-20 20:47:30 +05:30
%h5= s_("Profiles|Private contributions")
2019-09-04 21:01:54 +05:30
= f.check_box :include_private_contributions, label: s_('Profiles|Include private contributions on my profile'), wrapper_class: 'mb-2', inline: true
2018-11-20 20:47:30 +05:30
.help-block
2019-02-15 15:39:39 +05:30
= s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information")
2020-07-28 23:09:34 +05:30
.gl-mt-3.gl-mb-3
2021-01-03 14:25:43 +05:30
= f.submit s_("Profiles|Update profile settings"), class: 'gl-button btn btn-success'
= link_to _("Cancel"), user_path(current_user), class: 'gl-button btn btn-cancel'
2014-09-02 18:07:02 +05:30
2021-01-03 14:25:43 +05:30
.modal.modal-profile-crop{ data: { cropper_css_path: ActionController::Base.helpers.stylesheet_path('lazy_bundles/cropper.css') } }
2016-06-02 11:05:42 +05:30
.modal-dialog
.modal-content
.modal-header
%h4.modal-title
2018-11-20 20:47:30 +05:30
= s_("Profiles|Position and size your new avatar")
%button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _("Close") }
2018-11-08 19:23:39 +05:30
%span{ "aria-hidden": true } ×
2016-06-02 11:05:42 +05:30
.modal-body
.profile-crop-image-container
2018-11-20 20:47:30 +05:30
%img.modal-profile-crop-image{ alt: s_("Profiles|Avatar cropper") }
2016-06-02 11:05:42 +05:30
.crop-controls
.btn-group
2017-09-10 17:25:29 +05:30
%button.btn.btn-primary{ data: { method: 'zoom', option: '-0.1' } }
2020-11-24 15:15:51 +05:30
%span
= sprite_icon('search-minus')
%button.btn.btn-primary{ data: { method: 'zoom', option: '0.1' } }
%span
= sprite_icon('search-plus')
2016-06-02 11:05:42 +05:30
.modal-footer
2017-09-10 17:25:29 +05:30
%button.btn.btn-primary.js-upload-user-avatar{ type: 'button' }
2018-11-20 20:47:30 +05:30
= s_("Profiles|Set new profile picture")