From 5e8235cf2b61e0a44c2f74c227fdcf47fa1e5b37 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 7 Nov 2019 11:11:18 -0500 Subject: [PATCH] 15803: Adjust workbench1 user panel to promote setup/unsetup buttons "Admin" tab now is first (and the first one to be displayed). "Setup user" text/button/dialog box is no longer specific to setting up shell accounts, and doesn't imply that setting up a VM is required. Move "Log in" button to the bottom so Setup and deactivate buttons are more prominent. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- .../app/controllers/users_controller.rb | 2 +- .../app/views/users/_setup_popup.html.erb | 6 ++-- .../app/views/users/_show_admin.html.erb | 30 ++++++++----------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb index febd6e3a1d..27fc12bf4c 100644 --- a/apps/workbench/app/controllers/users_controller.rb +++ b/apps/workbench/app/controllers/users_controller.rb @@ -124,7 +124,7 @@ class UsersController < ApplicationController def show_pane_list if current_user.andand.is_admin - super | %w(Admin) + %w(Admin) | super else super end diff --git a/apps/workbench/app/views/users/_setup_popup.html.erb b/apps/workbench/app/views/users/_setup_popup.html.erb index d6f25136c4..4c3a95e87e 100644 --- a/apps/workbench/app/views/users/_setup_popup.html.erb +++ b/apps/workbench/app/views/users/_setup_popup.html.erb @@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
- +
- +
diff --git a/apps/workbench/app/views/users/_show_admin.html.erb b/apps/workbench/app/views/users/_show_admin.html.erb index ddff79be01..1219ec3cfa 100644 --- a/apps/workbench/app/views/users/_show_admin.html.erb +++ b/apps/workbench/app/views/users/_show_admin.html.erb @@ -4,35 +4,31 @@ SPDX-License-Identifier: AGPL-3.0 %>
-

- As an admin, you can log in as this user. When you’ve - finished, you will need to log out and log in again with your - own account. -

- -
- <%= button_to "Log in as #{@object.full_name}", sudo_user_url(id: @object.uuid), class: 'btn btn-primary' %> -

- As an admin, you can setup a shell account for this user. + This button sets up an inactive user. After setup, they will be able to log in. + This dialog bog also allows you to optionally setup a shell account for this user. The login name is automatically generated from the user's e-mail address.

-
- <%= link_to "Setup shell account #{'for ' if @object.full_name.present?} #{@object.full_name}", setup_popup_user_url(id: @object.uuid), {class: 'btn btn-primary', :remote => true, 'data-toggle' => "modal", 'data-target' => '#user-setup-modal-window'} %> -
+ <%= link_to "Setup account #{'for ' if @object.full_name.present?} #{@object.full_name}", setup_popup_user_url(id: @object.uuid), {class: 'btn btn-primary', :remote => true, 'data-toggle' => "modal", 'data-target' => '#user-setup-modal-window'} %> -

+

As an admin, you can deactivate and reset this user. This will remove all repository/VM permissions for the user. If you "setup" the user again, the user will have to sign the user agreement again.

-
- <%= button_to "Deactivate #{@object.full_name}", unsetup_user_url(id: @object.uuid), class: 'btn btn-primary', data: {confirm: "Are you sure you want to deactivate #{@object.full_name}?"} %> -
+ <%= button_to "Deactivate #{@object.full_name}", unsetup_user_url(id: @object.uuid), class: 'btn btn-primary', data: {confirm: "Are you sure you want to deactivate #{@object.full_name}?"} %> + +

+ As an admin, you can log in as this user. When you’ve + finished, you will need to log out and log in again with your + own account. +

+ + <%= button_to "Log in as #{@object.full_name}", sudo_user_url(id: @object.uuid), class: 'btn btn-primary' %>
-- 2.39.5