debian-mirror-gitlab/app/views/admin/users/_user.html.haml

57 lines
2.4 KiB
Text
Raw Normal View History

2017-08-17 22:00:37 +05:30
%li.flex-row
2016-08-24 12:49:21 +05:30
.user-avatar
2018-03-27 19:54:05 +05:30
= image_tag avatar_icon_for_user(user), class: "avatar", alt: ''
2017-08-17 22:00:37 +05:30
.row-main-content
.user-name.row-title.str-truncated-100
2016-08-24 12:49:21 +05:30
= link_to user.name, [:admin, user]
- if user.blocked?
2018-11-08 19:23:39 +05:30
%span.badge.badge-danger blocked
2016-08-24 12:49:21 +05:30
- if user.admin?
2018-11-08 19:23:39 +05:30
%span.badge.badge-success Admin
2016-08-24 12:49:21 +05:30
- if user.external?
2018-11-08 19:23:39 +05:30
%span.badge.badge-secondary External
2016-08-24 12:49:21 +05:30
- if user == current_user
%span It's you!
2017-08-17 22:00:37 +05:30
.row-second-line.str-truncated-100
2016-08-24 12:49:21 +05:30
= mail_to user.email, user.email
.controls
= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: 'btn'
- unless user == current_user
.dropdown.inline
2017-08-17 22:00:37 +05:30
%a.dropdown-new.btn.btn-default#project-settings-button{ href: '#', data: { toggle: 'dropdown' } }
2016-08-24 12:49:21 +05:30
= icon('cog')
= icon('caret-down')
2018-11-08 19:23:39 +05:30
%ul.dropdown-menu.dropdown-menu-right
2016-08-24 12:49:21 +05:30
%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
2018-10-15 14:42:47 +05:30
= link_to _('Unlock'), unlock_admin_user_path(user), method: :put, data: { confirm: _('Are you sure?') }
2017-09-10 17:25:29 +05:30
- if can?(current_user, :destroy_user, user)
2016-08-24 12:49:21 +05:30
%li.divider
2017-09-10 17:25:29 +05:30
- if user.can_be_removed?
%li
2018-03-17 18:26:18 +05:30
%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,
2018-10-15 14:42:47 +05:30
delete_contributions: false }, type: 'button' }
2018-03-17 18:26:18 +05:30
= s_('AdminUsers|Delete user')
2016-08-24 12:49:21 +05:30
%li
2018-03-17 18:26:18 +05:30
%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,
2018-10-15 14:42:47 +05:30
delete_contributions: true }, type: 'button' }
2018-03-17 18:26:18 +05:30
= s_('AdminUsers|Delete user and contributions')