[ARVADOS] updated: 99ce6a94ab4b6df30f727c6d07039aa55c2bad32
git at public.curoverse.com
git at public.curoverse.com
Wed Nov 18 11:36:30 EST 2015
Summary of changes:
apps/workbench/app/views/application/404.html.erb | 7 +++-
.../app/views/application/_report_error.html.erb | 46 +++++++++++++---------
.../test/controllers/projects_controller_test.rb | 2 +-
3 files changed, 34 insertions(+), 21 deletions(-)
via 99ce6a94ab4b6df30f727c6d07039aa55c2bad32 (commit)
from 84260dab5182907cae91849acd652c138c2d5095 (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 99ce6a94ab4b6df30f727c6d07039aa55c2bad32
Author: Brett Smith <brett at curoverse.com>
Date: Wed Nov 18 11:36:04 2015 -0500
6846: Streamline Workbench 404 page.
* Prompt the user to log in with a prominent button.
* Make the page text less verbose.
* DRY up the code in the _report_error partial.
Refs #6846.
diff --git a/apps/workbench/app/views/application/404.html.erb b/apps/workbench/app/views/application/404.html.erb
index aa1ffda..ea6e703 100644
--- a/apps/workbench/app/views/application/404.html.erb
+++ b/apps/workbench/app/views/application/404.html.erb
@@ -18,8 +18,11 @@
<% if !current_user %>
<p>
- (I notice you are not logged in. If you're looking for a private
- page, you'll need to <%=link_to 'log in', arvados_api_client.arvados_login_url(return_to: strip_token_from_path(request.url))%> first.)
+ <%= link_to(arvados_api_client.arvados_login_url(return_to: strip_token_from_path(request.url)),
+ {class: "btn btn-primary report-issue-modal-window"}) do %>
+ <i class="fa fa-fw fa-sign-in"></i> Log in
+ <% end %>
+ to view private data.
</p>
<% elsif class_name %>
diff --git a/apps/workbench/app/views/application/_report_error.html.erb b/apps/workbench/app/views/application/_report_error.html.erb
index 2e449b7..d9573a2 100644
--- a/apps/workbench/app/views/application/_report_error.html.erb
+++ b/apps/workbench/app/views/application/_report_error.html.erb
@@ -1,21 +1,31 @@
+<%
+ popup_params = {
+ popup_type: 'report',
+ current_location: request.url,
+ current_path: request.fullpath,
+ action_method: 'post',
+ }
+ if error_type == "api"
+ popup_params.merge!(
+ api_error_request_url: api_error.andand.request_url || "",
+ api_error_response: api_error.andand.api_response || "",
+ )
+ else
+ popup_params.merge!(error_message: error_message)
+ end
+%>
+
<p>
-<br/><strong>If you suspect this is a bug, you can help us fix it by sending us a problem report:</strong><br/><br/>
-<% if error_type == 'api' %>
- <%
- api_request_url = api_error.andand.request_url ? api_error.request_url : ''
- api_error_response = api_error.andand.api_response ? api_error.api_response : ''
- %>
- Send a problem report right here. <%= link_to report_issue_popup_path(popup_type: 'report', current_location: request.url, current_path: request.fullpath, action_method: 'post', api_error_request_url: api_request_url, api_error_response: api_error_response),
- {class: 'btn btn-primary report-issue-modal-window', :remote => true, return_to: request.url} do %>
- <i class="fa fa-fw fa-support"></i> Report problem
- <% end %>
-<% else %>
- Send a problem report right here. <%= link_to report_issue_popup_path(popup_type: 'report', current_location: request.url, current_path: request.fullpath, action_method: 'post', error_message: error_message),
- {class: 'btn btn-primary report-issue-modal-window', :remote => true, return_to: request.url} do %>
- <i class="fa fa-fw fa-support"></i> Report problem
- <% end %>
+<%= link_to(report_issue_popup_path(popup_params),
+ {class: 'btn btn-primary report-issue-modal-window', :remote => true, return_to: request.url}) do %>
+ <i class="fa fa-fw fa-support"></i> Report problem
<% end %>
-<% support_email = Rails.configuration.support_email_address%>
-<br/><br/>
- If you prefer, send email to: <a href="mailto:<%=support_email%>?subject=Workbench problem report&body=Problem while viewing page <%=request.url%>"><%=support_email%></a>
+
+or
+
+<%= mail_to(Rails.configuration.support_email_address, "email us",
+ subject: "Workbench problem report",
+ body: "Problem while viewing page #{request.url}") %>
+
+if you suspect this is a bug.
</p>
diff --git a/apps/workbench/test/controllers/projects_controller_test.rb b/apps/workbench/test/controllers/projects_controller_test.rb
index 3416cc0..8fa9fe9 100644
--- a/apps/workbench/test/controllers/projects_controller_test.rb
+++ b/apps/workbench/test/controllers/projects_controller_test.rb
@@ -239,7 +239,7 @@ class ProjectsControllerTest < ActionController::TestCase
Rails.configuration.anonymous_user_token = api_fixture('api_client_authorizations')['anonymous']['api_token']
get(:show, {id: api_fixture('groups')['aproject']['uuid']})
assert_response 404
- assert_includes @response.inspect, 'you are not logged in'
+ assert_match(/log ?in/i, @response.body)
end
test "visit home page as anonymous when anonymous browsing is enabled and expect login" do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list