Files
mozo-backend/app/assets/javascripts/supplier/app/controllers/application_controller.js.coffee
T
2015-02-13 12:37:01 +01:00

31 lines
1.2 KiB
CoffeeScript

App.ApplicationController = Ember.Controller.extend
active_section: null
flash_message: ''
#init: ->
#success = (supplier)=>
## A supplier record with id current and with the content of the returned supplier is created
## at the moment remove the dummy supplier, this should be resolved by Ember eventually
#if error_supplier = @store.all('supplier').findBy('id', 'current')
#error_supplier.eraseRecord()
#@set 'supplier', supplier
#error = (emberError)=>
#if error_supplier = @store.all('supplier').findBy('id', 'current')
#error_supplier.eraseRecord()
#@set 'supplier', null
#@store.find('supplier', 'current').then success, error
# @set 'supplier', @store.find('supplier', supplier_id)
actions:
signOut: ->
window.location = Routes.destroy_supplier_session_path()
markSupplierClosed: ->
return unless supplier = @get('supplier')
supplier.close()
markSupplierOpen: ->
return unless supplier = @get('supplier')
supplier.open_the_place()
showSupplierStatusInfo: ->
@modal 'supplier_status_info',
model: @get('supplier')
title_path: 'supplier_status_info.title'