2016-12-05 10:59:30 -05:00
|
|
|
%li.flex-row
|
2016-05-26 18:55:49 -04:00
|
|
|
.user-avatar
|
2018-02-09 05:43:12 -05:00
|
|
|
= 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
|
2016-05-26 18:55:49 -04:00
|
|
|
= link_to user.name, [:admin, user]
|
|
|
|
- if user.blocked?
|
2018-04-13 15:37:07 -04:00
|
|
|
%span.badge.badge-danger blocked
|
2016-05-26 18:55:49 -04:00
|
|
|
- if user.admin?
|
2018-04-13 15:36:22 -04:00
|
|
|
%span.badge.badge-success Admin
|
2016-05-26 18:55:49 -04:00
|
|
|
- if user.external?
|
2018-04-13 16:03:53 -04:00
|
|
|
%span.badge.badge-secondary External
|
2016-05-26 18:55:49 -04:00
|
|
|
- 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
|
2018-05-10 15:22:56 -04: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')
|
2018-04-17 13:18:41 -04:00
|
|
|
%ul.dropdown-menu.dropdown-menu-right
|
2016-05-26 18:55:49 -04:00
|
|
|
%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-04-10 15:08:02 -04:00
|
|
|
= link_to _('Unlock'), unlock_admin_user_path(user), method: :put, 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
|
2018-06-06 17:36:35 -04:00
|
|
|
%button.delete-user-button.btn.text-danger{ data: { toggle: 'modal',
|
2018-02-08 00:17:12 -05:00
|
|
|
target: '#delete-user-modal',
|
|
|
|
delete_user_url: admin_user_path(user),
|
|
|
|
block_user_url: block_admin_user_path(user),
|
|
|
|
username: user.name,
|
2018-04-26 07:18:32 -04:00
|
|
|
delete_contributions: false }, type: 'button' }
|
2018-02-08 00:17:12 -05:00
|
|
|
= s_('AdminUsers|Delete user')
|
|
|
|
|
2016-05-26 18:55:49 -04:00
|
|
|
%li
|
2018-06-06 17:36:35 -04:00
|
|
|
%button.delete-user-button.btn.text-danger{ data: { toggle: 'modal',
|
2018-02-08 00:17:12 -05:00
|
|
|
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-04-26 07:18:32 -04:00
|
|
|
delete_contributions: true }, type: 'button' }
|
2018-02-08 00:17:12 -05:00
|
|
|
= s_('AdminUsers|Delete user and contributions')
|