Waiter app progress
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
attr = DS.attr
|
||||
App.Employee= DS.Model.extend
|
||||
name: attr 'string'
|
||||
email: attr 'string'
|
||||
manager: attr 'boolean', defaultValue: false
|
||||
active: attr 'boolean', defaultValue: true
|
||||
color: attr 'string', defaultValue: '#3a87ad'
|
||||
@@ -0,0 +1,28 @@
|
||||
attr = DS.attr
|
||||
App.Supplier = DS.Model.extend
|
||||
name: attr 'string'
|
||||
email: attr 'string'
|
||||
time_zone: attr 'string'
|
||||
address: attr 'string'
|
||||
house_number: attr 'number'
|
||||
house_number_addition: attr 'string'
|
||||
postal_code: attr 'string'
|
||||
city: attr 'string'
|
||||
open: attr 'boolean'
|
||||
country: attr 'string'
|
||||
facebook_promotion_url: attr 'string'
|
||||
iens_profile: attr 'string'
|
||||
lat: attr 'number'
|
||||
lng: attr 'number'
|
||||
week_starts_on_monday: attr 'boolean'
|
||||
product_categories: DS.hasMany 'product_category'
|
||||
orders_in_process_count: attr('number')
|
||||
orders_placed_count: attr('number')
|
||||
|
||||
close: ->
|
||||
$.post Routes.mark_as_closed_suppliers_supplier_path(@id), =>
|
||||
@set 'open', false
|
||||
open_the_place: ->
|
||||
$.post Routes.mark_as_open_suppliers_supplier_path(@id), =>
|
||||
@set 'open', true
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
App.ApplicationRoute = Ember.Route.extend
|
||||
setupController: ->
|
||||
beforeModel: ->
|
||||
@supplier = @store.push 'supplier', supplier_object
|
||||
@employee = @store.push 'employee', employee_object
|
||||
@supplier.reload().then =>
|
||||
#@store.find('list', state: 'active')
|
||||
setupController: (controller, model)->
|
||||
controller.set 'supplier', @supplier
|
||||
controller.set 'employee', @employee
|
||||
@controllerFor('product_categories').set 'model', @store.find('product_category')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.row
|
||||
.twelve.columns
|
||||
h1 Qwaiter
|
||||
h1= supplier.name
|
||||
hr
|
||||
.waiter-application-container= outlet
|
||||
|
||||
Reference in New Issue
Block a user