summaryrefslogtreecommitdiff
path: root/app/views/profiles/show.html.haml
blob: 29c30905117df0b7e1ef163265b06af04df8b1fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
- page_title "Settings"
%h3.page-title
  Profile Settings
%p.light
  This information will appear on your profile.
  - if current_user.ldap_user?
    Some options are unavailable for LDAP accounts
%hr



= form_for @user, url: profile_path, method: :put, html: { multipart: true, class: "edit_user form-horizontal" }, authenticity_token: true do |f|
  -if @user.errors.any?
    %div.alert.alert-danger
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg
  .row
    .col-md-7
      .form-group
        = f.label :name, class: "control-label"
        .col-sm-10
          = f.text_field :name, class: "form-control", required: true
          %span.help-block Enter your name, so people you know can recognize you.

      .form-group
        = f.label :email, class: "control-label"
        .col-sm-10
          - if @user.ldap_user?
            = f.text_field :email, class: "form-control", required: true, readonly: true
            %span.help-block.light
              Email is read-only for LDAP user
          - else
            - 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
            - if @user.unconfirmed_email.present?
              %span.help-block
                Please click the link in the confirmation email before continuing, it was sent to
                %strong #{@user.unconfirmed_email}

            - else
              %span.help-block We also use email for avatar detection if no avatar is uploaded.
      .form-group
        = f.label :public_email, class: "control-label"
        .col-sm-10
          = f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email), {include_blank: 'Do not show in profile'}, class: "form-control"
          %span.help-block This email will be displayed on your public profile.
      .form-group
        = f.label :skype, class: "control-label"
        .col-sm-10= f.text_field :skype, class: "form-control"
      .form-group
        = f.label :linkedin, class: "control-label"
        .col-sm-10= f.text_field :linkedin, class: "form-control"
      .form-group
        = f.label :twitter, class: "control-label"
        .col-sm-10= f.text_field :twitter, class: "form-control"
      .form-group
        = f.label :website_url, 'Website', class: "control-label"
        .col-sm-10= f.text_field :website_url, class: "form-control"
      .form-group
        = f.label :location, 'Location', class: "control-label"
        .col-sm-10= f.text_field :location, class: "form-control"
      .form-group
        = f.label :bio, class: "control-label"
        .col-sm-10
          = f.text_area :bio, rows: 4, class: "form-control", maxlength: 250
          %span.help-block Tell us about yourself in fewer than 250 characters.

    .col-md-5
      .light-well
        = image_tag avatar_icon(@user.email, 160), alt: '', class: 'avatar s160'

        .clearfix
          .profile-avatar-form-option
            %p.light
              - if @user.avatar?
                You can change your avatar here
                - if Gitlab.config.gravatar.enabled
                  %br
                  or remove the current avatar to revert to #{link_to "gravatar.com", "http://gravatar.com"}
              - else
                You can upload an avatar here
                - if Gitlab.config.gravatar.enabled
                  %br
                  or change it at #{link_to "gravatar.com", "http://gravatar.com"}
            %hr
            %a.choose-btn.btn.btn-sm.js-choose-user-avatar-button
              %i.fa.fa-paperclip
              %span Choose File ...
             
            %span.file_name.js-avatar-filename File name...
            = f.file_field :avatar, class: "js-user-avatar-input hidden"
            .light The maximum file size allowed is 200KB.
            - if @user.avatar?
              %hr
              = 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"

      - if @user.public_profile?
        .alert.alert-info
          %h4 Public profile
          %p Your profile is publicly visible because you joined public project(s)


  .row
    .col-md-7
      .form-group
        .col-sm-2  
        .col-sm-10
          = f.submit 'Save changes', class: "btn btn-success"