diff --git a/app/assets/stylesheets/views/_landing_page.scss b/app/assets/stylesheets/views/_landing_page.scss new file mode 100644 index 0000000000..3da2446f28 --- /dev/null +++ b/app/assets/stylesheets/views/_landing_page.scss @@ -0,0 +1,24 @@ +@import "govuk_publishing_components/individual_component_support"; + +.landing-page-header { + // I've used the hex value for the background colour as it doesn't exist in the colour palette + background-color: #231F20; +} + +.landing-page-header__blue-bar { + background-color: govuk-colour("blue"); + height: govuk-spacing(2); +} + +.landing-page-header__org { + padding-top: govuk-spacing(2); + padding-bottom: govuk-spacing(6); + + // I've added this styling here rather than in the gem because it's application specific + // and it would introduce further work to make this variation work in the gem without + // affecting the other variants. + // TODO add this as a variant in the components gem. + .gem-c-organisation-logo__link:link:not(:hover) { + text-decoration: none; + } +} diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 028003b108..822a0f36c2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -28,4 +28,14 @@ def wrapper_class(publication = nil) def current_path_without_query_string request.original_fullpath.split("?", 2).first end + + def remove_breadcrumbs(content_item) + remove_breadcrumbs = false + + if content_item.respond_to?(:is_a_landing_page?) && content_item.is_a_landing_page? + remove_breadcrumbs = true + end + + remove_breadcrumbs + end end diff --git a/app/views/landing_page/show.html.erb b/app/views/landing_page/show.html.erb index 736c8bd070..f92d41987c 100644 --- a/app/views/landing_page/show.html.erb +++ b/app/views/landing_page/show.html.erb @@ -1,3 +1,27 @@ +<% + add_view_stylesheet("landing_page") +%> + +
+
+
+
+ + <%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: Hash.new, inverse: true %> + +
+ <%= render "govuk_publishing_components/components/organisation_logo", { + organisation: { + name: sanitize("Prime Minister's Office
10 Downing Street"), + url: "/government/organisations/prime-ministers-office-10-downing-street", + brand: "prime-ministers-office-10-downing-street", + crest: "eo", + }, + inverse: true, + } %> +
+
+
<% @content_item.blocks.each do |block| %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a1fa282d02..bb0c3e2599 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,7 +7,7 @@ <% if publication && publication.in_beta %> <%= render 'govuk_publishing_components/components/phase_banner', phase: "beta" %> <% end %> - <% unless current_page?(root_path) || !(publication || @calendar) %> + <% unless current_page?(root_path) || !(publication || @calendar) || remove_breadcrumbs(content_item) %> <%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: content_item_hash %> <% end %> <% if local_assigns %> diff --git a/config/initializers/dartsass.rb b/config/initializers/dartsass.rb index 1c29cc1c3f..7704c62144 100644 --- a/config/initializers/dartsass.rb +++ b/config/initializers/dartsass.rb @@ -13,6 +13,7 @@ "views/_place-list.scss" => "views/_place-list.css", "views/_popular_links.scss" => "views/_popular_links.css", "views/_travel-advice.scss" => "views/_travel-advice.css", + "views/_landing_page.scss" => "views/_landing_page.css", "views/_landing_page/card.scss" => "views/_landing_page/card.css", "views/_landing_page/hero.scss" => "views/_landing_page/hero.css", "views/_landing_page/featured.scss" => "views/_landing_page/featured.css", diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 35fcf6ccfd..7ff77f398f 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -48,4 +48,30 @@ def dummy_publication expect(current_path_without_query_string).to eq("/foo/bar") end end + + describe "#remove_breadcrumbs" do + describe "when is_landing_page? is true" do + let(:content_item) { ContentItem.new({ "schema" => "landing_page" }) } + + it "removes breadcrumbs" do + expect(remove_breadcrumbs(content_item)).to eq(true) + end + end + + describe "when is_landing_page? is false" do + let(:content_item) { ContentItem.new({ "schema" => "a_different_page" }) } + + it "does not remove breadcrumbs" do + expect(remove_breadcrumbs(content_item)).to eq(false) + end + end + + describe "when is_landing_page? is undefined" do + let(:content_item) { ContentItem.new({}) } + + it "does not remove breadcrumbs" do + expect(remove_breadcrumbs(content_item)).to eq(false) + end + end + end end