show.html.haml 6.67 KB
Newer Older
1
- breadcrumb_title "Edit Profile"
2
- @content_class = "limit-container-width" unless fluid_layout
3

4
= bootstrap_form_for @user, url: profile_path, method: :put, html: { multipart: true, class: 'edit-user prepend-top-default js-quick-submit' }, authenticity_token: true do |f|
5 6
  = form_errors(@user)

7
  .row
8
    .col-lg-4.profile-settings-sidebar
Phil Hughes's avatar
Phil Hughes committed
9 10 11 12 13
      %h4.prepend-top-0
        Public Avatar
      %p
        - if @user.avatar?
          You can change your avatar here
14
          - if gravatar_enabled?
15
            or remove the current avatar to revert to #{link_to Gitlab.config.gravatar.host, 'https://' + Gitlab.config.gravatar.host}
Phil Hughes's avatar
Phil Hughes committed
16 17
        - else
          You can upload an avatar here
18
          - if gravatar_enabled?
19
            or change it at #{link_to Gitlab.config.gravatar.host, 'https://' + Gitlab.config.gravatar.host}
20
    .col-lg-8
Phil Hughes's avatar
Phil Hughes committed
21
      .clearfix.avatar-image.append-bottom-default
22 23
        = 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'
24
      %h5.prepend-top-0= _("Upload new avatar")
Phil Hughes's avatar
Phil Hughes committed
25
      .prepend-top-5.append-bottom-10
26 27
        %button.btn.js-choose-user-avatar-button{ type: 'button' }= _("Choose file...")
        %span.avatar-file-name.prepend-left-default.js-avatar-filename= _("No file chosen")
28
        = f.file_field_without_bootstrap :avatar, class: 'js-user-avatar-input hidden', accept: 'image/*'
29
      .form-text.text-muted= _("The maximum file size allowed is 200KB.")
Phil Hughes's avatar
Phil Hughes committed
30 31
      - if @user.avatar?
        %hr
32
        = link_to _('Remove avatar'), profile_avatar_path, data: { confirm: _('Avatar will be removed. Are you sure?') }, method: :delete, class: 'btn btn-danger btn-inverted'
33

34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
  %hr
  .row
    .col-lg-4.profile-settings-sidebar
      %h4.prepend-top-0= s_("User|Current status")
      %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?")

65
  %hr
Phil Hughes's avatar
Phil Hughes committed
66
  .row
67
    .col-lg-4.profile-settings-sidebar
Phil Hughes's avatar
Phil Hughes committed
68 69 70 71 72 73
      %h4.prepend-top-0
        Main settings
      %p
        This information will appear on your profile.
        - if current_user.ldap_user?
          Some options are unavailable for LDAP accounts
74
    .col-lg-8
75
      .row
76 77 78 79 80
        - if @user.read_only_attribute?(:name)
          = f.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9' },
          help: "Your name was automatically set based on your #{ attribute_provider_label(:name) } account, so people you know can recognize you."
        - else
          = f.text_field :name, required: true, wrapper: { class: 'col-md-9' }, help: "Enter your name, so people you know can recognize you."
81
        = f.text_field :id, readonly: true, label: 'User ID', wrapper: { class: 'col-md-3' }
82

83 84
      - if @user.read_only_attribute?(:email)
        = f.text_field :email, required: true, readonly: true, help: "Your email address was automatically set based on your #{ attribute_provider_label(:email) } account."
85 86 87 88 89 90 91 92 93 94 95 96 97
      - else
        = f.text_field :email, required: true, value: (@user.email unless @user.temp_oauth_email?),
          help: user_email_help_text(@user)
      = f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email),
        { help: 'This email will be displayed on your public profile.', include_blank: 'Do not show on profile' },
        control_class: 'select2'
      = f.select :preferred_language, Gitlab::I18n::AVAILABLE_LANGUAGES.map { |value, label| [label, value] },
        { help: 'This feature is experimental and translations are not complete yet.' },
        control_class: 'select2'
      = f.text_field :skype
      = f.text_field :linkedin
      = f.text_field :twitter
      = f.text_field :website_url, label: 'Website'
98 99 100 101
      - if @user.read_only_attribute?(:location)
        = f.text_field :location, readonly: true, help: "Your location was automatically set based on your #{ attribute_provider_label(:location) } account."
      - else
        = f.text_field :location
102 103
      = f.text_field :organization
      = f.text_area :bio, rows: 4, maxlength: 250, help: 'Tell us about yourself in fewer than 250 characters.'
104 105 106 107 108 109
      %hr
      %h5 Private profile
      - private_profile_label = capture do
        Don't display activity-related personal information on your profile
        = link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'private-profile')
      = f.check_box :private_profile, label: private_profile_label
Phil Hughes's avatar
Phil Hughes committed
110
      .prepend-top-default.append-bottom-default
111 112
        = f.submit 'Update profile settings', class: 'btn btn-success'
        = link_to 'Cancel', user_path(current_user), class: 'btn btn-cancel'
Alfredo Sumaran's avatar
Alfredo Sumaran committed
113 114 115 116 117 118 119

.modal.modal-profile-crop
  .modal-dialog
    .modal-content
      .modal-header
        %h4.modal-title
          Position and size your new avatar
120 121
        %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') }
          %span{ "aria-hidden": true } ×
Alfredo Sumaran's avatar
Alfredo Sumaran committed
122 123
      .modal-body
        .profile-crop-image-container
124
          %img.modal-profile-crop-image{ alt: 'Avatar cropper' }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
125 126
        .crop-controls
          .btn-group
127
            %button.btn.btn-primary{ data: { method: 'zoom', option: '0.1' } }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
128
              %span.fa.fa-search-plus
129
            %button.btn.btn-primary{ data: { method: 'zoom', option: '-0.1' } }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
130 131
              %span.fa.fa-search-minus
      .modal-footer
132
        %button.btn.btn-primary.js-upload-user-avatar{ type: 'button' }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
133
          Set new profile picture