Product image and description handling

This commit is contained in:
2014-11-28 15:08:01 +01:00
parent c36c88bc15
commit f63a7a83cc
17 changed files with 132 additions and 51 deletions
@@ -3,11 +3,16 @@ App.Product = DS.Model.extend
name: attr 'string'
price: attr 'number'
code: attr 'string'
description: attr 'string'
visible: attr('boolean', defaultValue: true)
position: attr('number', defaultValue: 0)
image: attr()
product_category: DS.belongsTo('product_category')
product_orders: DS.hasMany('product_order')
code_or_empty: (->
@get('code') or new Ember.Handlebars.SafeString(' ')
).property('code')
image_src: (->
image = @get('image')
return "" unless image
return image.small if image.small and typeof(image.small) is "string"
image
).property('image')