From 1487f411f6068f1c052ed6109615dea39c8a18e7 Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 10 Jun 2022 10:09:51 +0100 Subject: [PATCH] highlight nav tab --- app/helpers/navigation_items_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/navigation_items_helper.rb b/app/helpers/navigation_items_helper.rb index d6e2f9aaa..6c56db96c 100644 --- a/app/helpers/navigation_items_helper.rb +++ b/app/helpers/navigation_items_helper.rb @@ -12,7 +12,7 @@ module NavigationItemsHelper elsif current_user.data_coordinator? [ NavigationItem.new("Logs", case_logs_path, logs_current?(path)), - NavigationItem.new("Supported housing", "/supported-housing", supported_housing_current?(path)), + NavigationItem.new("Supported housing", "/supported-housing", subnav_supported_housing_path?(path)), NavigationItem.new("Users", users_organisation_path(current_user.organisation), subnav_users_path?(path)), NavigationItem.new("About your organisation", "/organisations/#{current_user.organisation.id}", subnav_details_path?(path)), ] @@ -51,6 +51,10 @@ private path == "/organisations" || subnav_users_path?(path) || subnav_logs_path?(path) || subnav_details_path?(path) end + def subnav_supported_housing_path?(path) + path.include?("/organisations") && path.include?("/supported-housing") + end + def subnav_users_path?(path) path.include?("/organisations") && path.include?("/users") end