Style upgrades and emberified supplier lists
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
App.ListController = Ember.ObjectController.extend
|
||||
list: (-> @get('model')).property('model')
|
||||
showTotal: (->
|
||||
if @get('list.orders.length') && @get('list.orders.length') > 1 then true else false
|
||||
).property('list.orders.length')
|
||||
|
||||
@@ -4,6 +4,8 @@ App.ProductOrdersController = Ember.ArrayController.extend
|
||||
#Math.round(Math.random()*100)
|
||||
@get('model').getEach('total').reduce(((sum, total) -> sum + total), 0)
|
||||
).property('model.@each.quantity')
|
||||
product_orders: (->@get('model')).property('model')
|
||||
showTotal: (-> if @get('model.length') && @get('model.length') > 1 then true else false ).property('model.length')
|
||||
actions:
|
||||
clearProductOrders: ->
|
||||
#TODO: make clearing of unpersisted product orders
|
||||
|
||||
@@ -7,7 +7,7 @@ if list.orders
|
||||
= order.display
|
||||
span.currency= currency order.total
|
||||
span.created_at= time order.created_at
|
||||
if displayTotal
|
||||
if showTotal
|
||||
.list-orders-total.total
|
||||
= t 'total'
|
||||
span.currency= currency model.total
|
||||
|
||||
@@ -4,7 +4,7 @@ if modelDisabled
|
||||
.clearfix
|
||||
.panel
|
||||
ul.product-orders
|
||||
each product_order in controller
|
||||
each product_order in product_orders
|
||||
li.product_order
|
||||
= product_order.quantity
|
||||
| x
|
||||
@@ -14,8 +14,9 @@ if modelDisabled
|
||||
span.currency=currency product_order.total
|
||||
else
|
||||
li= t 'product_orders.no_orders'
|
||||
li.total
|
||||
= t 'product_orders.total'
|
||||
span.right.currency=currency orderTotal
|
||||
if model
|
||||
a.tiny.button.right{action orderProducts} href="#"= t 'product_orders.order_button'
|
||||
if showTotal
|
||||
li.total
|
||||
= t 'product_orders.total'
|
||||
span.right.currency=currency orderTotal
|
||||
if product_orders
|
||||
a.order-selected-products-button{action orderProducts} href="#"= t 'product_orders.order_button'
|
||||
|
||||
Reference in New Issue
Block a user