gitlab-org--gitlab-foss/app/views/admin/users/_user.html.haml

57 lines
2.4 KiB
Text
Raw Normal View History

2016-12-05 10:59:30 -05:00
%li.flex-row
.user-avatar
= image_tag avatar_icon_for_user(user), class: "avatar", alt: ''
2016-12-05 10:59:30 -05:00
.row-main-content
.user-name.row-title.str-truncated-100
= link_to user.name, [:admin, user]
- if user.blocked?
2018-04-13 15:37:07 -04:00
%span.badge.badge-danger blocked
- if user.admin?
%span.badge.badge-success Admin
- if user.external?
%span.badge.badge-secondary External
- if user == current_user
%span It's you!
2016-12-05 10:59:30 -05:00
.row-second-line.str-truncated-100
= mail_to user.email, user.email
2016-07-11 13:58:32 -04:00
.controls
= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: 'btn'
- unless user == current_user
.dropdown.inline
2018-05-10 15:22:56 -04:00
%a.dropdown-new.btn.btn-default#project-settings-button{ href: '#', data: { toggle: 'dropdown' } }
= icon('cog')
= icon('caret-down')
2018-04-17 13:18:41 -04:00
%ul.dropdown-menu.dropdown-menu-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, data: { confirm: _('Are you sure?') }
- if can?(current_user, :destroy_user, user)
%li.divider
- if user.can_be_removed?
%li
%button.delete-user-button.btn.text-danger{ data: { toggle: 'modal',
target: '#delete-user-modal',
delete_user_url: admin_user_path(user),
block_user_url: block_admin_user_path(user),
username: user.name,
delete_contributions: false }, type: 'button' }
= s_('AdminUsers|Delete user')
%li
%button.delete-user-button.btn.text-danger{ data: { toggle: 'modal',
target: '#delete-user-modal',
delete_user_url: admin_user_path(user, hard_delete: true),
block_user_url: block_admin_user_path(user),
username: user.name,
delete_contributions: true }, type: 'button' }
= s_('AdminUsers|Delete user and contributions')