End of day commit

This commit is contained in:
2015-09-09 20:21:52 +02:00
parent 968d042501
commit 36e5b21b13
9 changed files with 58 additions and 29 deletions
@@ -3,13 +3,14 @@ App.ProductOrder = DS.Model.extend
quantity: attr 'number', defaultValue: 1
price: attr 'number'
product_variant: attr('string')
product_name: attr('string')
product: DS.belongsTo('product', async: true)
order: DS.belongsTo('order')
increment: ->
@set('quantity', @get('quantity') + 1)
total: (-> @get('quantity') * @get('price')).property('quantity', 'price')
display: Ember.computed 'quantity', 'product_variant', 'product.name', ->
disp = "#{@get('quantity')} x #{@get('product.name')}"
display: Ember.computed 'quantity', 'product_variant', 'product_name', ->
disp = "#{@get('quantity')} x #{@get('product_name')}"
if variant = @get('product_variant')
disp = "#{disp} (#{variant})"
disp.htmlSafe()
@@ -3,9 +3,9 @@ App.Section = DS.Model.extend
title: attr 'string'
width: attr 'number'
height: attr 'number'
tables: DS.hasMany('table')
section_elements: DS.hasMany('section-element')
section_areas: DS.hasMany('section-area')
tables: DS.hasMany('table', async: false)
section_elements: DS.hasMany('section-element', async: false)
section_areas: DS.hasMany('section-area', async: false)
editmode: false