diff options
Diffstat (limited to 'app/views/admin/users/show.html.haml')
-rw-r--r-- | app/views/admin/users/show.html.haml | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index a988f746ced..706fa033c51 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -156,6 +156,27 @@ = render_if_exists 'admin/users/user_detail_note' + - if @user.deactivated? + .card.border-info + .card-header.bg-info.text-white + Reactivate this user + .card-body + = render partial: 'admin/users/user_activation_effects' + %br + = link_to 'Activate user', activate_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' } + - 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' + %br + %button.btn.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) } } + = s_('AdminUsers|Deactivate user') + - if @user.blocked? .card.border-info .card-header.bg-info.text-white @@ -172,14 +193,13 @@ .card-header.bg-warning.text-white Block this user .card-body - %p Blocking user has the following effects: - %ul - %li User will not be able to login - %li User will not be able to access git repositories - %li Personal projects will be left - %li Owned groups will be left + = render partial: 'admin/users/user_block_effects' %br - = link_to 'Block user', block_admin_user_path(@user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put, class: "btn btn-warning" + %button.btn.btn-warning{ data: { 'gl-modal-action': 'block', + content: 'You can always unblock their account, their data will remain intact.', + url: block_admin_user_path(@user), + username: sanitize_name(@user.name) } } + = s_('AdminUsers|Block user') - if @user.access_locked? .card.border-info .card-header.bg-info.text-white @@ -197,12 +217,10 @@ %p Deleting a user has the following effects: = render 'users/deletion_guidance', user: @user %br - %button.delete-user-button.btn.btn-danger{ data: { toggle: 'modal', - target: '#delete-user-modal', + %button.delete-user-button.btn.btn-danger{ data: { 'gl-modal-action': 'delete', delete_user_url: admin_user_path(@user), block_user_url: block_admin_user_path(@user), - username: @user.name, - delete_contributions: false }, type: 'button' } + username: sanitize_name(@user.name) } } = s_('AdminUsers|Delete user') - else - if @user.solo_owned_groups.present? @@ -229,15 +247,13 @@ the user, and projects in them, will also be removed. Commits to other projects are unaffected. %br - %button.delete-user-button.btn.btn-danger{ data: { toggle: 'modal', - target: '#delete-user-modal', + %button.delete-user-button.btn.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, - delete_contributions: true }, type: 'button' } + username: @user.name } } = s_('AdminUsers|Delete user and contributions') - else %p You don't have access to delete this user. - #delete-user-modal += render partial: 'admin/users/modals' |