18 lines
584 B
CoffeeScript
18 lines
584 B
CoffeeScript
Qsupplier.App.IndexController = Ember.ObjectController.extend
|
|
active_lists: (->
|
|
@get('lists').filterProperty('state', 'active')
|
|
).property('lists.@each.state')
|
|
|
|
active_orders: (->
|
|
@get('orders').filter (o)->(o.get('state') == 'active')
|
|
).property('orders.@each.state')
|
|
|
|
markListAsHelped: (id)->
|
|
list = Qsupplier.App.List.find(id)
|
|
list.set('needs_help', false)
|
|
$.post '/supplier/mark_list_as_helped', {list_id: id}
|
|
closeList: (id)->
|
|
list = Qsupplier.App.List.find(id)
|
|
list.set('state', 'closed')
|
|
$.post '/supplier/close_list', {list_id: id}
|