2016-12-05 15:59:30 +00:00
|
|
|
%li.flex-row
|
2016-05-26 22:55:49 +00:00
|
|
|
.user-avatar
|
2018-02-09 10:43:12 +00:00
|
|
|
= image_tag avatar_icon_for_user(user), class: "avatar", alt: ''
|
2016-12-05 15:59:30 +00:00
|
|
|
.row-main-content
|
|
|
|
.user-name.row-title.str-truncated-100
|
2016-05-26 22:55:49 +00:00
|
|
|
= link_to user.name, [:admin, user]
|
|
|
|
- if user.blocked?
|
2018-04-13 19:37:07 +00:00
|
|
|
%span.badge.badge-danger blocked
|
2016-05-26 22:55:49 +00:00
|
|
|
- if user.admin?
|
2018-04-13 19:36:22 +00:00
|
|
|
%span.badge.badge-success Admin
|
2016-05-26 22:55:49 +00:00
|
|
|
- if user.external?
|
2018-04-13 20:03:53 +00:00
|
|
|
%span.badge.badge-secondary External
|
2016-05-26 22:55:49 +00:00
|
|
|
- if user == current_user
|
|
|
|
%span It's you!
|
2016-12-05 15:59:30 +00:00
|
|
|
.row-second-line.str-truncated-100
|
2016-05-26 22:55:49 +00:00
|
|
|
= mail_to user.email, user.email
|
2016-07-11 17:58:32 +00:00
|
|
|
.controls
|
2016-05-26 22:55:49 +00: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 19:22:56 +00:00
|
|
|
%a.dropdown-new.btn.btn-default#project-settings-button{ href: '#', data: { toggle: 'dropdown' } }
|
2016-05-26 22:55:49 +00:00
|
|
|
= icon('cog')
|
|
|
|
= icon('caret-down')
|
2018-04-17 17:18:41 +00:00
|
|
|
%ul.dropdown-menu.dropdown-menu-right
|
2016-05-26 22:55:49 +00: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 19:08:02 +00:00
|
|
|
= link_to _('Unlock'), unlock_admin_user_path(user), method: :put, data: { confirm: _('Are you sure?') }
|
2017-06-02 12:36:36 +00:00
|
|
|
- if can?(current_user, :destroy_user, user)
|
2016-05-26 22:55:49 +00:00
|
|
|
%li.divider
|
2017-06-02 12:36:36 +00:00
|
|
|
- if user.can_be_removed?
|
|
|
|
%li
|
2018-06-06 21:36:35 +00:00
|
|
|
%button.delete-user-button.btn.text-danger{ data: { toggle: 'modal',
|
2018-02-08 05:17:12 +00: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 11:18:32 +00:00
|
|
|
delete_contributions: false }, type: 'button' }
|
2018-02-08 05:17:12 +00:00
|
|
|
= s_('AdminUsers|Delete user')
|
|
|
|
|
2016-05-26 22:55:49 +00:00
|
|
|
%li
|
2018-06-06 21:36:35 +00:00
|
|
|
%button.delete-user-button.btn.text-danger{ data: { toggle: 'modal',
|
2018-02-08 05:17:12 +00: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 11:18:32 +00:00
|
|
|
delete_contributions: true }, type: 'button' }
|
2018-02-08 05:17:12 +00:00
|
|
|
= s_('AdminUsers|Delete user and contributions')
|