Commit dd24c3d4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve user block/unblock UI in admin area

parent e89ffd54
......@@ -24,7 +24,7 @@ class Admin::UsersController < Admin::ApplicationController
def block
if user.block
redirect_to :back, alert: "Successfully blocked"
redirect_to :back, notice: "Successfully blocked"
else
redirect_to :back, alert: "Error occurred. User was not blocked"
end
......@@ -32,7 +32,7 @@ class Admin::UsersController < Admin::ApplicationController
def unblock
if user.activate
redirect_to :back, alert: "Successfully unblocked"
redirect_to :back, notice: "Successfully unblocked"
else
redirect_to :back, alert: "Error occurred. User was not unblocked"
end
......
......@@ -108,8 +108,10 @@
.col-md-6
- unless @user == current_user
- if @user.blocked?
.alert.alert-info
%h4 This user is blocked
.panel.panel-info
.panel-heading
This user is blocked
.panel-body
%p Blocking user has the following effects:
%ul
%li User will not be able to login
......@@ -118,10 +120,12 @@
%li Personal projects will be left
%li Owned groups will be left
%br
= link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-new", data: { confirm: 'Are you sure?' }
= link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }
- else
.alert.alert-warning
%h4 Block this user
.panel.panel-warning
.panel-heading
Block this user
.panel-body
%p Blocking user has the following effects:
%ul
%li User will not be able to login
......@@ -130,11 +134,12 @@
%li Personal projects will be left
%li Owned groups will be left
%br
= link_to 'Block user', block_admin_user_path(@user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put, class: "btn btn-remove"
= link_to 'Block user', block_admin_user_path(@user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put, class: "btn btn-warning"
.alert.alert-danger
%h4
.panel.panel-danger
.panel-heading
Remove user
.panel-body
%p Deleting a user has the following effects:
%ul
%li All user content like authored issues, snippets, comments will be removed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment