supplier menu progress
This commit is contained in:
@@ -2,3 +2,25 @@ attr = DS.attr
|
||||
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')
|
||||
full_day: attr('boolean')
|
||||
start_from: attr('number')
|
||||
end_on: attr('number')
|
||||
position: attr('number')
|
||||
|
||||
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}")
|
||||
result = ""
|
||||
if active_days.length < 7
|
||||
result += "<span class=\"day-names\">#{active_days.map((day) -> t("date.day_name.#{day}")).join(", ")}</span> "
|
||||
unless @get('full_day')
|
||||
result += "<span class=\"time-range\">#{day_minutes_to_time @get('start_from')} - #{day_minutes_to_time @get('end_on')}</span>"
|
||||
new Ember.Handlebars.SafeString result
|
||||
|
||||
@@ -13,3 +13,5 @@ App.Supplier = DS.Model.extend
|
||||
iens_profile: attr 'string'
|
||||
lat: attr 'number'
|
||||
lng: attr 'number'
|
||||
week_starts_on_monday: attr 'boolean'
|
||||
product_categories: DS.hasMany 'product_category'
|
||||
|
||||
Reference in New Issue
Block a user