[ARVADOS] updated: 92208a37142717bc9b70a95f889950639e584d58

git at public.curoverse.com git at public.curoverse.com
Thu Dec 26 10:06:57 EST 2013


Summary of changes:
 .../app/controllers/application_controller.rb      |   33 +++++++-------
 apps/workbench/app/views/users/home.html.erb       |   45 ++++++++++---------
 apps/workbench/app/views/users/welcome.html.erb    |   27 ++++++++----
 3 files changed, 60 insertions(+), 45 deletions(-)

       via  92208a37142717bc9b70a95f889950639e584d58 (commit)
      from  b0296ce4619e4e871a5c67cc77005d945cd3ec3c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 92208a37142717bc9b70a95f889950639e584d58
Author: Peter Amstutz <peter.amstutz at clinicalfuture.com>
Date:   Thu Dec 26 10:07:18 2013 -0500

    * 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 08a83e4..6629454 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 e2fe131..8a211c8 100644
--- a/apps/workbench/app/views/users/home.html.erb
+++ b/apps/workbench/app/views/users/home.html.erb
@@ -128,26 +128,29 @@
     </div>
   </div>
 </div>
-<% else %>
 
-<h1>Welcome to Arvados, <%= current_user.first_name %></h1>
-<div class="row-fluid">
-<div class="col">
-  <h4>Your account status</h4>
-<div class="well clearfix">
-  <p><strong>New / inactive</strong></p>
-  <p>
-  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" %>.
-</p>
-  <p>
-  <%= link_to raw('Contact us &#x2709;'),
-  Rails.configuration.activation_contact_link, class: "pull-right btn btn-primary" %></p>
-</div>
-</div>
-</div>
+<% elsif current_user %>
+  <%= image_tag "dax.png", style: "float: right; max-width: 25%; margin-left: 2em" %>
+  <h1>Welcome to Arvados, <%= current_user.first_name %>!</h1>
+  <div class="row-fluid">
+    <div class="col span8">
+      <h4>Your account status</h4>
+      <div class="well clearfix">
+	<p><strong>New / inactive</strong></p>
+	<p>
+	  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" %>.
+	</p>
+	<p>
+	  <%= link_to raw('Contact us &#x2709;'),
+	      Rails.configuration.activation_contact_link, class: "pull-right btn btn-primary" %></p>
+      </div>
+    </div>
+  </div>
 <% end %>
diff --git a/apps/workbench/app/views/users/welcome.html.erb b/apps/workbench/app/views/users/welcome.html.erb
index 05f7157..ced69c4 100644
--- a/apps/workbench/app/views/users/welcome.html.erb
+++ b/apps/workbench/app/views/users/welcome.html.erb
@@ -1,9 +1,20 @@
-<h1>Please log in to use Arvados Workbench.</h1>
-</p>
-<p style="margin-top: 1em">
-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.
-</p>
-<p style="margin-top: 1em">
-  <a  class="btn btn-primary" href="<%= $arvados_api_client.arvados_login_url(return_to: request.url) %>">Click here to log in to Arvados Workbench with a Google account</a>
-</p>
+<%= image_tag "dax.png", style: "float: right; max-width: 25%; margin-left: 2em" %>
+<h1>Hi there!  Please log in to use Arvados Workbench.</h1>
+<div class="row-fluid">
+  <div class="col span8" style="margin-top: 1em">
+    <div class="well clearfix">
+      <p>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.</p>
+      <p>
+	<a  class="pull-right btn btn-primary" href="<%= $arvados_api_client.arvados_login_url(return_to: request.url) %>">
+	  Click here to log in to Arvados Workbench with a Google account</a>
+      </p>
+    </div>
+  </div>
+</div>
+
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list