Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explore_header templates #2515

Merged
merged 2 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%
show_super_navigation_header ||= false # will be shown or hidden by A/B Test variable
show_super_navigation_header = content_for?(:show_explore_header) ? yield(:show_explore_header) : false # will be shown or hidden by A/B Test variable
%>

<% if show_super_navigation_header %>
Expand Down
2 changes: 2 additions & 0 deletions app/views/root/_base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<%= render :partial => 'stylesheet', :locals => { :css_file => local_assigns[:css_file] || 'application' } %>
<% end %>

<% content_for :show_explore_header, local_assigns[:show_explore_header] %>

<% content_for :inside_header do %>
<button class="search-toggle js-header-toggle" data-search-toggle-for="search">Show or hide search</button>
<%
Expand Down
10 changes: 6 additions & 4 deletions app/views/root/_gem_base.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<%
@emergency_banner = emergency_banner_notification

product_name ||= nil
omit_feedback_form ||= nil
logo_link ||= Plek.new.website_root.present? ? Plek.new.website_root : "https://www.gov.uk/"
full_width ||= false
omit_feedback_form ||= nil
product_name ||= nil
show_explore_header ||= false

if @emergency_banner
emergency_banner = render "components/emergency_banner", {
Expand All @@ -23,10 +24,8 @@
<%= render "govuk_publishing_components/components/layout_for_public", {
emergency_banner: emergency_banner.presence,
full_width: full_width,
omit_feedback_form: omit_feedback_form,
global_bar: user_satisfaction_survey + global_bar,
logo_link: logo_link,
product_name: product_name,
navigation_items: [ # Remember to update the links in _base.html.erb as well.
{
text: "Account",
Expand All @@ -52,5 +51,8 @@
link_for: "accounts-signed-out",
},
}],
omit_feedback_form: omit_feedback_form,
product_name: product_name,
show_explore_header: show_explore_header,
title: content_for?(:title) ? yield(:title) : "GOV.UK - The best place to find government services and information",
} %>
7 changes: 7 additions & 0 deletions app/views/root/core_layout_explore_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<%= render partial: 'base', locals: {
hide_nav: true, # no breadcrumbs, you can include them using components if
# you need them, rather than using slimmer
show_explore_header: true,
css_file: 'core-layout',
js_file: 'header-footer-only'
} %>
1 change: 1 addition & 0 deletions app/views/root/gem_layout_explore_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= render partial: "gem_base", locals: { show_explore_header: true } %>
2 changes: 1 addition & 1 deletion app/views/root/header_footer_only.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render partial: 'base', locals: {
css_file: 'header-footer-only',
js_file: 'header-footer-only'
js_file: 'header-footer-only',
} %>
5 changes: 5 additions & 0 deletions app/views/root/header_footer_only_explore_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<%= render partial: 'base', locals: {
css_file: 'header-footer-only',
js_file: 'header-footer-only',
show_explore_header: true,
} %>