diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 18010d20b..15ea9e17f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -66,4 +66,18 @@ def render_govspeak(content, inverse: false) raw(Govspeak::Document.new(content, sanitize: false).to_html) end end + + def hide_global_bar? + paths_to_hide_global_bar_on = [ + "^/coronavirus$", + "^/coronavirus/.*$", + "^/transition(.cy)?$", + "^/transition-check/.*$", + "^/eubusiness(\\..*)?$", + ] + + concatenated_regexes = Regexp.new(paths_to_hide_global_bar_on.join("|")) + + request.path.match(concatenated_regexes).present? + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 695c21c48..ff7cb6c9d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,3 +1,10 @@ +<% + body_classes = %w[] + body_classes << content_for(:body_classes) if content_for(:body_classes) + body_classes << "full-width" if content_for(:is_full_width_header) + body_classes << "hide-global-bar" if hide_global_bar? +%> +
@@ -11,7 +18,7 @@ <%= stylesheet_link_tag "print.css", :media => "print", integrity: false %> - +<%= content_tag(:body, class: body_classes) do %>