2019-02-02 12:40:57 +01:00
|
|
|
module FoodsoftPrinter
|
|
|
|
class Engine < ::Rails::Engine
|
|
|
|
def navigation(primary, context)
|
|
|
|
return unless FoodsoftPrinter.enabled?
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2019-02-02 12:40:57 +01:00
|
|
|
unless primary[:orders].nil?
|
|
|
|
sub_nav = primary[:orders].sub_navigation
|
|
|
|
sub_nav.items <<
|
|
|
|
SimpleNavigation::Item.new(primary, :printer_jobs, I18n.t('navigation.orders.printer_jobs'), context.printer_jobs_path)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_foodsoft_config(cfg)
|
|
|
|
cfg[:use_printer] = false
|
|
|
|
end
|
|
|
|
|
|
|
|
initializer 'foodsoft_printer.order_printer_jobs' do |app|
|
|
|
|
if Rails.configuration.cache_classes
|
|
|
|
OrderPrinterJobs.install
|
|
|
|
else
|
2020-09-04 12:57:19 +02:00
|
|
|
ActiveSupport::Reloader.to_prepare do
|
2019-02-02 12:40:57 +01:00
|
|
|
OrderPrinterJobs.install
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|