show.html.haml 3.34 KB
Newer Older
1
%h3.page-title
2 3 4 5 6
  Profile settings
%p.light
  This information appears on your profile.
  - if current_user.ldap_user?
    Some options are unavailable for LDAP accounts
7
%hr
8

9 10


11
= form_for @user, url: profile_path, method: :put, html: { multipart: true, class: "edit_user form-horizontal" }, authenticity_token: true do |f|
12
  -if @user.errors.any?
13
    %div.alert.alert-danger
14 15 16
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg
17
  .row
18
    .col-md-7
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
19
      .form-group
20
        = f.label :name, class: "control-label"
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
21
        .col-sm-10
22
          = f.text_field :name, class: "form-control", required: true
23
          %span.help-block Enter your name, so people you know can recognize you.
24

Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
25
      .form-group
26
        = f.label :email, class: "control-label"
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
27
        .col-sm-10
28
          - if @user.ldap_user?
29
            = f.text_field :email, class: "form-control", required: true, readonly: true
30 31
            %span.help-block.light
              Email is read-only for LDAP user
32
          - else
33
            = f.text_field :email, class: "form-control", required: true
34 35 36 37 38 39
            - if @user.unconfirmed_email.present?
              %span.help-block
                We sent confirmation email to
                %strong #{@user.unconfirmed_email}
            - else
              %span.help-block We also use email for avatar detection if no avatar is uploaded.
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
40
      .form-group
41
        = f.label :skype, class: "control-label"
42
        .col-sm-10= f.text_field :skype, class: "form-control"
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
43
      .form-group
44
        = f.label :linkedin, class: "control-label"
45
        .col-sm-10= f.text_field :linkedin, class: "form-control"
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
46
      .form-group
47
        = f.label :twitter, class: "control-label"
48
        .col-sm-10= f.text_field :twitter, class: "form-control"
Jerome Dalbert's avatar
Jerome Dalbert committed
49
      .form-group
50
        = f.label :website_url, 'Website', class: "control-label"
Jerome Dalbert's avatar
Jerome Dalbert committed
51
        .col-sm-10= f.text_field :website_url, class: "form-control"
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
52
      .form-group
53
        = f.label :bio, class: "control-label"
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
54
        .col-sm-10
55
          = f.text_area :bio, rows: 6, class: "form-control", maxlength: 250
56 57
          %span.help-block Tell us about yourself in fewer than 250 characters.

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

        .clearfix
63
          .profile-avatar-form-option
64
            %p.light
65 66 67 68 69 70 71 72
              - if @user.avatar?
                You can change your avatar here
                %br
                or remove the current avatar to revert to #{link_to "gravatar.com", "http://gravatar.com"}
              - else
                You can upload an avatar here
                %br
                or change it at #{link_to "gravatar.com", "http://gravatar.com"}
73
            %hr
74 75 76 77 78
            %a.choose-btn.btn.btn-small.js-choose-user-avatar-button
              %i.icon-paper-clip
              %span Choose File ...
             
            %span.file_name.js-avatar-filename File name...
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
79
            = f.file_field :avatar, class: "js-user-avatar-input hidden"
80 81 82
            .light The maximum file size allowed is 100KB.
            - if @user.avatar?
              %hr
83
              = link_to 'Remove avatar', profile_avatar_path, data: { confirm: "Avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-small remove-avatar"
84

Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
85
  .form-actions
86
    = f.submit 'Save changes', class: "btn btn-save"