[ARVADOS] created: b0296ce4619e4e871a5c67cc77005d945cd3ec3c
git at public.curoverse.com
git at public.curoverse.com
Mon Dec 23 17:03:51 EST 2013
at b0296ce4619e4e871a5c67cc77005d945cd3ec3c (commit)
commit b0296ce4619e4e871a5c67cc77005d945cd3ec3c
Author: Peter Amstutz <peter.amstutz at clinicalfuture.com>
Date: Mon Dec 23 17:04:05 2013 -0500
* User is now taken to a "welcome" page where they click button to log in
* Simplified inactive user page and rewrote copy to be more friendly.
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 126dbbe..08a83e4 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -136,7 +136,7 @@ class ApplicationController < ActionController::Base
yield
end
- def thread_with_api_token
+ def thread_with_api_token(login_optional = false)
begin
try_redirect_to_login = true
if params[:api_token]
@@ -177,7 +177,12 @@ class ApplicationController < ActionController::Base
respond_to do |f|
f.html {
if request.method == 'GET'
- redirect_to $arvados_api_client.arvados_login_url(return_to: request.url)
+ if login_optional
+ Thread.current[:arvados_api_token] = nil
+ yield
+ else
+ redirect_to $arvados_api_client.arvados_login_url(return_to: request.url)
+ 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
@@ -195,6 +200,12 @@ class ApplicationController < ActionController::Base
end
end
+ def thread_with_optional_api_token
+ thread_with_api_token(true) do
+ yield
+ end
+ end
+
def verify_api_token
begin
Link.where(uuid: 'just-verifying-my-api-token')
diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 7784427..f48d3b2 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -1,11 +1,11 @@
class UsersController < ApplicationController
skip_before_filter :find_object_by_uuid, :only => :welcome
+ skip_around_filter :thread_with_api_token, :only => :welcome
+ around_filter :thread_with_optional_api_token, :only => :welcome
def welcome
if current_user
redirect_to home_user_path(current_user.uuid)
- else
- redirect_to $arvados_api_client.arvados_login_url(return_to: request.url)
end
end
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index 54c9b94..921588a 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -92,7 +92,7 @@
<li><span class="badge badge-info" style="margin: 10px auto 10px; padding-top: 4px; padding-bottom: 4px"><%= current_user.email %></span></li>
<li><a href="<%= logout_path %>">Log out</a></li>
<% else -%>
- <li><a href="<%= root_path %>">Log in</a></li>
+ <li><a href="<%= $arvados_api_client.arvados_login_url(return_to: root_url) %>">Log in</a></li>
<% end -%>
</ul>
</div><!--/.nav-collapse -->
diff --git a/apps/workbench/app/views/users/_quick_links.html.erb b/apps/workbench/app/views/users/_quick_links.html.erb
new file mode 100644
index 0000000..9ed1aa9
--- /dev/null
+++ b/apps/workbench/app/views/users/_quick_links.html.erb
@@ -0,0 +1,10 @@
+<div class="clearfix">
+ <h4>Quick links</h4>
+ <div class="well dash-list">
+ <ul class="nav nav-list">
+ <li><%= link_to "Introduction to Arvados", "https://arvados.org/projects/arvados/wiki/Introduction_to_Arvados" %></li>
+ <li><%= link_to "User Guide and Tutorials", "http://doc.arvados.org/user/" %></li>
+ <li><%= link_to "API Reference", "http://doc.arvados.org/api/" %></li>
+ </ul>
+ </div>
+</div>
diff --git a/apps/workbench/app/views/users/_request_activation.html.erb b/apps/workbench/app/views/users/_request_activation.html.erb
deleted file mode 100644
index d214827..0000000
--- a/apps/workbench/app/views/users/_request_activation.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<h4>Your account</h4>
-<div class="well clearfix">
- <div>
- Status: <strong>New / inactive</strong>
- </div>
- <br />
- We will send you an email when your account is activated. If this
- hasn’t happened after 24 hours, please let us know.
- <br />
- <%= link_to raw('Contact us ✉'), Rails.configuration.activation_contact_link, class: "pull-right btn btn-primary" %>
-</div>
diff --git a/apps/workbench/app/views/users/home.html.erb b/apps/workbench/app/views/users/home.html.erb
index e67772f..e2fe131 100644
--- a/apps/workbench/app/views/users/home.html.erb
+++ b/apps/workbench/app/views/users/home.html.erb
@@ -41,19 +41,15 @@
<br />
<%= raw(aclass.to_s.pluralize.underscore.gsub '_', ' ') %>
</div>
- <% end %>
+ <% end %>
</div>
</div>
</div>
</div>
-<% end %>
<div class="row-fluid">
<div class="col span3">
<div class="clearfix">
- <% if not current_user.andand.is_active %>
- <%= render partial: 'request_activation' %>
- <% else %>
<h4>Configuration</h4>
<div class="well dash-list">
<ul class="nav nav-list">
@@ -80,24 +76,10 @@
</li>
</ul>
</div>
- <% end %>
</div>
</div>
<div class="col span4">
- <div class="clearfix">
- <h4>Quick links</h4>
- <div class="well dash-list">
- <ul class="nav nav-list">
- <li><%= link_to "Introduction to Arvados", "https://arvados.org/projects/arvados/wiki/Introduction_to_Arvados" %></li>
- <li><%= link_to "API Reference", "http://doc.arvados.org/api/" %></li>
- <li><%= link_to "User Guide", "http://doc.arvados.org/api/" %></li>
- <li><%= link_to "Tutorial 1: Your first job", "http://doc.arvados.org/user/tutorial-job1.html" %></li>
- <li><%= link_to "Tutorial 2: GATK VariantFiltration", "http://doc.arvados.org/user/tutorial-gatk-variantfiltration.html" %></li>
- <li><%= link_to "Tutorial 3: Search PGP data by trait", "http://doc.arvados.org/user/tutorial-trait-search.html" %></li>
- <li><%= link_to "Tutorial 4: Create a new pipeline", "http://doc.arvados.org/user/tutorial-new-pipeline.html" %></li>
- </ul>
- </div>
- </div>
+ <%= render partial: 'quick_links' %>
</div>
<div class="col span5">
<div class="clearfix">
@@ -146,3 +128,26 @@
</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 ✉'),
+ 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
new file mode 100644
index 0000000..05f7157
--- /dev/null
+++ b/apps/workbench/app/views/users/welcome.html.erb
@@ -0,0 +1,9 @@
+<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>
+
diff --git a/doc/user/getting_started/workbench.textile b/doc/user/getting_started/workbench.textile
index c463cfd..d9352a6 100644
--- a/doc/user/getting_started/workbench.textile
+++ b/doc/user/getting_started/workbench.textile
@@ -10,7 +10,7 @@ Access the Arvados beta test instance available using this link:
"https://workbench.{{ site.arvados_api_host }}/":https://workbench.{{ site.arvados_api_host }}/
-If you are accessing Arvados for the first time, you will be asked to log in using a Google account. Arvados only uses Google services for identification, and will never access any personal information. Once you are logged in, the Workbench page may indicate your account status is *New / inactive*. If this is the case, contact the administrator of the Arvados instance to activate your account.
+If you are accessing Arvados for the first time, you will be asked to log in using a Google account. Arvados uses Google services only for identification, and will never access any personal information. Once you are logged in, the Workbench page may indicate your account status is *New / inactive*. If this is the case, contact the administrator of the Arvados instance to activate your account.
Once your account is active, logging in to the Workbench will present you with a system status dashboard. This gives a summary of data, configuration, and activity in the Arvados instance.
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list