Commit 6404d6978075e272f1c83078eeda39d4a68d09c1
1 parent
e9142c6f
Exists in
master
and in
4 other branches
Better UX for blocked users in admin area
Showing
1 changed file
with
25 additions
and
14 deletions
Show diff stats
app/views/admin/users/show.html.haml
| 1 | 1 | %h3.page-title |
| 2 | - User: | |
| 2 | + %span.cgray User: | |
| 3 | 3 | = @user.name |
| 4 | 4 | - if @user.blocked? |
| 5 | 5 | %span.cred (Blocked) |
| ... | ... | @@ -10,8 +10,6 @@ |
| 10 | 10 | = link_to edit_admin_user_path(@user), class: "btn grouped" do |
| 11 | 11 | %i.icon-edit |
| 12 | 12 | Edit |
| 13 | - - if @user.blocked? | |
| 14 | - = link_to 'Unblock', unblock_admin_user_path(@user), method: :put, class: "btn grouped success" | |
| 15 | 13 | %hr |
| 16 | 14 | |
| 17 | 15 | .row |
| ... | ... | @@ -67,17 +65,30 @@ |
| 67 | 65 | = link_to @user.created_by.name, [:admin, @user.created_by] |
| 68 | 66 | |
| 69 | 67 | - unless @user == current_user |
| 70 | - .alert | |
| 71 | - %h4 Block user | |
| 72 | - %br | |
| 73 | - %p Blocking user has the following effects: | |
| 74 | - %ul | |
| 75 | - %li User will not be able to login | |
| 76 | - %li User will not be able to access git repositories | |
| 77 | - %li User will be removed from joined projects and groups | |
| 78 | - %li Personal projects will be left | |
| 79 | - %li Owned groups will be left | |
| 80 | - = link_to 'Block user', block_admin_user_path(@user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-remove" | |
| 68 | + - if @user.blocked? | |
| 69 | + .alert.alert-info | |
| 70 | + %h4 This user is blocked | |
| 71 | + %br | |
| 72 | + %p Blocking user has the following effects: | |
| 73 | + %ul | |
| 74 | + %li User will not be able to login | |
| 75 | + %li User will not be able to access git repositories | |
| 76 | + %li User will be removed from joined projects and groups | |
| 77 | + %li Personal projects will be left | |
| 78 | + %li Owned groups will be left | |
| 79 | + = link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-new", confirm: 'Are you sure?' | |
| 80 | + - else | |
| 81 | + .alert | |
| 82 | + %h4 Block this user | |
| 83 | + %br | |
| 84 | + %p Blocking user has the following effects: | |
| 85 | + %ul | |
| 86 | + %li User will not be able to login | |
| 87 | + %li User will not be able to access git repositories | |
| 88 | + %li User will be removed from joined projects and groups | |
| 89 | + %li Personal projects will be left | |
| 90 | + %li Owned groups will be left | |
| 91 | + = link_to 'Block user', block_admin_user_path(@user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-remove" | |
| 81 | 92 | |
| 82 | 93 | .alert.alert-error |
| 83 | 94 | %h4 | ... | ... |