Product image and description handling
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user