From 9111fa75360b980e2d7246cfb32b78492fa53e7e Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Wed, 6 Dec 2023 09:30:02 +0000 Subject: [PATCH] feat: update locations tab breadcrumbs to show owning scheme --- app/views/locations/index.html.erb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views/locations/index.html.erb b/app/views/locations/index.html.erb index b88ca74e7..82cc4a0c9 100644 --- a/app/views/locations/index.html.erb +++ b/app/views/locations/index.html.erb @@ -2,10 +2,16 @@ <% title = format_title(@searched, @scheme.service_name, current_user, item_label, @pagy.count, nil) %> <% content_for :title, title %> -<% content_for :before_content do %> - <%= govuk_back_link( - href: "/schemes/#{@scheme.id}", - ) %> +<% if current_user.support? %> + <% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: { + "Schemes (#{@scheme.owning_organisation.name})" => schemes_organisation_path(@scheme.owning_organisation), + content_for(:title) => scheme_path(@scheme), + "Locations" => "", + }) %> +<% else %> + <% content_for :before_content do %> + <%= govuk_back_link(href: "/schemes/#{@scheme.id}") %> + <% end %> <% end %> <%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %>