BigW Consortium Gitlab

_user.html.haml 2.03 KB
Newer Older
1
%li.flex-row
2 3
  .user-avatar
    = image_tag avatar_icon(user), class: "avatar", alt: ''
4 5
  .row-main-content
    .user-name.row-title.str-truncated-100
6 7 8 9 10 11 12 13 14
      = link_to user.name, [:admin, user]
    - if user.blocked?
      %span.label.label-danger blocked
    - if user.admin?
      %span.label.label-success Admin
    - if user.external?
      %span.label.label-default External
    - if user == current_user
      %span It's you!
15
    .row-second-line.str-truncated-100
16
      = mail_to user.email, user.email
17
  .controls
18 19 20
    = link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: 'btn'
    - unless user == current_user
      .dropdown.inline
21
        %a.dropdown-new.btn.btn-default#project-settings-button{ href: '#', data: { toggle: 'dropdown' } }
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
          = icon('cog')
          = icon('caret-down')
        %ul.dropdown-menu.dropdown-menu-align-right
          %li.dropdown-header
            Settings
            %li
              - if user.ldap_blocked?
                %span.small Cannot unblock LDAP blocked users
              - elsif user.blocked?
                = link_to 'Unblock', unblock_admin_user_path(user), method: :put
              - else
                = link_to 'Block', block_admin_user_path(user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put
            - if user.access_locked?
              %li
                = link_to 'Unlock', unlock_admin_user_path(user), method: :put, class: 'btn-grouped btn btn-xs btn-success', data: { confirm: 'Are you sure?' }
37
          - if user.can_be_removed? && can?(current_user, :destroy_user, @user)
38 39
            %li.divider
            %li
40
              = link_to 'Delete User', [:admin, user], data: { confirm: "USER #{user.name} WILL BE REMOVED! All issues, merge requests and groups linked to this user will also be removed! Consider cancelling this deletion and blocking the user instead. Are you sure?" },
41 42
                                                   class: 'btn btn-remove btn-block',
                                                   method: :delete