From 62fb6800ec434a4a1176c7513038e61cb9da2dc2 Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Thu, 19 Sep 2024 16:25:59 +0100 Subject: [PATCH] Move breadcrumbs out of main --- .../_service_manual_breadcrumbs.html.erb | 8 ++++++++ .../content_items/hmrc_manual_section.html.erb | 3 ++- app/views/content_items/manual_section.html.erb | 1 + .../content_items/manuals/_breadcrumbs.html.erb | 11 +++++++++++ .../manuals/_manual_section_layout.html.erb | 11 ----------- .../content_items/service_manual_guide.html.erb | 11 ++++++----- .../service_manual_service_standard.html.erb | 14 ++++++++------ .../content_items/service_manual_topic.html.erb | 7 +++---- app/views/histories/10_downing_street.html.erb | 17 +++++------------ app/views/histories/11_downing_street.html.erb | 17 +++++------------ .../histories/1_horse_guards_road.html.erb | 17 +++++------------ app/views/histories/_breadcrumbs.html.erb | 14 ++++++++++++++ .../histories/king_charles_street.html.erb | 17 +++++------------ app/views/histories/lancaster_house.html.erb | 17 +++++------------ 14 files changed, 78 insertions(+), 87 deletions(-) create mode 100644 app/views/content_items/_service_manual_breadcrumbs.html.erb create mode 100644 app/views/content_items/manuals/_breadcrumbs.html.erb create mode 100644 app/views/histories/_breadcrumbs.html.erb diff --git a/app/views/content_items/_service_manual_breadcrumbs.html.erb b/app/views/content_items/_service_manual_breadcrumbs.html.erb new file mode 100644 index 000000000..e6129e256 --- /dev/null +++ b/app/views/content_items/_service_manual_breadcrumbs.html.erb @@ -0,0 +1,8 @@ +
+
+ <%= render "govuk_publishing_components/components/breadcrumbs", { + breadcrumbs: @content_item.breadcrumbs, + collapse_on_mobile: true + } %> +
+
diff --git a/app/views/content_items/hmrc_manual_section.html.erb b/app/views/content_items/hmrc_manual_section.html.erb index 471abbab8..b3f82e6bd 100644 --- a/app/views/content_items/hmrc_manual_section.html.erb +++ b/app/views/content_items/hmrc_manual_section.html.erb @@ -7,6 +7,7 @@ green_background: true, type: I18n.t("manuals.hmrc_manual_type"), } %> + <%= render partial: "content_items/manuals/breadcrumbs" %> <% end %> <%= render "content_items/manuals/manual_section_layout" do %> @@ -27,4 +28,4 @@
<%= render "govuk_publishing_components/components/previous_and_next_navigation", @content_item.previous_and_next_links %>
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/content_items/manual_section.html.erb b/app/views/content_items/manual_section.html.erb index 55aebc534..e949a444f 100644 --- a/app/views/content_items/manual_section.html.erb +++ b/app/views/content_items/manual_section.html.erb @@ -3,6 +3,7 @@ <%= render "content_items/manuals/header", { content_item: @content_item, heading_level: 1, margin_bottom: 6, } %> + <%= render partial: "content_items/manuals/breadcrumbs" %> <% end %> <%= render "content_items/manuals/manual_section_layout", { show_contents: true } do %> diff --git a/app/views/content_items/manuals/_breadcrumbs.html.erb b/app/views/content_items/manuals/_breadcrumbs.html.erb new file mode 100644 index 000000000..758005ef8 --- /dev/null +++ b/app/views/content_items/manuals/_breadcrumbs.html.erb @@ -0,0 +1,11 @@ +<% if @content_item.breadcrumbs.any? %> + <%= render "govuk_publishing_components/components/breadcrumbs", { + border: "bottom", + breadcrumbs: @content_item.breadcrumbs, + collapse_on_mobile: false } %> +<% else %> + <%= render "govuk_publishing_components/components/back_link", { + text: t("manuals.breadcrumb_contents"), + href: @content_item.base_path + } %> +<% end %> diff --git a/app/views/content_items/manuals/_manual_section_layout.html.erb b/app/views/content_items/manuals/_manual_section_layout.html.erb index d90f5020b..c152f9d71 100644 --- a/app/views/content_items/manuals/_manual_section_layout.html.erb +++ b/app/views/content_items/manuals/_manual_section_layout.html.erb @@ -1,17 +1,6 @@ <% show_contents ||= false %> <% content_for :main do %> - <% if @content_item.breadcrumbs.any? %> - <%= render "govuk_publishing_components/components/breadcrumbs", { - border: "bottom", - breadcrumbs: @content_item.breadcrumbs, - collapse_on_mobile: false } %> - <% else %> - <%= render "govuk_publishing_components/components/back_link", { - text: t("manuals.breadcrumb_contents"), - href: @content_item.base_path - } %> - <% end %>
<% if show_contents %> <%= render "govuk_publishing_components/components/contents_list", { diff --git a/app/views/content_items/service_manual_guide.html.erb b/app/views/content_items/service_manual_guide.html.erb index 5a0c8ba9a..4b343c3ab 100644 --- a/app/views/content_items/service_manual_guide.html.erb +++ b/app/views/content_items/service_manual_guide.html.erb @@ -11,12 +11,13 @@ <%= render "shared/custom_phase_message", phase: @content_item.phase %> <% end %> -
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: @content_item.breadcrumbs, - collapse_on_mobile: true - } %> +<% content_for :header do %> +
+ <%= render partial: "content_items/service_manual_breadcrumbs" %> +
+<% end %> +
diff --git a/app/views/content_items/service_manual_service_standard.html.erb b/app/views/content_items/service_manual_service_standard.html.erb index d97bdd93f..ca5ad7b0e 100644 --- a/app/views/content_items/service_manual_service_standard.html.erb +++ b/app/views/content_items/service_manual_service_standard.html.erb @@ -4,12 +4,14 @@ <% content_for :phase_message do %> <%= render 'shared/custom_phase_message', phase: @content_item.phase %> <% end %> -
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: @content_item.breadcrumbs, - collapse_on_mobile: true - } %> +<% content_for :header do %> +
+ <%= render partial: "content_items/service_manual_breadcrumbs" %> +
+<% end %> + +
@@ -62,4 +64,4 @@
-
\ No newline at end of file +
diff --git a/app/views/content_items/service_manual_topic.html.erb b/app/views/content_items/service_manual_topic.html.erb index 2b461ff83..7076093ed 100644 --- a/app/views/content_items/service_manual_topic.html.erb +++ b/app/views/content_items/service_manual_topic.html.erb @@ -5,10 +5,9 @@ <%= render 'shared/custom_phase_message', phase: @content_item.phase %> <% end %> - <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: @content_item.breadcrumbs, - collapse_on_mobile: true - } %> +<% content_for :header do %> + <%= render partial: "content_items/service_manual_breadcrumbs" %> +<% end %>
diff --git a/app/views/histories/10_downing_street.html.erb b/app/views/histories/10_downing_street.html.erb index a5745e24f..226e6967e 100644 --- a/app/views/histories/10_downing_street.html.erb +++ b/app/views/histories/10_downing_street.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context: "History", title: "10 Downing Street", + margin_top: 0, } %>
diff --git a/app/views/histories/11_downing_street.html.erb b/app/views/histories/11_downing_street.html.erb index 64a3eb113..c77f9f8a3 100644 --- a/app/views/histories/11_downing_street.html.erb +++ b/app/views/histories/11_downing_street.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context: "History", title: "11 Downing Street", + margin_top: 0, } %>
diff --git a/app/views/histories/1_horse_guards_road.html.erb b/app/views/histories/1_horse_guards_road.html.erb index 2fb5a4913..00944e6e9 100644 --- a/app/views/histories/1_horse_guards_road.html.erb +++ b/app/views/histories/1_horse_guards_road.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context: "History", title: "1 Horse Guards Road", + margin_top: 0, } %>
diff --git a/app/views/histories/_breadcrumbs.html.erb b/app/views/histories/_breadcrumbs.html.erb new file mode 100644 index 000000000..691b1f774 --- /dev/null +++ b/app/views/histories/_breadcrumbs.html.erb @@ -0,0 +1,14 @@ +
+ <%= render "govuk_publishing_components/components/breadcrumbs", { + breadcrumbs: [ + { + title: "Home", + url: "/", + }, + { + title: "History of the UK Government", + url: "/government/history", + }, + ] + } %> +
diff --git a/app/views/histories/king_charles_street.html.erb b/app/views/histories/king_charles_street.html.erb index 62c9956e8..6c8b67037 100644 --- a/app/views/histories/king_charles_street.html.erb +++ b/app/views/histories/king_charles_street.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context: "History", title: "King Charles Street", + margin_top: 0, } %>
diff --git a/app/views/histories/lancaster_house.html.erb b/app/views/histories/lancaster_house.html.erb index f5a12e2ab..070210f3a 100644 --- a/app/views/histories/lancaster_house.html.erb +++ b/app/views/histories/lancaster_house.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context:"History", title: "Lancaster House", + margin_top: 0, } %>