2016-12-05 10:59:30 -05:00
%li.flex-row
2016-05-26 18:55:49 -04:00
.user-avatar
= image_tag avatar_icon(user), class: "avatar", alt: ''
2016-12-05 10:59:30 -05:00
.row-main-content
.user-name.row-title.str-truncated-100
2016-05-26 18:55:49 -04:00
= 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!
2016-12-05 10:59:30 -05:00
.row-second-line.str-truncated-100
2016-05-26 18:55:49 -04:00
= mail_to user.email, user.email
2016-07-11 13:58:32 -04:00
.controls
2016-05-26 18:55:49 -04:00
= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: 'btn'
- unless user == current_user
.dropdown.inline
2016-12-26 05:47:16 -05:00
%a.dropdown-new.btn.btn-default#project-settings-button{ href: '#', data: { toggle: 'dropdown' } }
2016-05-26 18:55:49 -04:00
= 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?' }
2017-06-02 08:36:36 -04:00
- if can?(current_user, :destroy_user, user)
2016-05-26 18:55:49 -04:00
%li.divider
2017-06-02 08:36:36 -04:00
- if user.can_be_removed?
%li
= link_to 'Remove user', admin_user_path(user),
data: { confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?" },
2017-08-17 06:20:55 -04:00
class: 'text-danger',
2017-06-02 08:36:36 -04:00
method: :delete
2016-05-26 18:55:49 -04:00
%li
2017-06-02 08:36:36 -04:00
= link_to 'Remove user and contributions', admin_user_path(user, hard_delete: true),
data: { confirm: "USER #{user.name} WILL BE REMOVED! All issues, merge requests and comments authored by this user, and groups owned solely by them, will also be removed! Are you sure?" },
2017-08-17 06:20:55 -04:00
class: 'text-danger',
2017-06-02 08:36:36 -04:00
method: :delete