diff options
Diffstat (limited to 'app/views/admin/users/show.html.haml')
-rw-r--r-- | app/views/admin/users/show.html.haml | 104 |
1 files changed, 51 insertions, 53 deletions
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 9c6f151a6b1..26f78ea4d6a 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -42,7 +42,7 @@ = sprite_icon('close', size: 16, css_class: 'gl-icon') %li %span.light ID: - %strong + %strong{ data: { qa_selector: 'user_id_content' } } = @user.id %li %span.light= _('Namespace ID:') @@ -158,24 +158,21 @@ .card-body = render partial: 'admin/users/user_activation_effects' %br - = link_to 'Activate user', activate_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' } + %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_activation_data(@user) } + = s_('AdminUsers|Activate user') - elsif @user.can_be_deactivated? .card.border-warning .card-header.bg-warning.text-white Deactivate this user .card-body - = render partial: 'admin/users/user_deactivation_effects' + = user_deactivation_effects %br - %button.btn.gl-button.btn-warning{ data: { 'gl-modal-action': 'deactivate', - content: 'You can always re-activate their account, their data will remain intact.', - url: deactivate_admin_user_path(@user), - username: sanitize_name(@user.name) } } + %button.btn.gl-button.btn-warning.js-confirm-modal-button{ data: user_deactivation_data(@user, s_('AdminUsers|You can always re-activate their account, their data will remain intact.')) } = s_('AdminUsers|Deactivate user') - - if @user.blocked? - if @user.blocked_pending_approval? = render 'admin/users/approve_user', user: @user - = render 'admin/users/block_user', user: @user + = render 'admin/users/reject_pending_user', user: @user - else .card.border-info .card-header.gl-bg-blue-500.gl-text-white @@ -186,7 +183,8 @@ %li Log in %li Access Git repositories %br - = link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: s_('AdminUsers|Are you sure?') } + %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_unblock_data(@user) } + = s_('AdminUsers|Unblock user') - elsif !@user.internal? = render 'admin/users/block_user', user: @user @@ -198,52 +196,52 @@ %p This user has been temporarily locked due to excessive number of failed logins. You may manually unlock the account. %br = link_to 'Unlock user', unlock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' } - - .card.border-danger - .card-header.bg-danger.text-white - = s_('AdminUsers|Delete user') - .card-body - - if @user.can_be_removed? && can?(current_user, :destroy_user, @user) - %p Deleting a user has the following effects: - = render 'users/deletion_guidance', user: @user - %br - %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete', - delete_user_url: admin_user_path(@user), - block_user_url: block_admin_user_path(@user), - username: sanitize_name(@user.name) } } - = s_('AdminUsers|Delete user') - - else - - if @user.solo_owned_groups.present? - %p - This user is currently an owner in these groups: - %strong= @user.solo_owned_groups.map(&:name).join(', ') + - if !@user.blocked_pending_approval? + .card.border-danger + .card-header.bg-danger.text-white + = s_('AdminUsers|Delete user') + .card-body + - if @user.can_be_removed? && can?(current_user, :destroy_user, @user) + %p Deleting a user has the following effects: + = render 'users/deletion_guidance', user: @user + %br + %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete', + delete_user_url: admin_user_path(@user), + block_user_url: block_admin_user_path(@user), + username: sanitize_name(@user.name) } } + = s_('AdminUsers|Delete user') + - else + - if @user.solo_owned_groups.present? + %p + This user is currently an owner in these groups: + %strong= @user.solo_owned_groups.map(&:name).join(', ') + %p + You must transfer ownership or delete these groups before you can delete this user. + - else + %p + You don't have access to delete this user. + + .card.border-danger + .card-header.bg-danger.text-white + = s_('AdminUsers|Delete user and contributions') + .card-body + - if can?(current_user, :destroy_user, @user) %p - You must transfer ownership or delete these groups before you can delete this user. + This option deletes the user and any contributions that + would usually be moved to the + = succeed "." do + = link_to "system ghost user", help_page_path("user/profile/account/delete_account") + As well as the user's personal projects, groups owned solely by + the user, and projects in them, will also be removed. Commits + to other projects are unaffected. + %br + %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions', + delete_user_url: admin_user_path(@user, hard_delete: true), + block_user_url: block_admin_user_path(@user), + username: @user.name } } + = s_('AdminUsers|Delete user and contributions') - else %p You don't have access to delete this user. - .card.border-danger - .card-header.bg-danger.text-white - = s_('AdminUsers|Delete user and contributions') - .card-body - - if can?(current_user, :destroy_user, @user) - %p - This option deletes the user and any contributions that - would usually be moved to the - = succeed "." do - = link_to "system ghost user", help_page_path("user/profile/account/delete_account") - As well as the user's personal projects, groups owned solely by - the user, and projects in them, will also be removed. Commits - to other projects are unaffected. - %br - %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions', - delete_user_url: admin_user_path(@user, hard_delete: true), - block_user_url: block_admin_user_path(@user), - username: @user.name } } - = s_('AdminUsers|Delete user and contributions') - - else - %p - You don't have access to delete this user. - = render partial: 'admin/users/modals' |