2019-03-02 22:35:43 +05:30
|
|
|
.gl-responsive-table-row{ role: 'row' }
|
|
|
|
.table-section.section-40
|
|
|
|
.table-mobile-header{ role: 'rowheader' }
|
|
|
|
= _('Name')
|
|
|
|
.table-mobile-content
|
|
|
|
= render 'user_detail', user: user
|
|
|
|
.table-section.section-25
|
|
|
|
.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)
|
|
|
|
.table-section.section-20.table-button-footer
|
|
|
|
.table-action-buttons
|
|
|
|
= link_to _('Edit'), edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: 'btn btn-default'
|
|
|
|
- unless user == current_user
|
|
|
|
%button.dropdown-new.btn.btn-default{ type: 'button', 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
|
2019-03-02 22:35:43 +05:30
|
|
|
= _('Settings')
|
2016-08-24 12:49:21 +05:30
|
|
|
%li
|
|
|
|
- if user.ldap_blocked?
|
2019-03-02 22:35:43 +05:30
|
|
|
%span.small
|
|
|
|
= s_('AdminUsers|Cannot unblock LDAP blocked users')
|
2016-08-24 12:49:21 +05:30
|
|
|
- elsif user.blocked?
|
2019-03-02 22:35:43 +05:30
|
|
|
= link_to _('Unblock'), unblock_admin_user_path(user), method: :put
|
2016-08-24 12:49:21 +05:30
|
|
|
- else
|
2019-03-02 22:35:43 +05:30
|
|
|
= link_to _('Block'), block_admin_user_path(user), data: { confirm: "#{s_('AdminUsers|User will be blocked').upcase}! #{_('Are you sure')}?" }, method: :put
|
2016-08-24 12:49:21 +05:30
|
|
|
- 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),
|
2019-03-02 22:35:43 +05:30
|
|
|
username: sanitize_name(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),
|
2019-03-02 22:35:43 +05:30
|
|
|
username: sanitize_name(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')
|