Browse Source

highlight nav tab

pull/648/head
JG 3 years ago
parent
commit
1487f411f6
  1. 6
      app/helpers/navigation_items_helper.rb

6
app/helpers/navigation_items_helper.rb

@ -12,7 +12,7 @@ module NavigationItemsHelper
elsif current_user.data_coordinator? elsif current_user.data_coordinator?
[ [
NavigationItem.new("Logs", case_logs_path, logs_current?(path)), 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("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)), 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) path == "/organisations" || subnav_users_path?(path) || subnav_logs_path?(path) || subnav_details_path?(path)
end end
def subnav_supported_housing_path?(path)
path.include?("/organisations") && path.include?("/supported-housing")
end
def subnav_users_path?(path) def subnav_users_path?(path)
path.include?("/organisations") && path.include?("/users") path.include?("/organisations") && path.include?("/users")
end end

Loading…
Cancel
Save