From e604b37724f320225d37015439effe5e7b0292ec Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 9 Aug 2024 13:54:27 +0100 Subject: [PATCH] Align phase banner on service manual homepage Add new `service_manual_homepage?` presenter method. When on the service_manual_homepage, the phase banner will be wrapped in a div element with the `govuk-width-container` class to align it with the rest of the content on the page. The service manual homepage layout is different from the rest of the service manual as it contains an app-hero banner that needs to span the full width of the page with a blue background, but we still want the phase banner to be contained. --- app/presenters/content_item_presenter.rb | 4 ++++ app/presenters/service_manual_presenter.rb | 4 ++++ app/views/layouts/application.html.erb | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/app/presenters/content_item_presenter.rb b/app/presenters/content_item_presenter.rb index 850db6aa7..6b6999ee6 100644 --- a/app/presenters/content_item_presenter.rb +++ b/app/presenters/content_item_presenter.rb @@ -97,6 +97,10 @@ def service_manual? false end + def service_manual_homepage? + false + end + def render_guide_as_single_page? # /how-to-vote content_id == "9315bc67-33e7-42e9-8dea-e022f56dabfa" && voting_is_open? diff --git a/app/presenters/service_manual_presenter.rb b/app/presenters/service_manual_presenter.rb index 86d516fe1..363ac9758 100644 --- a/app/presenters/service_manual_presenter.rb +++ b/app/presenters/service_manual_presenter.rb @@ -15,6 +15,10 @@ def service_manual? true end + def service_manual_homepage? + content_item["document_type"] == "service_manual_homepage" + end + def show_phase_banner? false end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index feeb27d06..976e47209 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,7 +10,13 @@ <%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase %> <% end %> <% if @content_item.service_manual? %> + <% if @content_item.service_manual_homepage? %> +
+ <%= render_phase_label @content_item, content_for(:phase_message) %> +
+ <% else %> <%= render_phase_label @content_item, content_for(:phase_message) %> + <% end %> <% end %> <% if @content_item.show_default_breadcrumbs? %>