diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index 3bea0915..365955d3 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -27,7 +27,8 @@ class ErrorsController < ApplicationController status_code: 500, message: I18n.t("errors.internal.message"), help: I18n.t("errors.internal.help"), - display_back: true + display_back: true, + report_issue: true } end diff --git a/app/views/errors/greenlight_error.html.erb b/app/views/errors/greenlight_error.html.erb index c7c83e74..0c75a78a 100644 --- a/app/views/errors/greenlight_error.html.erb +++ b/app/views/errors/greenlight_error.html.erb @@ -16,24 +16,29 @@
<% if defined?(status_code) %> - <%= status_code %> + <%= status_code %> <% else %> - 404 + 404 <% end %>
- <% if defined?(message) && defined?(help) %> -

<%= message %>

-

<%= help %>

- <% if defined?(display_back) && display_back %> - - <%= t("go_back") %> - - <% end %> - <% else %> -

<%= t("errors.not_found.message") %>

-

<%= t("errors.not_found.help") %>

- - <%= t("go_back") %> - + <% if defined?(message) && defined?(help) %> +

<%= message %>

+

<%= help %>

+ <% if defined?(display_back) && display_back %> + + <%= t("go_back") %> + <% end %> + <% if defined?(report_issue) && report_issue && Rails.configuration.report_issue_url.present? %> + + <%= t("errors.internal.report") %> + + <% end %> + <% else %> +

<%= t("errors.not_found.message") %>

+

<%= t("errors.not_found.help") %>

+ + <%= t("go_back") %> + + <% end %>
diff --git a/app/views/shared/_header.html.erb b/app/views/shared/_header.html.erb index 3ab6ce48..a563364c 100755 --- a/app/views/shared/_header.html.erb +++ b/app/views/shared/_header.html.erb @@ -76,6 +76,11 @@ <%= t("header.dropdown.help") %> + <% if Rails.configuration.report_issue_url.present? %> + + <%= t("errors.internal.report") %> + + <% end %> <%= link_to logout_path, class: "dropdown-item" do %> <%= t("header.dropdown.signout") %> <% end %> diff --git a/config/application.rb b/config/application.rb index 5d91cf18..ba49ce03 100644 --- a/config/application.rb +++ b/config/application.rb @@ -125,6 +125,8 @@ module Greenlight config.maintenance_window = ENV["MAINTENANCE_WINDOW"] config.maintenance_mode = ENV["MAINTENANCE_MODE"] == "true" + config.report_issue_url = ENV["REPORT_ISSUE_URL"] + # DEFAULTS # Default branding image if the user does not specify one diff --git a/config/locales/en.yml b/config/locales/en.yml index 0c5c68f2..0088c051 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -153,6 +153,7 @@ en: internal: message: Looks like something went wrong on our end. help: The error has been logged, we'll take a look! + report: Report Issue maintenance: message: Sorry, we're down for maintenance. help: We'll be back soon! diff --git a/sample.env b/sample.env index 7039efee..50cba33f 100644 --- a/sample.env +++ b/sample.env @@ -162,6 +162,12 @@ MAINTENANCE_MODE=false # Ex: MAINTENANCE_WINDOW=Friday August 18 6pm-10pm EST MAINTENANCE_WINDOW= +# The link to the Report an Issue button that appears on the 500 page and in the Account Dropdown +# +# Defaults to the Github Issues Page for Greenlight +# Button can be disabled by setting the value to blank +REPORT_ISSUE_URL=https://github.com/bigbluebutton/greenlight/issues/new + # Comment this out to send logs to STDOUT in production instead of log/production.log . # # RAILS_LOG_TO_STDOUT=true