Skip to content

Commit

Permalink
Add "first_part" partial
Browse files Browse the repository at this point in the history
  • Loading branch information
leenagupte committed Sep 11, 2024
1 parent ebc9fbb commit 62f4de2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions app/views/travel_advice/_first_part.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<%= render 'govuk_publishing_components/components/metadata', content_item.metadata %>
<% if content_item.map %>
<figure class="map">
<img src="<%= content_item.map["url"] %>" alt="<%= content_item.map["alt_text"] %>" class="map-image">
<% if content_item.map_download_url %>
<figcaption>
<%= render 'components/download_link', href: content_item.map_download_url, link_text: "Download a more detailed map (PDF)" %>
</figcaption>
<% end %>
</figure>
<% end %>
2 changes: 1 addition & 1 deletion app/views/travel_advice/show.html+print.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<%= part['title'] %>
</h1>

<%= render 'shared/travel_advice_first_part', content_item: @content_item if i == 0 %>
<%= render 'first_part', content_item: @content_item if i == 0 %>
<%= render 'govuk_publishing_components/components/govspeak',
content: part['body'].html_safe,
Expand Down
2 changes: 1 addition & 1 deletion app/views/travel_advice/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<%= render 'govuk_publishing_components/components/heading', heading_level: 1, font_size: 'l', margin_bottom: 6, text: @content_item.current_part_title %>
<% if @content_item.no_part_slug_provided? %>
<%= render 'shared/travel_advice_first_part', content_item: @content_item %>
<%= render 'first_part', content_item: @content_item %>
<% end %>
<%= render 'govuk_publishing_components/components/govspeak', {
Expand Down

0 comments on commit 62f4de2

Please sign in to comment.