|
|
@ -2,7 +2,7 @@ module NavigationItemsHelper |
|
|
|
NavigationItem = Struct.new(:text, :href, :current, :classes) |
|
|
|
NavigationItem = Struct.new(:text, :href, :current, :classes) |
|
|
|
|
|
|
|
|
|
|
|
def primary_items(path, current_user) |
|
|
|
def primary_items(path, current_user) |
|
|
|
if current_user.support? |
|
|
|
items = if current_user.support? |
|
|
|
[ |
|
|
|
[ |
|
|
|
NavigationItem.new("Organisations", organisations_path, organisations_current?(path)), |
|
|
|
NavigationItem.new("Organisations", organisations_path, organisations_current?(path)), |
|
|
|
NavigationItem.new("Users", "/users", users_current?(path)), |
|
|
|
NavigationItem.new("Users", "/users", users_current?(path)), |
|
|
@ -24,9 +24,11 @@ module NavigationItemsHelper |
|
|
|
FeatureToggle.sales_log_enabled? ? NavigationItem.new("Sales logs", sales_logs_path, sales_logs_current?(path)) : nil, |
|
|
|
FeatureToggle.sales_log_enabled? ? NavigationItem.new("Sales logs", sales_logs_path, sales_logs_current?(path)) : nil, |
|
|
|
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)), |
|
|
|
managing_agents_item, |
|
|
|
|
|
|
|
].compact |
|
|
|
].compact |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# figure out correct rules |
|
|
|
|
|
|
|
items << managing_agents_item(path) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def secondary_items(path, current_organisation_id) |
|
|
|
def secondary_items(path, current_organisation_id) |
|
|
@ -97,7 +99,7 @@ private |
|
|
|
path.include?("/managing-agents") |
|
|
|
path.include?("/managing-agents") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def managing_agents_item |
|
|
|
def managing_agents_item(path) |
|
|
|
return unless FeatureToggle.managing_agents_enabled? |
|
|
|
return unless FeatureToggle.managing_agents_enabled? |
|
|
|
return unless current_user.organisation.holds_own_stock? |
|
|
|
return unless current_user.organisation.holds_own_stock? |
|
|
|
|
|
|
|
|
|
|
|