show.html.haml 5.1 KB
Newer Older
1
.alert.alert-help.prepend-top-default
2
  This information will appear on your profile.
D
Dmitriy Zaporozhets 已提交
3 4 5
  - if current_user.ldap_user?
    Some options are unavailable for LDAP accounts

6
.prepend-top-default
7
= form_for @user, url: profile_path, method: :put, html: { multipart: true, class: "edit_user form-horizontal" }, authenticity_token: true do |f|
8
  -if @user.errors.any?
D
Dmitriy Zaporozhets 已提交
9
    %div.alert.alert-danger
10 11 12
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg
13
  .row
D
Dmitriy Zaporozhets 已提交
14
    .col-md-7
D
Dmitriy Zaporozhets 已提交
15
      .form-group
16
        = f.label :name, class: "control-label"
D
Dmitriy Zaporozhets 已提交
17
        .col-sm-10
D
Dmitriy Zaporozhets 已提交
18
          = f.text_field :name, class: "form-control", required: true
19
          %span.help-block Enter your name, so people you know can recognize you.
20

D
Dmitriy Zaporozhets 已提交
21
      .form-group
22
        = f.label :email, class: "control-label"
D
Dmitriy Zaporozhets 已提交
23
        .col-sm-10
24
          - if @user.ldap_user? && @user.ldap_email?
D
Dmitriy Zaporozhets 已提交
25
            = f.text_field :email, class: "form-control", required: true, readonly: true
26
            %span.help-block.light
27
              Your email address was automatically set based on the LDAP server.
28
          - else
29 30 31 32
            - if @user.temp_oauth_email?
              = f.text_field :email, class: "form-control", required: true, value: nil
            - else
              = f.text_field :email, class: "form-control", required: true
33 34
            - if @user.unconfirmed_email.present?
              %span.help-block
35 36 37 38 39
                Please click the link in the confirmation email before continuing. It was sent to
                = succeed "." do
                  %strong #{@user.unconfirmed_email}
                %p
                = link_to "Resend confirmation e-mail", user_confirmation_path(user: { email: @user.unconfirmed_email }), method: :post
D
dosire 已提交
40

41 42
            - else
              %span.help-block We also use email for avatar detection if no avatar is uploaded.
43 44 45
      .form-group
        = f.label :public_email, class: "control-label"
        .col-sm-10
46
          = f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email), {include_blank: 'Do not show on profile'}, class: "select2"
47
          %span.help-block This email will be displayed on your public profile.
D
Dmitriy Zaporozhets 已提交
48
      .form-group
49
        = f.label :skype, class: "control-label"
D
Dmitriy Zaporozhets 已提交
50
        .col-sm-10= f.text_field :skype, class: "form-control"
D
Dmitriy Zaporozhets 已提交
51
      .form-group
52
        = f.label :linkedin, class: "control-label"
D
Dmitriy Zaporozhets 已提交
53
        .col-sm-10= f.text_field :linkedin, class: "form-control"
D
Dmitriy Zaporozhets 已提交
54
      .form-group
55
        = f.label :twitter, class: "control-label"
D
Dmitriy Zaporozhets 已提交
56
        .col-sm-10= f.text_field :twitter, class: "form-control"
J
Jerome Dalbert 已提交
57
      .form-group
58
        = f.label :website_url, 'Website', class: "control-label"
J
Jerome Dalbert 已提交
59
        .col-sm-10= f.text_field :website_url, class: "form-control"
60 61 62
      .form-group
        = f.label :location, 'Location', class: "control-label"
        .col-sm-10= f.text_field :location, class: "form-control"
D
Dmitriy Zaporozhets 已提交
63
      .form-group
D
Dmitriy Zaporozhets 已提交
64
        = f.label :bio, class: "control-label"
D
Dmitriy Zaporozhets 已提交
65
        .col-sm-10
66
          = f.text_area :bio, rows: 4, class: "form-control", maxlength: 250
D
Dmitriy Zaporozhets 已提交
67 68
          %span.help-block Tell us about yourself in fewer than 250 characters.

D
Dmitriy Zaporozhets 已提交
69
    .col-md-5
D
Dmitriy Zaporozhets 已提交
70
      .light-well
71
        = image_tag avatar_icon(@user, 160), alt: '', class: 'avatar s160'
D
Dmitriy Zaporozhets 已提交
72 73

        .clearfix
S
Steven Thonus 已提交
74
          .profile-avatar-form-option
D
Dmitriy Zaporozhets 已提交
75
            %p.light
76 77
              - if @user.avatar?
                You can change your avatar here
78 79
                - if Gitlab.config.gravatar.enabled
                  %br
80
                  or remove the current avatar to revert to #{link_to Gitlab.config.gravatar.host, "http://" + Gitlab.config.gravatar.host}
81 82
              - else
                You can upload an avatar here
83 84
                - if Gitlab.config.gravatar.enabled
                  %br
85
                  or change it at #{link_to Gitlab.config.gravatar.host, "http://" + Gitlab.config.gravatar.host}
D
Dmitriy Zaporozhets 已提交
86
            %hr
D
Dmitriy Zaporozhets 已提交
87
            %a.choose-btn.btn.btn-sm.js-choose-user-avatar-button
S
Sullivan SENECHAL 已提交
88
              %i.fa.fa-paperclip
S
Steven Thonus 已提交
89 90
              %span Choose File ...
             
91
            %span.file_name.js-avatar-filename File name...
D
Dmitriy Zaporozhets 已提交
92
            = f.file_field :avatar, class: "js-user-avatar-input hidden"
93 94 95
            = f.hidden_field :avatar_crop_x
            = f.hidden_field :avatar_crop_y
            = f.hidden_field :avatar_crop_size
96
            .light The maximum file size allowed is 200KB.
97 98
            - if @user.avatar?
              %hr
D
Dmitriy Zaporozhets 已提交
99
              = link_to 'Remove avatar', profile_avatar_path, data: { confirm: "Avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
100

101

102 103 104
  .form-actions
    = f.submit 'Save changes', class: "btn btn-success"
    = link_to "Cancel", user_path(current_user), class: "btn btn-cancel"
105 106 107 108 109

.modal.modal-profile-crop
  .modal-dialog
    .modal-content
      .modal-header
110
        %button.close{type: 'button', data: {dismiss: 'modal'}}
111 112 113 114 115 116 117 118 119 120
          %span
            ×
        %h4.modal-title
          Crop your new profile picture
      .modal-body
        %p
          %img.modal-profile-crop-image
      .modal-footer
        %button.btn.btn-primary.js-upload-user-avatar{:type => "button"}
          Set new profile picture