intermediate commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
App.ApplicationAdapter = DS.ActiveModelAdapter.extend
|
||||||
|
namespace: 'supplier'
|
||||||
|
headers:
|
||||||
|
"Accept": "application/json, text/javascript; q=0.01"
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
#= require handlebars
|
#= require handlebars
|
||||||
#= require ember
|
#= require ember
|
||||||
#= require ember-data
|
#= require ember-data
|
||||||
|
#= require active-model-adapter
|
||||||
#= require ember-validations
|
#= require ember-validations
|
||||||
#= require ember-template-compiler
|
#= require ember-template-compiler
|
||||||
#= require_directory ./modifications
|
#= require_directory ./modifications
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ App.NumberFieldComponent = Ember.TextField.extend
|
|||||||
type: 'number'
|
type: 'number'
|
||||||
attributeBindings: ['min', 'max', 'step']
|
attributeBindings: ['min', 'max', 'step']
|
||||||
focusIn: -> @$().select()
|
focusIn: -> @$().select()
|
||||||
numericValue: Ember.computed 'value', (key, value) ->
|
numericValue: Ember.computed 'value',
|
||||||
if arguments.length > 1
|
get: ->
|
||||||
|
value = @get 'value'
|
||||||
|
if value? then String(value) else ''
|
||||||
|
set: (key, value)->
|
||||||
if value?
|
if value?
|
||||||
setValue = parseFloat(value)
|
setValue = parseFloat(value)
|
||||||
@set "value", if isFinite(setValue) then setValue else null
|
@set "value", if isFinite(setValue) then setValue else null
|
||||||
else
|
else
|
||||||
@set 'value', null
|
@set 'value', null
|
||||||
value = @get 'value'
|
value
|
||||||
if value? then String(value) else ''
|
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
App.EmployeesIndexController = Ember.Controller.extend
|
App.EmployeesIndexController = Ember.Controller.extend
|
||||||
needs: ['application']
|
|
||||||
employees: (-> @get('model').sortBy('name')).property('model.@each.name')
|
employees: (-> @get('model').sortBy('name')).property('model.@each.name')
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
App.IndexController = Ember.Controller.extend
|
App.IndexController = Ember.Controller.extend
|
||||||
needs: ['application']
|
|
||||||
show_lists: true
|
show_lists: true
|
||||||
show_orders: true
|
show_orders: true
|
||||||
lists: (-> @store.peekAll('list')).property()
|
lists: (-> @store.peekAll('list')).property()
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
App.ListController = Ember.Controller.extend
|
App.ListController = Ember.Controller.extend
|
||||||
needs: ['application', 'lists', 'list'] #wtf? list, otherwise an Ember error
|
|
||||||
list: (-> @get('model')).property('model')
|
list: (-> @get('model')).property('model')
|
||||||
showTotal: (->
|
showTotal: (->
|
||||||
if @get('list.orders.length') && @get('list.orders.length') > 1 then true else false
|
if @get('list.orders.length') && @get('list.orders.length') > 1 then true else false
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
App.MenuController = Ember.Controller.extend
|
App.MenuController = Ember.Controller.extend
|
||||||
needs: ['application']
|
|
||||||
product_code_filter: ''
|
product_code_filter: ''
|
||||||
product_categories: (-> @store.peekAll('product_category')).property()
|
product_categories: (-> @store.peekAll('product_category')).property()
|
||||||
filter: null
|
filter: null
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
@App.modals.BaseController = Ember.Controller.extend
|
@App.modals.BaseController = Ember.Controller.extend
|
||||||
needs: ['application']
|
|
||||||
alert_message: ""
|
alert_message: ""
|
||||||
modal_options: {}
|
modal_options: {}
|
||||||
title: (->
|
title: (->
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
App.OrdersDisplayController = Ember.Controller.extend
|
App.OrdersDisplayController = Ember.Controller.extend
|
||||||
needs: ['application']
|
|
||||||
active_section: null
|
active_section: null
|
||||||
sections: (-> @store.peekAll('section') ).property()
|
sections: (-> @store.peekAll('section') ).property()
|
||||||
orders: Ember.computed 'model.[]', 'active_section.id', ->
|
orders: Ember.computed 'model.[]', 'active_section.id', ->
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
App.SectionController = Ember.Controller.extend
|
App.SectionController = Ember.Controller.extend
|
||||||
needs: ['application', 'sections', 'section'] #wtf? section, otherwise an Ember error
|
#needs: ['application', 'sections', 'section'] #wtf? section, otherwise an Ember error
|
||||||
actions:
|
actions:
|
||||||
makeEditable: -> @set('model.editmode', true)
|
makeEditable: -> @set('model.editmode', true)
|
||||||
finishEditable: ->
|
finishEditable: ->
|
||||||
@@ -54,4 +54,6 @@ App.SectionController = Ember.Controller.extend
|
|||||||
section_area.rollback()
|
section_area.rollback()
|
||||||
textures: ['wood1', 'wood2']
|
textures: ['wood1', 'wood2']
|
||||||
|
|
||||||
sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
#sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
||||||
|
sections_controller: Ember.inject.controller('sections')
|
||||||
|
sections: Ember.computed.alias 'sections_controller.model'
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
App.SectionsController = Ember.Controller.extend
|
App.SectionsController = Ember.Controller.extend {}
|
||||||
needs: ['application']
|
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
App.SectionsIndexController = Ember.Controller.extend
|
App.SectionsIndexController = Ember.Controller.extend
|
||||||
needs: ['application', 'sections', 'index']
|
#needs: ['application', 'sections', 'index']
|
||||||
sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
#sections: Ember.computed.alias 'controllers.sections.model'
|
||||||
sectionQrCodesUrl: ((a,b,c)->
|
sections_controller: Ember.inject.controller('sections')
|
||||||
Routes.qr_codes_suppliers_tables_path()
|
sections: Ember.computed.alias 'sections_controller.model'
|
||||||
).property()
|
|
||||||
newPath: Routes.new_suppliers_section_path()
|
newPath: Routes.new_suppliers_section_path()
|
||||||
qrPath: (section_id)->
|
|
||||||
Routes.qr_codes_suppliers_tables_path section_id: section_id
|
|
||||||
actions:
|
actions:
|
||||||
addSection: -> @modal 'add_section', model: @get('model')
|
addSection: -> @modal 'add_section', model: @get('model')
|
||||||
goToSection: (section)->
|
goToSection: (section)->
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
App.SettingsController = Ember.Controller.extend
|
App.SettingsController = Ember.Controller.extend
|
||||||
needs: ['application']
|
|
||||||
supplier: Ember.computed.alias 'globals.current_supplier'
|
supplier: Ember.computed.alias 'globals.current_supplier'
|
||||||
# model: (-> @get('controllers.application.supplier')).property('controllers.application.supplier')
|
|
||||||
time_zones: (-> window.time_zones ).property()
|
time_zones: (-> window.time_zones ).property()
|
||||||
countries: (-> window.countries ).property()
|
countries: (-> window.countries ).property()
|
||||||
saving: false
|
saving: false
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
App.TablesIndexController = Ember.Controller.extend
|
App.TablesIndexController = Ember.Controller.extend
|
||||||
needs: ['application']
|
|
||||||
tables: (-> @get('model').sortBy('casted_number')).property('model.@each.number')
|
tables: (-> @get('model').sortBy('casted_number')).property('model.@each.number')
|
||||||
actions:
|
actions:
|
||||||
newTable: ->
|
newTable: ->
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ ControllerExtensions = Ember.Mixin.create
|
|||||||
@send "openModal", name, options
|
@send "openModal", name, options
|
||||||
|
|
||||||
all_sections: (-> @store.peekAll('section')).property()
|
all_sections: (-> @store.peekAll('section')).property()
|
||||||
#current_employee: (-> @get('controllers.application.employee') ).property('controllers.application.employee')
|
|
||||||
|
|
||||||
Ember.Controller.reopen ControllerExtensions
|
Ember.Controller.reopen ControllerExtensions
|
||||||
Ember.ArrayController.reopen ControllerExtensions # Added for auto generated employeesController Ember 1,13.5
|
Ember.ArrayController.reopen ControllerExtensions # Added for auto generated employeesController Ember 1,13.5
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
App.ApplicationRoute = Ember.Route.extend
|
App.ApplicationRoute = Ember.Route.extend
|
||||||
beforeModel: ->
|
beforeModel: ->
|
||||||
# Preload only active lists and orders
|
# Preload only active lists and orders
|
||||||
@supplier = @store.push 'supplier', supplier_object
|
@supplier = @store.push
|
||||||
@employee = @store.push 'employee', employee_object
|
data:
|
||||||
|
id: supplier_object.id
|
||||||
|
type: 'supplier'
|
||||||
|
attributes: supplier_object
|
||||||
|
@employee = @store.push
|
||||||
|
data:
|
||||||
|
id: employee_object.id
|
||||||
|
type: 'employee'
|
||||||
|
attributes: employee_object
|
||||||
#@product_categories = @store.findAll 'product_category'
|
#@product_categories = @store.findAll 'product_category'
|
||||||
#@sections = @store.findAll 'section'
|
#@sections = @store.findAll 'section'
|
||||||
#Ember.RSVP.all([@product_categories, @sections]).then (results)=>
|
#Ember.RSVP.all([@product_categories, @sections]).then (results)=>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
App.ApplicationSerializer = DS.ActiveModelSerializer
|
App.ApplicationSerializer = DS.ActiveModelSerializer
|
||||||
|
|
||||||
App.ApplicationStore = DS.Store
|
#App.ApplicationStore = DS.Store
|
||||||
#adapter: DS.ActiveModelAdapter.extend
|
#adapter: DS.ActiveModelAdapter.extend
|
||||||
#namespace: 'supplier'
|
#namespace: 'supplier'
|
||||||
## user underscored paths
|
## user underscored paths
|
||||||
#pathForType: (type)->
|
#pathForType: (type)->
|
||||||
#Ember.String.pluralize(Ember.String.decamelize(type))
|
#Ember.String.pluralize(Ember.String.decamelize(type))
|
||||||
App.ApplicationAdapter = DS.ActiveModelAdapter.extend
|
#App.ApplicationAdapter = DS.ActiveModelAdapter.extend
|
||||||
namespace: 'supplier'
|
# namespace: 'supplier'
|
||||||
headers:
|
# headers:
|
||||||
"Accept": "application/json, text/javascript; q=0.01"
|
# "Accept": "application/json, text/javascript; q=0.01"
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ form.form-horizontal
|
|||||||
.form-label
|
.form-label
|
||||||
label for='add-tables-number-start'
|
label for='add-tables-number-start'
|
||||||
=t 'section.add_tables.modal.number_start'
|
=t 'section.add_tables.modal.number_start'
|
||||||
.form-field= number-field value=number_start
|
.form-field= number-field numericValue=number_start
|
||||||
.form-row
|
.form-row
|
||||||
.form-label
|
.form-label
|
||||||
label for='add-tables-number-end'
|
label for='add-tables-number-end'
|
||||||
=t 'section.add_tables.modal.number_end'
|
=t 'section.add_tables.modal.number_end'
|
||||||
.form-field= number-field value=number_end
|
.form-field= number-field numericValue=number_end
|
||||||
hr
|
hr
|
||||||
button.modal-close{action "close"}=t 'section.add_tables.modal.close_button'
|
button.modal-close{action "close"}=t 'section.add_tables.modal.close_button'
|
||||||
button.modal-confirm.right{action "addTables"}=t 'section.add_tables.modal.add_button'
|
button.modal-confirm.right{action "addTables"}=t 'section.add_tables.modal.add_button'
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ header.top-menu
|
|||||||
.main-section
|
.main-section
|
||||||
@media #{$xlarge-up}
|
@media #{$xlarge-up}
|
||||||
padding-top: 130px
|
padding-top: 130px
|
||||||
min-height: 900px
|
|
||||||
.main-section-header
|
.main-section-header
|
||||||
position: fixed
|
position: fixed
|
||||||
top: 90px
|
top: 90px
|
||||||
|
|||||||
Reference in New Issue
Block a user