g
sort supplier dashboard from old to new
This commit is contained in:
@@ -5,17 +5,19 @@ App.IndexController = Ember.ObjectController.extend
|
||||
sections: (-> @store.all('section')).property()
|
||||
active_lists: (->
|
||||
if @get('controllers.application.active_section.id')
|
||||
@get('lists').filter (l)=>( l.get('section.id') == @get('controllers.application.active_section.id') && l.get('state') == 'active' )
|
||||
lists = @get('lists').filter (l)=>( l.get('section.id') == @get('controllers.application.active_section.id') && l.get('state') == 'active' )
|
||||
else
|
||||
@get('lists').filterProperty('state', 'active')
|
||||
lists = @get('lists').filterProperty('state', 'active')
|
||||
lists.sortBy('created_at') # Not reversed, oldest on top, start with oldest order first :-) Customer happyness
|
||||
).property('lists.@each.state', 'controllers.application.active_section.id')
|
||||
|
||||
active_section: (-> @get('controllers.application.active_section')).property('controllers.application.active_section')
|
||||
active_orders: (->
|
||||
if @get('active_section.id')
|
||||
@get('orders').filter (o)=>( o.get('section.id') == @get('active_section.id') && o.get('needs_supplier_attention') )
|
||||
orders = @get('orders').filter (o)=>( o.get('section.id') == @get('active_section.id') && o.get('needs_supplier_attention') )
|
||||
else
|
||||
@get('orders').filter (o)->( o.get('needs_supplier_attention') )
|
||||
orders = @get('orders').filter (o)->( o.get('needs_supplier_attention') )
|
||||
orders.sortBy('created_at') # Not reversed, oldest on top, start with oldest order first :-) Customer happyness
|
||||
).property('orders.@each.state', 'active_section.id')
|
||||
|
||||
actions:
|
||||
|
||||
Reference in New Issue
Block a user