fix simple_navigation ids

This commit is contained in:
wvengen 2014-03-20 19:11:37 +01:00
parent f77b5d1516
commit d7938b752c
2 changed files with 23 additions and 21 deletions

View file

@ -0,0 +1,2 @@
# do not generate id elements as they're used at other places too, breaking js
SimpleNavigation.config.autogenerate_item_ids = false

View file

@ -13,38 +13,38 @@ SimpleNavigation::Configuration.run do |navigation|
primary.item :dashboard_nav_item, I18n.t('navigation.dashboard'), root_path(anchor: '')
primary.item :foodcoop, I18n.t('navigation.foodcoop'), '#', id: nil do |subnav|
subnav.item :members, I18n.t('navigation.members'), foodcoop_users_path, id: nil
subnav.item :workgroups, I18n.t('navigation.workgroups'), foodcoop_workgroups_path, id: nil
subnav.item :ordergroups, I18n.t('navigation.ordergroups'), foodcoop_ordergroups_path, id: nil
subnav.item :tasks, I18n.t('navigation.tasks'), tasks_path, id: nil
primary.item :foodcoop, I18n.t('navigation.foodcoop'), '#' do |subnav|
subnav.item :members, I18n.t('navigation.members'), foodcoop_users_path
subnav.item :workgroups, I18n.t('navigation.workgroups'), foodcoop_workgroups_path
subnav.item :ordergroups, I18n.t('navigation.ordergroups'), foodcoop_ordergroups_path
subnav.item :tasks, I18n.t('navigation.tasks'), tasks_path
end
primary.item :orders, I18n.t('navigation.orders.title'), '#', id: nil do |subnav|
subnav.item :ordering, I18n.t('navigation.orders.ordering'), group_orders_path, id: nil
subnav.item :ordering_archive, I18n.t('navigation.orders.archive'), archive_group_orders_path, id: nil
subnav.item :orders, I18n.t('navigation.orders.manage'), orders_path, if: Proc.new { current_user.role_orders? }, id: nil
primary.item :orders, I18n.t('navigation.orders.title'), '#' do |subnav|
subnav.item :ordering, I18n.t('navigation.orders.ordering'), group_orders_path
subnav.item :ordering_archive, I18n.t('navigation.orders.archive'), archive_group_orders_path
subnav.item :orders, I18n.t('navigation.orders.manage'), orders_path, if: Proc.new { current_user.role_orders? }
end
primary.item :articles, I18n.t('navigation.articles.title'), '#', id: nil,
primary.item :articles, I18n.t('navigation.articles.title'), '#',
if: Proc.new { current_user.role_article_meta? or current_user.role_suppliers? } do |subnav|
subnav.item :suppliers, I18n.t('navigation.articles.suppliers'), suppliers_path, id: nil
subnav.item :stockit, I18n.t('navigation.articles.stock'), stock_articles_path, id: nil
subnav.item :categories, I18n.t('navigation.articles.categories'), article_categories_path, id: nil
subnav.item :suppliers, I18n.t('navigation.articles.suppliers'), suppliers_path
subnav.item :stockit, I18n.t('navigation.articles.stock'), stock_articles_path
subnav.item :categories, I18n.t('navigation.articles.categories'), article_categories_path
end
primary.item :finance, I18n.t('navigation.finances.title'), '#', id: nil, if: Proc.new { current_user.role_finance? } do |subnav|
primary.item :finance, I18n.t('navigation.finances.title'), '#', if: Proc.new { current_user.role_finance? } do |subnav|
subnav.item :finance_home, I18n.t('navigation.finances.home'), finance_root_path
subnav.item :accounts, I18n.t('navigation.finances.accounts'), finance_ordergroups_path, id: nil
subnav.item :balancing, I18n.t('navigation.finances.balancing'), finance_order_index_path, id: nil
subnav.item :invoices, I18n.t('navigation.finances.invoices'), finance_invoices_path, id: nil
subnav.item :accounts, I18n.t('navigation.finances.accounts'), finance_ordergroups_path
subnav.item :balancing, I18n.t('navigation.finances.balancing'), finance_order_index_path
subnav.item :invoices, I18n.t('navigation.finances.invoices'), finance_invoices_path
end
primary.item :admin, I18n.t('navigation.admin.title'), '#', id: nil, if: Proc.new { current_user.role_admin? } do |subnav|
primary.item :admin, I18n.t('navigation.admin.title'), '#', if: Proc.new { current_user.role_admin? } do |subnav|
subnav.item :admin_home, I18n.t('navigation.admin.home'), admin_root_path
subnav.item :users, I18n.t('navigation.admin.users'), admin_users_path, id: nil
subnav.item :ordergroups, I18n.t('navigation.admin.ordergroups'), admin_ordergroups_path, id: nil
subnav.item :workgroups, I18n.t('navigation.admin.workgroups'), admin_workgroups_path, id: nil
subnav.item :users, I18n.t('navigation.admin.users'), admin_users_path
subnav.item :ordergroups, I18n.t('navigation.admin.ordergroups'), admin_ordergroups_path
subnav.item :workgroups, I18n.t('navigation.admin.workgroups'), admin_workgroups_path
end
engines.each { |e| e.navigation(primary, self) }