Add push buttons and support inactive products

This commit is contained in:
2015-03-24 14:53:02 +01:00
parent b0bab98be8
commit e720d6b31c
22 changed files with 74 additions and 21 deletions
@@ -1,6 +1,6 @@
App.MenuProductComponent = Ember.Component.extend
tagName: 'li'
classNameBindings: ['specific_id']
classNameBindings: ['specific_id', 'product.active:active:inactive']
specific_id: (-> "order-product-#{@get('product.id')}").property('product.id')
orderProducts: false
target: -> @get('parentView.targetObject')
@@ -4,6 +4,7 @@ App.Product = DS.Model.extend
price: attr 'number'
description: attr 'string'
position: attr('number', defaultValue: 0)
active: attr 'boolean', defaultValue: true
image: attr()
product_category: DS.belongsTo('product_category')
product_orders: DS.hasMany('product_order')
@@ -4,9 +4,12 @@ if product.description
else
span.no-product-description
if orderProducts
a{action "addProduct" product}= product.name
button.add-product-to-list{action "addProduct" product}
span
if product.active
a{action "addProduct" product}= product.name
button.add-product-to-list{action "addProduct" product}
span
else
a{action "showProductDescription" product}= product.name
else
span= product.name
span.product-price.currency=currency product.price