From a15dde47e5ab8a562a03f04d65a7c2bc9369a4ff Mon Sep 17 00:00:00 2001 From: radhika Date: Thu, 14 Aug 2014 10:35:51 -0400 Subject: [PATCH] 3112: add "report issue" button to 404 error page --- apps/workbench/app/views/application/404.html.erb | 10 ++++++++++ .../app/views/application/_report_issue_popup.html.erb | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/workbench/app/views/application/404.html.erb b/apps/workbench/app/views/application/404.html.erb index fd97295956..ae7dc223b7 100644 --- a/apps/workbench/app/views/application/404.html.erb +++ b/apps/workbench/app/views/application/404.html.erb @@ -4,6 +4,7 @@ class_name_h = class_name.humanize(capitalize: false) req_item = safe_join([class_name_h, " with UUID ", raw(""), params[:uuid], raw("")], "") + req_item_plain_text = safe_join([class_name_h, " with UUID ", params[:uuid]]) else req_item = "page you requested" end @@ -20,3 +21,12 @@ Perhaps you'd like to

+

+
+<% error_message = "The #{req_item_plain_text} was not found." %> +Would you like to report this problem? +<%= link_to report_issue_popup_path(popup_type: 'report', current_location: request.fullpath, action_method: 'post', error_message: error_message), + {class: 'btn btn-primary report-issue-modal-window', 'data-toggle' => "modal", 'data-target' => '#report-issue-modal-window', :remote => true, return_to: request.url} do %> + Report problem +<% end %> +

diff --git a/apps/workbench/app/views/application/_report_issue_popup.html.erb b/apps/workbench/app/views/application/_report_issue_popup.html.erb index c1534a162d..105af38c90 100644 --- a/apps/workbench/app/views/application/_report_issue_popup.html.erb +++ b/apps/workbench/app/views/application/_report_issue_popup.html.erb @@ -7,9 +7,8 @@ additional_info = {} additional_info['Current Location'] = @popup_params[:current_location] - if current_user - additional_info['User email'] = current_user.email - end + additional_info['User email'] = current_user.email if current_user + additional_info_str = additional_info.map {|k,v| "#{k}=#{v}"}.join("\n") additional_info['api_version'] = api_version @@ -17,6 +16,7 @@ additional_info['workbench_version'] = wb_version additional_info['arvados_base'] = arvados_base additional_info['support_email'] = support_email + additional_info['error_message'] = @popup_params[:error_message] if @popup_params[:error_message] %>