Qsupplier.App.ApplicationRoute = Ember.Route.extend
  beforeModel: ->
    # Preload only active lists and orders
    @store.find 'product_category'
    #@store.find 'order', state: 'active' included in list
  setupController: (controller)->
    @store.find 'list', state: 'active'
    controller.set 'product_categories', @store.all('product_category')
  actions:
    openModal: (modalName, model)->
      @controllerFor(modalName).set('model', model)
      @render modalName,
        into: 'application'
        outlet: 'modal'
    closeModal: ->
      @disconnectOutlet
        outlet: 'modal'
        parentView: 'application'
    confirm: (options = {})->
      @send 'openModal', 'modal_confirm', Ember.Object.create
        title: options.title
        body: options.body
        cancel: options.cancel
        ok: options.ok
