Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / views / application / _report_error.html.erb
index 2e449b79d718ef53d7c7e507f46509867447ee2d..6027208b28272f2d01fc3936258e3088d1fd4a4a 100644 (file)
@@ -1,21 +1,35 @@
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
+<%
+   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&amp;body=Problem while viewing page <%=request.url%>"><%=support_email%></a>
+
+or
+
+<%= mail_to(Rails.configuration.Mail.SupportEmailAddress, "email us",
+            subject: "Workbench problem report",
+            body: "Problem while viewing page #{request.url}") %>
+
+if you suspect this is a bug.
 </p>