2016-04-28 13:46:13 +02:00
|
|
|
module FoodsoftDocuments
|
|
|
|
class Engine < ::Rails::Engine
|
|
|
|
def navigation(primary, context)
|
|
|
|
return unless FoodsoftDocuments.enabled?
|
|
|
|
return if primary[:foodcoop].nil?
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2016-04-28 13:46:13 +02:00
|
|
|
sub_nav = primary[:foodcoop].sub_navigation
|
|
|
|
sub_nav.items <<
|
|
|
|
SimpleNavigation::Item.new(primary, :documents, I18n.t('navigation.documents'), context.documents_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))
|
2016-04-28 13:46:13 +02:00
|
|
|
end
|
2017-10-11 02:39:35 +02:00
|
|
|
|
|
|
|
def default_foodsoft_config(cfg)
|
|
|
|
cfg[:documents_allowed_extension] = 'gif jpg png txt'
|
|
|
|
end
|
2016-04-28 13:46:13 +02:00
|
|
|
end
|
|
|
|
end
|