Skip to content

Commit e604b37

Browse files
committed
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.
1 parent b8759f9 commit e604b37

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

app/presenters/content_item_presenter.rb

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ def service_manual?
9797
false
9898
end
9999

100+
def service_manual_homepage?
101+
false
102+
end
103+
100104
def render_guide_as_single_page?
101105
# /how-to-vote
102106
content_id == "9315bc67-33e7-42e9-8dea-e022f56dabfa" && voting_is_open?

app/presenters/service_manual_presenter.rb

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def service_manual?
1515
true
1616
end
1717

18+
def service_manual_homepage?
19+
content_item["document_type"] == "service_manual_homepage"
20+
end
21+
1822
def show_phase_banner?
1923
false
2024
end

app/views/layouts/application.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
<%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase %>
1111
<% end %>
1212
<% if @content_item.service_manual? %>
13+
<% if @content_item.service_manual_homepage? %>
14+
<div class="govuk-width-container">
15+
<%= render_phase_label @content_item, content_for(:phase_message) %>
16+
</div>
17+
<% else %>
1318
<%= render_phase_label @content_item, content_for(:phase_message) %>
19+
<% end %>
1420
<% end %>
1521

1622
<% if @content_item.show_default_breadcrumbs? %>

0 commit comments

Comments
 (0)