<% emergency_banner ||= nil full_width ||= false global_bar ||= nil html_lang ||= "en" layout_helper = GovukPublishingComponents::Presenters::PublicLayoutHelper.new(local_assigns) logo_link ||= "/" navigation_items ||= [] omit_feedback_form ||= false omit_footer_navigation ||= false omit_header ||= false product_name ||= nil show_explore_header ||= false show_search = local_assigns.include?(:show_search) ? local_assigns[:show_search] : true title ||= "GOV.UK - The best place to find government services and information" # This is a hack - but it's the only way I can find to not have two blue bars on # constrained width layouts. # # The full width layout hides the blue bar underneath the blar header bar - so # full width pages won't see the blue bar unless it's added by another component # - and for most pages that component is the global banner. # # The constrained width layout doesn't hide the blue bar - so having the global # banner on a constrained width layout means there are two blue bars. # # The global banner is shown with JavaScript, so users without JavaScript won't # see it. So the constrained width blue bar can't be turned off as then it'll be # off for everyone. # # This booleon adds a CSS class that shifts the banners up by the blue bar's # height, making the two blue bars overlap and appear as one. The class is added # when a) there's content for the emergency or global banner *and* b) when using # the contrained width layout. blue_bar_dedupe = !full_width && global_bar.present? -%> <%= title %> <%= javascript_include_tag "govuk_publishing_components/vendor/lux/lux-measurer", { async: true } %> <%= javascript_include_tag "govuk_publishing_components/rum-loader", { async: true } %> <%= csrf_meta_tags %> <%= stylesheet_link_tag "application", media: "all" %> <%= stylesheet_link_tag "print", media: "print" %> "> "> "> "> <% # Ensure that older IE versions always render with the correct rendering engine %> <% # The default og:image is added below :head so that scrapers see any custom metatags first, and this is just a fallback %> "> <%= yield :head %> <%= render "govuk_publishing_components/components/skip_link", { href: "#content" } %> <%= render "govuk_publishing_components/components/cookie_banner" %> <% unless omit_header %> <% if show_explore_header %> <%= render "govuk_publishing_components/components/layout_super_navigation_header" %> <% else %> <%= render "govuk_publishing_components/components/layout_header", { search: show_search, logo_link: logo_link, navigation_items: navigation_items, product_name: product_name, # The (blue) bottom border needs to be underneath the emergency banner - # so it has been turned off and added in manually. remove_bottom_border: true, } %> <% end %> <% end %> <%= raw(emergency_banner) %> <% unless full_width %>
<% end %> <% if global_bar.present? %> <%= content_tag("div", { class: blue_bar_dedupe ? "gem-c-layout-for-public__global-banner-wrapper" : nil, }) do %> <%= raw(global_bar) %> <% end %> <% end %>
"> <%= yield :before_content %>
<%= yield %>
<% unless omit_feedback_form %>
<%= render "govuk_publishing_components/components/feedback" %>
<% end %> <% unless local_assigns[:hide_footer_links] %> <%= render "govuk_publishing_components/components/layout_footer", { with_border: true, navigation: omit_footer_navigation ? nil : layout_helper.footer_navigation, meta: layout_helper.footer_meta, } %> <% end %> <%= javascript_include_tag 'application' %>