From: Peter Amstutz Date: Thu, 26 Dec 2013 15:07:18 +0000 (-0500) Subject: * A couple of tweaks in response to Tom's feedback X-Git-Tag: 1.1.0~2801^2~17 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/92208a37142717bc9b70a95f889950639e584d58?ds=sidebyside * A couple of tweaks in response to Tom's feedback * Additional styling * Added Dax --- diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 08a83e4986..6629454b17 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -174,24 +174,25 @@ class ApplicationController < ActionController::Base logger.debug "No token received, session is #{session.inspect}" end if try_redirect_to_login - respond_to do |f| - f.html { - if request.method == 'GET' - if login_optional - Thread.current[:arvados_api_token] = nil - yield - else + unless login_optional + respond_to do |f| + f.html { + if request.method == 'GET' redirect_to $arvados_api_client.arvados_login_url(return_to: request.url) + else + flash[:error] = "Either you are not logged in, or your session has timed out. I can't automatically log you in and re-attempt this request." + redirect_to :back end - else - flash[:error] = "Either you are not logged in, or your session has timed out. I can't automatically log you in and re-attempt this request." - redirect_to :back - end - } - f.json { - @errors = ['You do not seem to be logged in. You did not supply an API token with this request, and your session (if any) has timed out.'] - self.render_error status: 422 - } + } + f.json { + @errors = ['You do not seem to be logged in. You did not supply an API token with this request, and your session (if any) has timed out.'] + self.render_error status: 422 + } + end + else + # login is optional for this route so go on to the regular controller + Thread.current[:arvados_api_token] = nil + yield end end ensure diff --git a/apps/workbench/app/views/users/home.html.erb b/apps/workbench/app/views/users/home.html.erb index e2fe131280..8a211c8485 100644 --- a/apps/workbench/app/views/users/home.html.erb +++ b/apps/workbench/app/views/users/home.html.erb @@ -128,26 +128,29 @@ -<% else %> -

Welcome to Arvados, <%= current_user.first_name %>

-
-
-

Your account status

-
-

New / inactive

-

- Your account must be activated by an Arvados administrator. If this - is your first time accessing Arvados and would like to request - access, or you believe you are seeing the page in error, please -<%= link_to "contact us", Rails.configuration.activation_contact_link %>. You should receive an email at the address you used to log in when - your account is activated. In the mean time, you can <%= link_to "learn more about Arvados", "https://arvados.org/projects/arvados/wiki/Introduction_to_Arvados" %>, - and <%= link_to "read the Arvados user guide", "http://doc.arvados.org/user" %>. -

-

- <%= link_to raw('Contact us ✉'), - Rails.configuration.activation_contact_link, class: "pull-right btn btn-primary" %>

-
-
-
+<% elsif current_user %> + <%= image_tag "dax.png", style: "float: right; max-width: 25%; margin-left: 2em" %> +

Welcome to Arvados, <%= current_user.first_name %>!

+
+
+

Your account status

+
+

New / inactive

+

+ Your account must be activated by an Arvados administrator. If this + is your first time accessing Arvados and would like to request + access, or you believe you are seeing the page in error, please + <%= link_to "contact us", Rails.configuration.activation_contact_link %>. + You should receive an email at the address you used to log in when + your account is activated. In the mean time, you can + <%= link_to "learn more about Arvados", "https://arvados.org/projects/arvados/wiki/Introduction_to_Arvados" %>, + and <%= link_to "read the Arvados user guide", "http://doc.arvados.org/user" %>. +

+

+ <%= link_to raw('Contact us ✉'), + Rails.configuration.activation_contact_link, class: "pull-right btn btn-primary" %>

+
+
+
<% end %> diff --git a/apps/workbench/app/views/users/welcome.html.erb b/apps/workbench/app/views/users/welcome.html.erb index 05f71573de..ced69c48e3 100644 --- a/apps/workbench/app/views/users/welcome.html.erb +++ b/apps/workbench/app/views/users/welcome.html.erb @@ -1,9 +1,20 @@ -

Please log in to use Arvados Workbench.

-

-

-When you click on the button below you will be taken to a Google sign-in page. After entering your information, you will be redirected back to the Arvados Workbench. If you have never used Arvados before, logging in for the first time will also create a new user account. Arvados uses Google services for only for identification, and will never access any personal information. -

-

- Click here to log in to Arvados Workbench with a Google account -

+<%= image_tag "dax.png", style: "float: right; max-width: 25%; margin-left: 2em" %> +

Hi there! Please log in to use Arvados Workbench.

+
+
+
+

When you click on the button below you will be taken to a Google sign-in page. + After entering your information, you will be redirected back to the Arvados + Workbench. If you have never used Arvados before, logging in for the first + time will also create a new user account. Arvados uses your your name and + email address from Google services only for identification, and will never + access any personal information.

+

+ + Click here to log in to Arvados Workbench with a Google account +

+
+
+
+