2017-11-05 22:16:32 +01:00
|
|
|
module FoodsoftPolls
|
|
|
|
class Engine < ::Rails::Engine
|
|
|
|
def navigation(primary, context)
|
|
|
|
return unless FoodsoftPolls.enabled?
|
|
|
|
return if primary[:foodcoop].nil?
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2017-11-05 22:16:32 +01:00
|
|
|
sub_nav = primary[:foodcoop].sub_navigation
|
|
|
|
sub_nav.items <<
|
|
|
|
SimpleNavigation::Item.new(primary, :polls, I18n.t('navigation.polls'), context.polls_path)
|
|
|
|
# move to right before tasks item
|
2023-05-12 13:01:12 +02:00
|
|
|
return unless i = sub_nav.items.index(sub_nav[:tasks])
|
|
|
|
|
|
|
|
sub_nav.items.insert(i, sub_nav.items.delete_at(-1))
|
2017-11-05 22:16:32 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|