2013-10-29 22:22:24 +01:00
|
|
|
module FoodsoftWiki
|
|
|
|
class Engine < ::Rails::Engine
|
|
|
|
def navigation(primary, ctx)
|
2014-04-05 18:47:16 +02:00
|
|
|
return unless FoodsoftWiki.enabled?
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2013-10-29 22:22:24 +01:00
|
|
|
primary.item :wiki, I18n.t('navigation.wiki.title'), '#', id: nil do |subnav|
|
|
|
|
subnav.item :wiki_home, I18n.t('navigation.wiki.home'), ctx.wiki_path, id: nil
|
|
|
|
subnav.item :all_pages, I18n.t('navigation.wiki.all_pages'), ctx.all_pages_path, id: nil
|
|
|
|
end
|
|
|
|
# move this last added item to just after the foodcoop menu
|
2023-05-12 13:01:12 +02:00
|
|
|
return unless i = primary.items.index(primary[:foodcoop])
|
|
|
|
|
|
|
|
primary.items.insert(i + 1, primary.items.delete_at(-1))
|
2013-10-29 22:22:24 +01:00
|
|
|
end
|
2014-06-23 10:10:21 +02:00
|
|
|
|
|
|
|
def default_foodsoft_config(cfg)
|
|
|
|
cfg[:use_wiki] = true
|
|
|
|
end
|
2016-08-08 21:17:42 +02:00
|
|
|
|
2023-05-12 13:01:12 +02:00
|
|
|
initializer 'foodsoft_wiki.assets.precompile' do |app|
|
|
|
|
app.config.assets.precompile += %w[icons/feed-icon-14x14.png]
|
2016-08-08 21:17:42 +02:00
|
|
|
end
|
2013-10-29 22:22:24 +01:00
|
|
|
end
|
|
|
|
end
|