supplier product category filtering
This commit is contained in:
@@ -3,13 +3,13 @@ App.ProductCategory = DS.Model.extend
|
||||
name: attr('string')
|
||||
products: DS.hasMany('product')
|
||||
supplier: DS.belongsTo 'supplier'
|
||||
active_on_sunday: attr('boolean')
|
||||
active_on_monday: attr('boolean')
|
||||
active_on_tuesday: attr('boolean')
|
||||
active_on_wednesday: attr('boolean')
|
||||
active_on_thursday: attr('boolean')
|
||||
active_on_friday: attr('boolean')
|
||||
active_on_saturday: attr('boolean')
|
||||
active_on_sunday: attr('boolean', defaultValue: true)
|
||||
active_on_monday: attr('boolean', defaultValue: true)
|
||||
active_on_tuesday: attr('boolean', defaultValue: true)
|
||||
active_on_wednesday: attr('boolean', defaultValue: true)
|
||||
active_on_thursday: attr('boolean', defaultValue: true)
|
||||
active_on_friday: attr('boolean', defaultValue: true)
|
||||
active_on_saturday: attr('boolean', defaultValue: true)
|
||||
full_day: attr 'boolean', defaultValue: true
|
||||
start_from: attr('number')
|
||||
end_on: attr('number')
|
||||
@@ -18,8 +18,7 @@ App.ProductCategory = DS.Model.extend
|
||||
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}")
|
||||
active_days = $days.filter (day)=>@get("active_on_#{day}")
|
||||
result = ""
|
||||
if active_days.length < 7
|
||||
result += "<span class=\"day-names\">#{active_days.map((day) -> tspan("date.day_name.#{day}")).join(", ")}</span> "
|
||||
|
||||
Reference in New Issue
Block a user