diff options
Diffstat (limited to 'app/views/admin/users/show.html.haml')
-rw-r--r-- | app/views/admin/users/show.html.haml | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 63c5a15de1c..101667508a9 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -172,13 +172,19 @@ .panel.panel-danger .panel-heading - Remove user + = s_('AdminUsers|Delete user') .panel-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 - = link_to 'Remove user', admin_user_path(@user), data: { confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-remove" + %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), + username: @user.name, + delete_contributions: 'false' }, type: 'button' } + = s_('AdminUsers|Delete user') - else - if @user.solo_owned_groups.present? %p @@ -192,7 +198,7 @@ .panel.panel-danger .panel-heading - Remove user and contributions + = s_('AdminUsers|Delete user and contributions') .panel-body - if can?(current_user, :destroy_user, @user) %p @@ -204,7 +210,15 @@ the user, and projects in them, will also be removed. Commits to other projects are unaffected. %br - = link_to 'Remove user and contributions', admin_user_path(@user, hard_delete: true), data: { confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-remove" + %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), + username: @user.name, + delete_contributions: 'true' }, type: 'button' } + = s_('AdminUsers|Delete user and contributions') - else %p You don't have access to delete this user. + + #delete-user-modal |