BigW Consortium Gitlab

show.html.haml 5.11 KB
Newer Older
Phil Hughes committed
1
= form_for @user, url: profile_path, method: :put, html: { multipart: true, class: "edit-user prepend-top-default" }, authenticity_token: true do |f|
2
  -if @user.errors.any?
3
    %div.alert.alert-danger
4 5 6
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg
7
  .row
Phil Hughes committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    .col-lg-3.profile-settings-sidebar
      %h4.prepend-top-0
        Public Avatar
      %p
        - if @user.avatar?
          You can change your avatar here
          - if Gitlab.config.gravatar.enabled
            or remove the current avatar to revert to #{link_to Gitlab.config.gravatar.host, "http://" + Gitlab.config.gravatar.host}
        - else
          You can upload an avatar here
          - if Gitlab.config.gravatar.enabled
            or change it at #{link_to Gitlab.config.gravatar.host, "http://" + Gitlab.config.gravatar.host}
    .col-lg-9
      .clearfix.avatar-image.append-bottom-default
        = image_tag avatar_icon(@user, 160), alt: '', class: 'avatar s160'
      %h5.prepend-top-0
        Upload new avatar
      .prepend-top-5.append-bottom-10
        %a.btn.js-choose-user-avatar-button
          Browse file...
        %span.avatar-file-name.prepend-left-default.js-avatar-filename No file chosen
Alfredo Sumaran committed
29
        = f.file_field :avatar, class: "js-user-avatar-input hidden", accept: "image/*"
Phil Hughes committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
      .help-block
        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-gray"
  %hr
  .row
    .col-lg-3.profile-settings-sidebar
      %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
    .col-lg-9
45
      .form-group
Phil Hughes committed
46 47 48
        = f.label :name, class: "label-light"
        = f.text_field :name, class: "form-control", required: true
        %span.help-block Enter your name, so people you know can recognize you.
49

50
      .form-group
Phil Hughes committed
51 52 53 54 55 56 57 58
        = f.label :email, class: "label-light"
        - if @user.ldap_user? && @user.ldap_email?
          = f.text_field :email, class: "form-control", required: true, readonly: true
          %span.help-block.light
            Your email address was automatically set based on the LDAP server.
        - else
          - if @user.temp_oauth_email?
            = f.text_field :email, class: "form-control", required: true, value: nil
59
          - else
Phil Hughes committed
60 61 62 63 64 65 66 67
            = 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
              = succeed "." do
                %strong #{@user.unconfirmed_email}
              %p
              = link_to "Resend confirmation e-mail", user_confirmation_path(user: { email: @user.unconfirmed_email }), method: :post
68

Phil Hughes committed
69 70
          - else
            %span.help-block We also use email for avatar detection if no avatar is uploaded.
71
      .form-group
Phil Hughes committed
72 73 74
        = f.label :public_email, class: "label-light"
        = f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email), {include_blank: 'Do not show on profile'}, class: "select2"
        %span.help-block This email will be displayed on your public profile.
75
      .form-group
Phil Hughes committed
76 77
        = f.label :skype, class: "label-light"
        = f.text_field :skype, class: "form-control"
78
      .form-group
Phil Hughes committed
79 80
        = f.label :linkedin, class: "label-light"
        = f.text_field :linkedin, class: "form-control"
81
      .form-group
Phil Hughes committed
82 83
        = f.label :twitter, class: "label-light"
        = f.text_field :twitter, class: "form-control"
Jerome Dalbert committed
84
      .form-group
Phil Hughes committed
85 86
        = f.label :website_url, 'Website', class: "label-light"
        = f.text_field :website_url, class: "form-control"
87
      .form-group
Phil Hughes committed
88 89
        = f.label :location, 'Location', class: "label-light"
        = f.text_field :location, class: "form-control"
90
      .form-group
Phil Hughes committed
91 92 93 94 95 96
        = f.label :bio, class: "label-light"
        = f.text_area :bio, rows: 4, class: "form-control", maxlength: 250
        %span.help-block Tell us about yourself in fewer than 250 characters.
      .prepend-top-default.append-bottom-default
        = f.submit 'Update profile settings', class: "btn btn-success"
        = link_to "Cancel", user_path(current_user), class: "btn btn-cancel"
Alfredo Sumaran committed
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118

.modal.modal-profile-crop
  .modal-dialog
    .modal-content
      .modal-header
        %button.close{:type => "button", :'data-dismiss' => "modal"}
          %span
            ×
        %h4.modal-title
          Position and size your new avatar
      .modal-body
        .profile-crop-image-container
          %img.modal-profile-crop-image
        .crop-controls
          .btn-group
            %button.btn.btn-primary{ data: { method: "zoom", option: "0.1" } }
              %span.fa.fa-search-plus
            %button.btn.btn-primary{ data: { method: "zoom", option: "-0.1" } }
              %span.fa.fa-search-minus
      .modal-footer
        %button.btn.btn-primary.js-upload-user-avatar{:type => "button"}
          Set new profile picture