Skip to content

Commit

Permalink
Restructure admin navigation (#1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
codez authored Nov 26, 2024
1 parent a43f15a commit 048da8d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
6 changes: 6 additions & 0 deletions app/views/shared/_admin_nav_event_sac_cas.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- if can?(:index, Event::Level)
= nav Event::Level.model_name.human(count: 2), event_levels_path, %w(event_levels)
- if can?(:index, CourseCompensationRate)
= nav CourseCompensationRate.model_name.human(count: 2), course_compensation_rates_path, %w(course_compensation_rates)
- if can?(:index, CourseCompensationCategory)
= nav CourseCompensationCategory.model_name.human(count: 2), course_compensation_categories_path, %w(course_compensation_categories)
5 changes: 0 additions & 5 deletions app/views/shared/_admin_nav_kinds_nav_sac_cas.html.haml

This file was deleted.

10 changes: 4 additions & 6 deletions app/views/shared/_admin_nav_main_sac_cas.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
- if can?(:index, Event::Level)
= nav Event::Level.model_name.human(count: 2), event_levels_path, %w(event_levels)
- if can?(:index, TerminationReason)
= nav TerminationReason.model_name.human(count: 2), termination_reasons_path, %w(termination_reasons)
- if can?(:index, CourseCompensationRate)
= nav CourseCompensationRate.model_name.human(count: 2), course_compensation_rates_path, %w(course_compensation_rates)
- if can?(:index, CourseCompensationCategory)
= nav CourseCompensationCategory.model_name.human(count: 2), course_compensation_categories_path, %w(course_compensation_categories)
- if can?(:index, CostCenter)
= nav CostCenter.model_name.human(count: 2), cost_centers_path, %w(cost_centers)
- if can?(:index, CostUnit)
= nav CostUnit.model_name.human(count: 2), cost_units_path, %w(cost_units)
4 changes: 1 addition & 3 deletions lib/hitobito_sac_cas/wagon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ class Wagon < Rails::Engine

HouseholdAsideComponent.prepend SacCas::HouseholdAsideComponent
HouseholdAsideMemberComponent.prepend SacCas::HouseholdAsideMemberComponent
admin = NavigationHelper::MAIN.find { |opts| opts[:label] == :admin }
admin[:active_for] << "event_levels"

## Abilities
Role::Types::Permissions << :read_all_people
Expand Down Expand Up @@ -146,7 +144,7 @@ class Wagon < Rails::Engine
StandardFormBuilder.prepend SacCas::StandardFormBuilder

admin_item = NavigationHelper::MAIN.find { |item| item[:label] == :admin }
admin_item[:active_for] += %w[cost_centers cost_units termination_reasons course_compensation_categories course_compensation_rates]
admin_item[:active_for] += %w[cost_centers cost_units event_levels termination_reasons course_compensation_categories course_compensation_rates]

## Controllers
ApplicationController.include BasicAuth if Settings.basic_auth
Expand Down

0 comments on commit 048da8d

Please sign in to comment.