menu and section header progress
This commit is contained in:
@@ -2,5 +2,12 @@ attr = DS.attr
|
||||
App.Product = DS.Model.extend
|
||||
name: attr 'string'
|
||||
price: attr 'number'
|
||||
code: attr 'string'
|
||||
visible: attr('boolean', defaultValue: true)
|
||||
position: attr('number', defaultValue: 0)
|
||||
product_category: DS.belongsTo('product_category')
|
||||
product_orders: DS.hasMany('product_order')
|
||||
|
||||
code_or_empty: (->
|
||||
@get('code') or new Ember.Handlebars.SafeString(' ')
|
||||
).property('code')
|
||||
|
||||
@@ -15,6 +15,8 @@ App.ProductCategory = DS.Model.extend
|
||||
end_on: attr('number')
|
||||
position: attr('number')
|
||||
|
||||
sorted_products: (-> @get('products').sortBy('position') ).property('products.@each.position')
|
||||
|
||||
availability_text: Ember.computed 'active_on_sunday', 'active_on_monday', 'active_on_tuesday', 'active_on_wednesday', 'active_on_thursday', 'active_on_friday', 'active_on_saturday', 'full_day', 'start_from', 'end_on', ->
|
||||
days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']
|
||||
active_days = days.filter (day)=>@get("active_on_#{day}")
|
||||
|
||||
Reference in New Issue
Block a user