2019-09-23 06:06:19 +00:00
|
|
|
.gl-responsive-table-row{ role: 'row', data: { qa_selector: 'user_row_content' } }
|
2019-01-07 11:54:41 +00:00
|
|
|
.table-section.section-40
|
|
|
|
.table-mobile-header{ role: 'rowheader' }
|
|
|
|
= _('Name')
|
|
|
|
.table-mobile-content
|
|
|
|
= render 'user_detail', user: user
|
2020-09-23 12:09:58 +00:00
|
|
|
.table-section.section-10
|
|
|
|
.table-mobile-header{ role: 'rowheader' }
|
|
|
|
= _('Projects')
|
|
|
|
.table-mobile-content.gl-str-truncated{ data: { testid: "user-project-count-#{user.id}" } }
|
|
|
|
= user.authorized_projects.length
|
|
|
|
.table-section.section-15
|
2019-01-07 11:54:41 +00:00
|
|
|
.table-mobile-header{ role: 'rowheader' }
|
|
|
|
= _('Created on')
|
|
|
|
.table-mobile-content
|
|
|
|
= l(user.created_at.to_date, format: :admin)
|
|
|
|
.table-section.section-15
|
|
|
|
.table-mobile-header{ role: 'rowheader' }
|
|
|
|
= _('Last activity')
|
|
|
|
.table-mobile-content
|
|
|
|
= user.last_activity_on.nil? ? _('Never') : l(user.last_activity_on, format: :admin)
|
2020-03-19 18:09:17 +00:00
|
|
|
- unless user.internal?
|
|
|
|
.table-section.section-20.table-button-footer
|
|
|
|
.table-action-buttons
|
2020-09-14 21:09:27 +00:00
|
|
|
= link_to _('Edit'), edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: 'btn gl-button btn-default'
|
2020-03-19 18:09:17 +00:00
|
|
|
- unless user == current_user
|
2020-11-17 18:09:20 +00:00
|
|
|
%button.dropdown-new.btn.gl-button.btn-default{ type: 'button', data: { testid: "user-action-button-#{user.id}", toggle: 'dropdown' } }
|
2020-03-19 18:09:17 +00:00
|
|
|
= sprite_icon('settings')
|
|
|
|
= sprite_icon('chevron-down')
|
2020-11-17 18:09:20 +00:00
|
|
|
%ul.dropdown-menu.dropdown-menu-right{ data: { testid: "user-action-dropdown-#{user.id}" } }
|
2020-03-19 18:09:17 +00:00
|
|
|
%li.dropdown-header
|
|
|
|
= _('Settings')
|
2019-10-10 00:06:44 +00:00
|
|
|
%li
|
2020-03-19 18:09:17 +00:00
|
|
|
- if user.ldap_blocked?
|
|
|
|
%span.small
|
|
|
|
= s_('AdminUsers|Cannot unblock LDAP blocked users')
|
|
|
|
- elsif user.blocked?
|
2020-10-15 12:09:06 +00:00
|
|
|
- if user.blocked_pending_approval?
|
|
|
|
= link_to s_('AdminUsers|Approve'), approve_admin_user_path(user), method: :put
|
2020-12-03 00:09:53 +00:00
|
|
|
= link_to s_('AdminUsers|Reject'), reject_admin_user_path(user), method: :delete
|
2020-10-15 12:09:06 +00:00
|
|
|
- else
|
2020-12-02 03:09:38 +00:00
|
|
|
%button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_unblock_data(user) }
|
2020-11-20 00:09:06 +00:00
|
|
|
= s_('AdminUsers|Unblock')
|
2020-03-19 18:09:17 +00:00
|
|
|
- else
|
2020-11-17 18:09:20 +00:00
|
|
|
%button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_block_data(user, user_block_effects) }
|
2020-03-19 18:09:17 +00:00
|
|
|
= s_('AdminUsers|Block')
|
|
|
|
- if user.can_be_deactivated?
|
|
|
|
%li
|
2020-11-25 00:09:24 +00:00
|
|
|
%button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_deactivation_data(user, user_deactivation_effects) }
|
2020-03-19 18:09:17 +00:00
|
|
|
= s_('AdminUsers|Deactivate')
|
|
|
|
- elsif user.deactivated?
|
|
|
|
%li
|
2020-12-02 03:09:38 +00:00
|
|
|
%button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_activation_data(user) }
|
|
|
|
= s_('AdminUsers|Activate')
|
2020-03-19 18:09:17 +00:00
|
|
|
- if user.access_locked?
|
|
|
|
%li
|
|
|
|
= link_to _('Unlock'), unlock_admin_user_path(user), method: :put, data: { confirm: _('Are you sure?') }
|
2020-12-03 00:09:53 +00:00
|
|
|
- if can?(current_user, :destroy_user, user) && !user.blocked_pending_approval?
|
2020-03-19 18:09:17 +00:00
|
|
|
%li.divider
|
|
|
|
- if user.can_be_removed?
|
|
|
|
%li
|
2021-02-10 00:09:33 +00:00
|
|
|
%button.js-delete-user-modal-button.btn.btn-default-tertiary.text-danger{ data: { 'gl-modal-action': 'delete',
|
2020-03-19 18:09:17 +00:00
|
|
|
delete_user_url: admin_user_path(user),
|
|
|
|
block_user_url: block_admin_user_path(user),
|
|
|
|
username: sanitize_name(user.name) } }
|
|
|
|
= s_('AdminUsers|Delete user')
|
|
|
|
%li
|
2021-02-10 00:09:33 +00:00
|
|
|
%button.js-delete-user-modal-button.btn.btn-default-tertiary.text-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
|
2020-03-19 18:09:17 +00:00
|
|
|
delete_user_url: admin_user_path(user, hard_delete: true),
|
|
|
|
block_user_url: block_admin_user_path(user),
|
|
|
|
username: sanitize_name(user.name) } }
|
|
|
|
= s_('AdminUsers|Delete user and contributions')
|