Mozo upgrade progress
This commit is contained in:
+12
-12
@@ -1,8 +1,8 @@
|
|||||||
GIT
|
GIT
|
||||||
remote: git://github.com/bterkuile/cmtool.git
|
remote: git://github.com/bterkuile/cmtool.git
|
||||||
revision: 49b61a502624b00aaf3a96c0bd43085ef9f85d75
|
revision: 6b6a7405bab49a798e38af5e74d52a38de519039
|
||||||
specs:
|
specs:
|
||||||
cmtool (1.0.0)
|
cmtool (2.0.0)
|
||||||
ace-rails-ap
|
ace-rails-ap
|
||||||
bourbon
|
bourbon
|
||||||
email_validator
|
email_validator
|
||||||
@@ -23,7 +23,7 @@ GIT
|
|||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/bterkuile/simply_stored.git
|
remote: git://github.com/bterkuile/simply_stored.git
|
||||||
revision: 4f3d144096a7deb457a9e6b92c3ced0f4a9eeff0
|
revision: 05cb3a06a9d4a3588efd4491db42fac84276befb
|
||||||
specs:
|
specs:
|
||||||
simply_stored (1.0.0)
|
simply_stored (1.0.0)
|
||||||
activesupport
|
activesupport
|
||||||
@@ -54,7 +54,7 @@ GEM
|
|||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
active-model-adapter-source (1.13.4)
|
active-model-adapter-source (1.13.5)
|
||||||
ember-data-source (>= 1.13, < 3.0)
|
ember-data-source (>= 1.13, < 3.0)
|
||||||
active_attr (0.8.5)
|
active_attr (0.8.5)
|
||||||
activemodel (>= 3.0.2, < 5.0)
|
activemodel (>= 3.0.2, < 5.0)
|
||||||
@@ -118,7 +118,7 @@ GEM
|
|||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
xpath (~> 2.0)
|
xpath (~> 2.0)
|
||||||
capybara-screenshot (1.0.10)
|
capybara-screenshot (1.0.11)
|
||||||
capybara (>= 1.0, < 3)
|
capybara (>= 1.0, < 3)
|
||||||
launchy
|
launchy
|
||||||
celluloid (0.16.0)
|
celluloid (0.16.0)
|
||||||
@@ -173,7 +173,7 @@ GEM
|
|||||||
eventmachine (>= 1.0.0.beta.4)
|
eventmachine (>= 1.0.0.beta.4)
|
||||||
email_validator (1.6.0)
|
email_validator (1.6.0)
|
||||||
activemodel
|
activemodel
|
||||||
ember-data-source (1.13.5)
|
ember-data-source (1.13.6)
|
||||||
ember-source (>= 1.8, < 3.0)
|
ember-source (>= 1.8, < 3.0)
|
||||||
ember-emblem-template (0.2.2)
|
ember-emblem-template (0.2.2)
|
||||||
barber (>= 0.9.0)
|
barber (>= 0.9.0)
|
||||||
@@ -190,7 +190,7 @@ GEM
|
|||||||
ember-source (>= 1.8.0)
|
ember-source (>= 1.8.0)
|
||||||
jquery-rails (>= 1.0.17)
|
jquery-rails (>= 1.0.17)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
ember-source (1.13.4.1)
|
ember-source (1.13.5)
|
||||||
ember-validations-rails (1.0.0)
|
ember-validations-rails (1.0.0)
|
||||||
railties
|
railties
|
||||||
emblem-rails (0.2.2)
|
emblem-rails (0.2.2)
|
||||||
@@ -207,7 +207,7 @@ GEM
|
|||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
faraday (0.9.1)
|
faraday (0.9.1)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
faye (1.1.1)
|
faye (1.1.2)
|
||||||
cookiejar (>= 0.3.0)
|
cookiejar (>= 0.3.0)
|
||||||
em-http-request (>= 0.3.0)
|
em-http-request (>= 0.3.0)
|
||||||
eventmachine (>= 0.12.0)
|
eventmachine (>= 0.12.0)
|
||||||
@@ -309,7 +309,7 @@ GEM
|
|||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
pry-rails (0.3.4)
|
pry-rails (0.3.4)
|
||||||
pry (>= 0.9.10)
|
pry (>= 0.9.10)
|
||||||
puma (2.12.1)
|
puma (2.12.2)
|
||||||
quiet_assets (1.1.0)
|
quiet_assets (1.1.0)
|
||||||
railties (>= 3.1, < 5.0)
|
railties (>= 3.1, < 5.0)
|
||||||
rack (1.6.4)
|
rack (1.6.4)
|
||||||
@@ -327,7 +327,7 @@ GEM
|
|||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.2.3)
|
railties (= 4.2.3)
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
rails-assets-ember-qunit (0.4.1)
|
rails-assets-ember-qunit (0.4.6)
|
||||||
rails-assets-qunit (1.18.0)
|
rails-assets-qunit (1.18.0)
|
||||||
rails-deprecated_sanitizer (1.0.3)
|
rails-deprecated_sanitizer (1.0.3)
|
||||||
activesupport (>= 4.2.0.alpha)
|
activesupport (>= 4.2.0.alpha)
|
||||||
@@ -431,7 +431,7 @@ GEM
|
|||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
timers (4.0.1)
|
timers (4.0.1)
|
||||||
hitimes
|
hitimes
|
||||||
tinymce-rails (4.1.6)
|
tinymce-rails (4.2.2)
|
||||||
railties (>= 3.1.1)
|
railties (>= 3.1.1)
|
||||||
turnip (1.3.1)
|
turnip (1.3.1)
|
||||||
gherkin (>= 2.5)
|
gherkin (>= 2.5)
|
||||||
@@ -455,7 +455,7 @@ GEM
|
|||||||
addressable (>= 2.3.6)
|
addressable (>= 2.3.6)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
websocket (1.2.2)
|
websocket (1.2.2)
|
||||||
websocket-driver (0.6.1)
|
websocket-driver (0.6.2)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.2)
|
websocket-extensions (0.1.2)
|
||||||
xpath (2.0.0)
|
xpath (2.0.0)
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
App.MarkOrderActiveView = Ember.View.extend
|
App.MarkOrderActiveComponent = Ember.Component.extend
|
||||||
tagName: 'button'
|
tagName: 'button'
|
||||||
templateName: 'buttons/mark-order-active'
|
templateName: 'components/buttons/mark-order-active'
|
||||||
classNames: ['mark-order-active-button']
|
classNames: ['mark-order-active-button']
|
||||||
classNameBindings: ['order.placed:active:hide']
|
classNameBindings: ['order.placed:active:hide']
|
||||||
click: -> @get('order').mark_active()
|
click: -> @get('order').mark_active()
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
App.MarkOrderCancelledComponent = Ember.Component.extend
|
||||||
|
tagName: 'button'
|
||||||
|
templateName: 'components/buttons/mark-order-cancelled'
|
||||||
|
classNames: ['mark-order-cancelled-button']
|
||||||
|
classNameBindings: ['showButton:active:hide']
|
||||||
|
showButton: Ember.computed 'order.state', ->
|
||||||
|
state = @get('order.state')
|
||||||
|
state is 'placed' or state is 'active'
|
||||||
|
click: -> @get('order').mark_cancelled()
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
App.MarkOrderDeliveredView = Ember.View.extend
|
App.MarkOrderDeliveredComponent = Ember.Component.extend
|
||||||
tagName: 'button'
|
tagName: 'button'
|
||||||
templateName: 'buttons/mark-order-delivered'
|
templateName: 'components/buttons/mark-order-delivered'
|
||||||
classNames: ['mark-order-delivered-button']
|
classNames: ['mark-order-delivered-button']
|
||||||
classNameBindings: ['showButton:active:hide']
|
classNameBindings: ['showButton:active:hide']
|
||||||
showButton: Ember.computed 'order.state', ->
|
showButton: Ember.computed 'order.state', ->
|
||||||
@@ -23,9 +23,9 @@ if list.sorted_orders
|
|||||||
span.currency= currency order.total
|
span.currency= currency order.total
|
||||||
span.created_at= time order.created_at
|
span.created_at= time order.created_at
|
||||||
.list-order-actions
|
.list-order-actions
|
||||||
view mark-order-active order=order
|
= mark-order-active order=order
|
||||||
view mark-order-delivered order=order
|
= mark-order-delivered order=order
|
||||||
view mark-order-cancelled order=order
|
= mark-order-cancelled order=order
|
||||||
if showTotal
|
if showTotal
|
||||||
.list-orders-total.total
|
.list-orders-total.total
|
||||||
= t 'general.total'
|
= t 'general.total'
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ td.section_title= link-to 'section' view.content.list.table.section.id: span=vie
|
|||||||
td.currency=currency view.content.total
|
td.currency=currency view.content.total
|
||||||
td.time= time view.content.created_at format="HH:mm"
|
td.time= time view.content.created_at format="HH:mm"
|
||||||
td.actions
|
td.actions
|
||||||
view mark-order-active order=view.content
|
= mark-order-active order=view.content
|
||||||
view mark-order-delivered order=view.content
|
= mark-order-delivered order=view.content
|
||||||
view mark-order-cancelled order=view.content
|
= mark-order-cancelled order=view.content
|
||||||
|
|||||||
@@ -16,6 +16,17 @@ Ember.Application.initializer
|
|||||||
container.register 'clock:service', ClockService
|
container.register 'clock:service', ClockService
|
||||||
application.inject 'component:menu-product-categories', 'clock', 'clock:service'
|
application.inject 'component:menu-product-categories', 'clock', 'clock:service'
|
||||||
|
|
||||||
|
Globals = Ember.Object.extend
|
||||||
|
list: null
|
||||||
|
notice: ''
|
||||||
|
Ember.Application.initializer
|
||||||
|
name: 'Globals'
|
||||||
|
initialize: (container, application)->
|
||||||
|
container.typeInjection('component', 'store', 'store:main')
|
||||||
|
application.register('global:variables', Globals, {singleton: true})
|
||||||
|
application.inject('controller', 'globals', 'global:variables')
|
||||||
|
application.inject('component', 'globals', 'global:variables')
|
||||||
|
|
||||||
@App = Ember.Application.create
|
@App = Ember.Application.create
|
||||||
LOG_TRANSITIONS: true
|
LOG_TRANSITIONS: true
|
||||||
rootElement: '#ember-app-container'
|
rootElement: '#ember-app-container'
|
||||||
|
|||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
App.ListOrderView = Ember.View.extend
|
App.ListOrderComponent = Ember.Component.extend
|
||||||
classNames: 'list-order-container'
|
classNames: 'list-order-container'
|
||||||
classNameBindings: ['content.state', 'contentWrapClass']
|
classNameBindings: ['order.state', 'contentWrapClass']
|
||||||
templateName: 'list_order_row'
|
#templateName: 'components/list-order'
|
||||||
contentWrapClass: (-> "order-row-#{@get('content.id')}").property('content.id')
|
contentWrapClass: (-> "order-row-#{@get('order.id')}").property('order.id')
|
||||||
#click: ->
|
#click: ->
|
||||||
#if @route_param
|
#if @route_param
|
||||||
#@get('controller').transitionToRoute(@route, @route_param)
|
#@get('controller').transitionToRoute(@route, @route_param)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
App.MenuItemComponent = Ember.Component.extend
|
||||||
|
classNames: 'menu-list-item'
|
||||||
|
classNameBindings: ['active']
|
||||||
|
click: ->
|
||||||
|
if route_param = @get('route_param')
|
||||||
|
@get('reference_controller').transitionToRoute(@get('route'), route_param)
|
||||||
|
else
|
||||||
|
@get('reference_controller').transitionToRoute(@get('route'))
|
||||||
|
active: (->
|
||||||
|
if @get('reference_controller.currentPath') == @get('route') then 'active' else ''
|
||||||
|
).property('reference_controller.currentPath')
|
||||||
|
setTemplate: (-> @templateName = "components/menu/#{@get('route')}").on('init')
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
App.MenuItemListNeedsHelpComponent = Ember.Component.extend Ember.ViewTargetActionSupport,
|
||||||
|
action: 'listNeedsHelp'
|
||||||
|
templateName: "components/menu/list_needs_help"
|
||||||
|
classNames: 'menu-list-item callout'
|
||||||
|
classNameBindings: ['globals.list.needs_help:active']
|
||||||
|
click: ->
|
||||||
|
if @get('globals.list.needs_help')
|
||||||
|
@set 'globals.notice', t('list_needs_help.help_is_on_its_way')
|
||||||
|
else
|
||||||
|
@triggerAction()
|
||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
App.MenuItemListNeedsPaymentView = Ember.View.extend Ember.ViewTargetActionSupport,
|
App.MenuItemListNeedsPaymentComponent = Ember.Component.extend Ember.ViewTargetActionSupport,
|
||||||
action: 'listNeedsPayment'
|
action: 'listNeedsPayment'
|
||||||
templateName: "menu/list_needs_payment"
|
templateName: "components/menu/list_needs_payment"
|
||||||
classNames: 'menu-list-item callout'
|
classNames: 'menu-list-item callout'
|
||||||
classNameBindings: ['controller.list.needs_payment:active']
|
classNameBindings: ['controller.list.needs_payment:active']
|
||||||
click: ->
|
click: ->
|
||||||
if @get('controller.list.needs_payment')
|
if @get('controller.list.needs_payment')
|
||||||
@set 'controller.notice', t('list_needs_payment.payment_already_requested')
|
@set 'globals.notice', t('list_needs_payment.payment_already_requested')
|
||||||
else
|
else
|
||||||
@triggerAction() #action: 'listNeedsPayment'
|
@triggerAction() #action: 'listNeedsPayment'
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
App.MenuItemProductOrdersView = Ember.View.extend
|
App.MenuItemProductOrdersComponent = Ember.Component.extend
|
||||||
templateName: 'menu/product_orders'
|
templateName: 'components/menu/product_orders'
|
||||||
classNames: ['menu-list-item', 'menu-list-item-product-orders']
|
classNames: ['menu-list-item', 'menu-list-item-product-orders']
|
||||||
classNameBindings: ['controller.controllers.product_orders.product_orders.length:show:hide', 'currentRoute:active']
|
classNameBindings: ['controller.controllers.product_orders.product_orders.length:show:hide', 'currentRoute:active']
|
||||||
currentRoute: (-> @get('controller.currentRouteName') is 'product_orders' ).property('controller.currentRouteName')
|
currentRoute: (-> @get('controller.currentRouteName') is 'product_orders' ).property('controller.currentRouteName')
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
App.MenuItemScanQrComponent = Ember.Component.extend Ember.ViewTargetActionSupport,
|
||||||
|
action: 'scanQr'
|
||||||
|
templateName: "components/menu/scan_qr"
|
||||||
|
classNames: 'menu-list-item'
|
||||||
|
click: -> @triggerAction()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
App.ActiveListController = Ember.ObjectController.extend
|
App.ActiveListController = Ember.Controller.extend
|
||||||
#orders: (->
|
#orders: (->
|
||||||
#@get('list.orders')
|
#@get('list.orders')
|
||||||
#).property('list.orders')
|
#).property('list.orders')
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
App.ApplicationController = Ember.Controller.extend
|
App.ApplicationController = Ember.Controller.extend
|
||||||
needs: ['product_orders']
|
needs: ['product_orders']
|
||||||
join_request_sent: false
|
join_request_sent: false
|
||||||
notice: ''
|
#notice: ''
|
||||||
actions:
|
actions:
|
||||||
confirmCancel: ->
|
confirmCancel: ->
|
||||||
if cancel = @get('confirm.cancel')
|
if cancel = @get('confirm.cancel')
|
||||||
cancel.call(@)
|
cancel.call(@)
|
||||||
$('#confirm-modal').hide()
|
$('#confirm-modal').hide()
|
||||||
clearNotice: ->
|
clearNotice: ->
|
||||||
@set 'notice', null
|
@set 'globals.notice', ''
|
||||||
showSupplierStatusInfo: ->
|
showSupplierStatusInfo: ->
|
||||||
@modal 'supplier_status_info',
|
@modal 'supplier_status_info',
|
||||||
model: @get('list.supplier')
|
model: @get('list.supplier')
|
||||||
@@ -18,10 +18,10 @@ App.ApplicationController = Ember.Controller.extend
|
|||||||
debugger
|
debugger
|
||||||
|
|
||||||
currentPathDidChange: (->
|
currentPathDidChange: (->
|
||||||
@set 'notice', ''
|
@set 'globals.notice', ''
|
||||||
).observes('currentPath')
|
).observes('currentPath')
|
||||||
events:
|
events:
|
||||||
notify: (notification) -> @set 'notice', notification.message
|
notify: (notification) -> @set 'globals.notice', notification.message
|
||||||
list_helped: -> @set 'list.needs_help', false
|
list_helped: -> @set 'list.needs_help', false
|
||||||
list_needs_help: -> @set 'list.needs_help', true # incoming from other users
|
list_needs_help: -> @set 'list.needs_help', true # incoming from other users
|
||||||
list_is_paid: -> @set 'list.needs_payment', false
|
list_is_paid: -> @set 'list.needs_payment', false
|
||||||
@@ -48,7 +48,7 @@ App.ApplicationController = Ember.Controller.extend
|
|||||||
join_request = @store.createRecord 'join_request', data.join_request
|
join_request = @store.createRecord 'join_request', data.join_request
|
||||||
@transitionToRoute 'join_requests'
|
@transitionToRoute 'join_requests'
|
||||||
order_cancelled: (data)->
|
order_cancelled: (data)->
|
||||||
if order = App.Order.findCached(data.id)
|
if order = @store.all('order').findBy('id', data.id)
|
||||||
order.markCancelled()
|
order.markCancelled()
|
||||||
@events.orders_placed_count.call(@, count: data.supplier_orders_placed_count) if data.supplier_orders_placed_count == 0 or data.supplier_orders_placed_count
|
@events.orders_placed_count.call(@, count: data.supplier_orders_placed_count) if data.supplier_orders_placed_count == 0 or data.supplier_orders_placed_count
|
||||||
@events.orders_in_process_count.call(@, count: data.supplier_orders_in_process_count) if data.supplier_orders_in_process_count == 0 or data.supplier_orders_in_process_count
|
@events.orders_in_process_count.call(@, count: data.supplier_orders_in_process_count) if data.supplier_orders_in_process_count == 0 or data.supplier_orders_in_process_count
|
||||||
@@ -61,14 +61,14 @@ App.ApplicationController = Ember.Controller.extend
|
|||||||
# NOTE data.id is in the form of: jr-:user_id
|
# NOTE data.id is in the form of: jr-:user_id
|
||||||
requestor_id = data.id.substr(3)
|
requestor_id = data.id.substr(3)
|
||||||
if requestor_id is Qstorage.getItem('user_id')
|
if requestor_id is Qstorage.getItem('user_id')
|
||||||
@set 'notice', t('join_request.requestor.join_request_rejected')
|
@set 'globals.notice', t('join_request.requestor.join_request_rejected')
|
||||||
@set 'join_request_sent', false
|
@set 'join_request_sent', false
|
||||||
|
|
||||||
join_request_approved: ->
|
join_request_approved: ->
|
||||||
return if @get('list.id')
|
return if @get('list.id')
|
||||||
@setCurrentList ->
|
@setCurrentList ->
|
||||||
@transitionToRoute('active_list').then =>
|
@transitionToRoute('active_list').then =>
|
||||||
@set 'notice', t('join_request.requestor.join_request_approved')
|
@set 'globals.notice', t('join_request.requestor.join_request_approved')
|
||||||
|
|
||||||
list_changed_table: ->
|
list_changed_table: ->
|
||||||
@setCurrentList()
|
@setCurrentList()
|
||||||
@@ -96,7 +96,9 @@ App.ApplicationController = Ember.Controller.extend
|
|||||||
# at the moment remove the dummy list, this should be resolved by Ember eventually
|
# at the moment remove the dummy list, this should be resolved by Ember eventually
|
||||||
if error_list = @store.all('list').findBy('id', 'current')
|
if error_list = @store.all('list').findBy('id', 'current')
|
||||||
error_list.eraseRecord()
|
error_list.eraseRecord()
|
||||||
|
#TODO: depricate list on application controller
|
||||||
@set 'list', list
|
@set 'list', list
|
||||||
|
@set 'globals.list', list
|
||||||
if list.get('join_requests.length')
|
if list.get('join_requests.length')
|
||||||
@transitionToRoute 'join_requests'
|
@transitionToRoute 'join_requests'
|
||||||
else if @currentRouteName is 'index'
|
else if @currentRouteName is 'index'
|
||||||
@@ -111,6 +113,6 @@ App.ApplicationController = Ember.Controller.extend
|
|||||||
@set 'list', null
|
@set 'list', null
|
||||||
switch @currentRouteName
|
switch @currentRouteName
|
||||||
when 'table' then # nothing
|
when 'table' then # nothing
|
||||||
else @redirect_to 'index'
|
else @redirect_to 'user_root'
|
||||||
|
|
||||||
@store.find('list', 'current').then(success, error)
|
@store.find('list', 'current').then(success, error)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
App.JoinRequestsController = Ember.ArrayController.extend
|
App.JoinRequestsController = Ember.Controller.extend
|
||||||
join_requests: (-> @get('controllers.application.list.join_requests') ).property('controllers.application.list.join_requests')
|
join_requests: (-> @get('controllers.application.list.join_requests') ).property('controllers.application.list.join_requests')
|
||||||
actions:
|
actions:
|
||||||
rejectRequest: (join_request)->
|
rejectRequest: (join_request)->
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
App.ListController = Ember.ObjectController.extend
|
App.ListController = Ember.Controller.extend
|
||||||
list: (-> @get('model')).property('model')
|
list: (-> @get('model')).property('model')
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
App.ListsIndexController = Ember.ArrayController.extend App.PaginationModule,
|
App.ListsIndexController = Ember.Controller.extend App.PaginationModule,
|
||||||
lists: (->@get('model').sortBy('created_at').reverse()).property('model.@each')
|
lists: (->@get('model').sortBy('created_at').reverse()).property('model.@each')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@App.modals.BaseController = Ember.ObjectController.extend
|
@App.modals.BaseController = Ember.Controller.extend
|
||||||
alert_message: ""
|
alert_message: ""
|
||||||
title: (->
|
title: (->
|
||||||
# return title if directly set by options
|
# return title if directly set by options
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
App.ProductOrdersController = Ember.ArrayController.extend
|
App.ProductOrdersController = Ember.Controller.extend
|
||||||
needs: ['application', 'table']
|
needs: ['application', 'table']
|
||||||
orderTotal: (->
|
orderTotal: (->
|
||||||
#Math.round(Math.random()*100)
|
#Math.round(Math.random()*100)
|
||||||
@@ -27,7 +27,7 @@ App.ProductOrdersController = Ember.ArrayController.extend
|
|||||||
# @transitionToRoute 'active_list'
|
# @transitionToRoute 'active_list'
|
||||||
# , @ajaxError (jqXHR)=>
|
# , @ajaxError (jqXHR)=>
|
||||||
# new_product_orders.invoke 'eraseRecord'
|
# new_product_orders.invoke 'eraseRecord'
|
||||||
# @redirect_to 'index', message: 'order_could_not_be_processed'
|
# @redirect_to 'user_root', message: 'order_could_not_be_processed'
|
||||||
|
|
||||||
#orders = @store.all('product_order').toArray()
|
#orders = @store.all('product_order').toArray()
|
||||||
#data = @get('product_orders').map( (po)->po.serialize() )
|
#data = @get('product_orders').map( (po)->po.serialize() )
|
||||||
@@ -41,7 +41,7 @@ App.ProductOrdersController = Ember.ArrayController.extend
|
|||||||
url: "#{$data_host}/user/orders.json"
|
url: "#{$data_host}/user/orders.json"
|
||||||
data: JSON.stringify(dataObject)
|
data: JSON.stringify(dataObject)
|
||||||
success: (response) =>
|
success: (response) =>
|
||||||
@store.pushPayload('order', response) if response.order
|
@store.pushPayload(order: response.order) if response.order
|
||||||
@transitionToRoute 'active_list'
|
@transitionToRoute 'active_list'
|
||||||
@get('product_orders').invoke 'unloadRecord'
|
@get('product_orders').invoke 'unloadRecord'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
App.TableController = Ember.ObjectController.extend
|
App.TableController = Ember.Controller.extend
|
||||||
join_request_sent: (-> @get('controllers.application.join_request_sent')).property('controllers.application.join_request_sent')
|
join_request_sent: (-> @get('controllers.application.join_request_sent')).property('controllers.application.join_request_sent')
|
||||||
tableCanTakeOrders: (->
|
tableCanTakeOrders: (->
|
||||||
return false unless @get('supplier.can_take_orders')
|
return false unless @get('supplier.can_take_orders')
|
||||||
list = @get('controllers.application.list')
|
list = @get('globals.list')
|
||||||
if list
|
if list
|
||||||
return false unless list.get('supplier.id') == @get('supplier.id')
|
return false unless list.get('supplier.id') == @get('supplier.id')
|
||||||
return false unless list.get('table.id') == @get('model.id')
|
return false unless list.get('table.id') == @get('model.id')
|
||||||
@@ -11,6 +11,7 @@ App.TableController = Ember.ObjectController.extend
|
|||||||
# no list and open supplier
|
# no list and open supplier
|
||||||
if @get('model.occupied') then false else true
|
if @get('model.occupied') then false else true
|
||||||
).property('controllers.application.list.id', 'supplier.can_take_orders', 'model.occupied', 'model.id', 'controllers.application.list.table.id')
|
).property('controllers.application.list.id', 'supplier.can_take_orders', 'model.occupied', 'model.id', 'controllers.application.list.table.id')
|
||||||
|
supplier: Ember.computed 'model.supplier', -> @get('model.supplier')
|
||||||
showJoinButton: (->
|
showJoinButton: (->
|
||||||
return false unless @get('supplier.can_take_orders')
|
return false unless @get('supplier.can_take_orders')
|
||||||
return false if @get('controllers.application.list') # if you already have an active list, do not join another
|
return false if @get('controllers.application.list') # if you already have an active list, do not join another
|
||||||
|
|||||||
@@ -15,13 +15,10 @@ ControllerExtensions = Ember.Mixin.create
|
|||||||
modal: (name, options={})->
|
modal: (name, options={})->
|
||||||
options.model ||= Ember.Object.create()
|
options.model ||= Ember.Object.create()
|
||||||
@send "openModal", name, options
|
@send "openModal", name, options
|
||||||
Ember.ArrayController.reopen ControllerExtensions
|
|
||||||
Ember.Controller.reopen ControllerExtensions
|
|
||||||
Ember.ObjectController.reopen ControllerExtensions
|
|
||||||
Ember.Controller.reopen
|
|
||||||
redirect_to: (route, args...)->
|
redirect_to: (route, args...)->
|
||||||
route = 'index' if route == 'user_root'
|
route = 'index' if route == 'user_root'
|
||||||
route_object= App.Router.router.recognizer.names[route]
|
#route_object= App.Router.router.recognizer.names[route]
|
||||||
|
route_object = @get "target.router.recognizer.names.#{route}"
|
||||||
throw "Route #{route} cannot exist" unless route_object
|
throw "Route #{route} cannot exist" unless route_object
|
||||||
dynamic_segments = route_object.segments.reduce (sum, segment) ->
|
dynamic_segments = route_object.segments.reduce (sum, segment) ->
|
||||||
if segment.name then sum + 1 else sum
|
if segment.name then sum + 1 else sum
|
||||||
@@ -38,7 +35,11 @@ Ember.Controller.reopen
|
|||||||
@transitionToRoute.apply(@,route_args).then =>
|
@transitionToRoute.apply(@,route_args).then =>
|
||||||
if options.message
|
if options.message
|
||||||
tkey = if options.message.indexOf('.') > -1 then options.message else "messages.#{options.message}"
|
tkey = if options.message.indexOf('.') > -1 then options.message else "messages.#{options.message}"
|
||||||
@set 'controllers.application.notice', t(tkey)
|
@set 'globals.notice', t(tkey)
|
||||||
|
#Ember.ArrayController.reopen ControllerExtensions
|
||||||
|
Ember.Controller.reopen ControllerExtensions
|
||||||
|
#Ember.ObjectController.reopen ControllerExtensions
|
||||||
|
#Ember.Controller.reopen
|
||||||
#confirm: (options = {})->
|
#confirm: (options = {})->
|
||||||
##@showModal options
|
##@showModal options
|
||||||
##$(document).foundation('reflow') # needed (stupid!!!)
|
##$(document).foundation('reflow') # needed (stupid!!!)
|
||||||
@@ -54,10 +55,10 @@ Ember.Controller.reopen
|
|||||||
#$('#confirm-modal').foundation('reveal', 'open') #this kills the ember actions
|
#$('#confirm-modal').foundation('reveal', 'open') #this kills the ember actions
|
||||||
#$('#confirm-modal').css('visibility', 'visible').show()
|
#$('#confirm-modal').css('visibility', 'visible').show()
|
||||||
|
|
||||||
Ember.ArrayController.reopen
|
#Ember.ArrayController.reopen
|
||||||
redirect_to: (route, options={})->
|
#redirect_to: (route, options={})->
|
||||||
route = 'index' if route == 'user_root'
|
#route = 'index' if route == 'user_root'
|
||||||
@transitionToRoute(route).then =>
|
#@transitionToRoute(route).then =>
|
||||||
if options.message
|
#if options.message
|
||||||
tkey = if options.message.indexOf('.') > -1 then options.message else "messages.#{options.message}"
|
#tkey = if options.message.indexOf('.') > -1 then options.message else "messages.#{options.message}"
|
||||||
@set 'controllers.application.notice', t(tkey)
|
#@set 'globals.notice', t(tkey)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ DS.Model.reopen
|
|||||||
created_at: DS.attr('date')
|
created_at: DS.attr('date')
|
||||||
updated_at: DS.attr('date')
|
updated_at: DS.attr('date')
|
||||||
eraseRecord: ->
|
eraseRecord: ->
|
||||||
@clearRelationships()
|
#@clearRelationships()
|
||||||
@transitionTo('deleted.saved')
|
@transitionTo('deleted.saved')
|
||||||
DS.Model.reopenClass
|
DS.Model.reopenClass
|
||||||
findCached: (id)->
|
findCached: (id)->
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
controller = @controllerFor('application')
|
controller = @controllerFor('application')
|
||||||
controller.setCurrentList ->
|
controller.setCurrentList ->
|
||||||
@transitionTo('active_list')
|
@transitionTo('active_list')
|
||||||
controller.set 'notice', t('messages.authenticated')
|
controller.set 'globals.notice', t('messages.authenticated')
|
||||||
actions:
|
actions:
|
||||||
obtain_token: ( options = {} ) ->
|
obtain_token: ( options = {} ) ->
|
||||||
provider = options.provider || 'facebook'
|
provider = options.provider || 'facebook'
|
||||||
@@ -97,7 +97,8 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
else
|
else
|
||||||
message = t('errors.404.general.message')
|
message = t('errors.404.general.message')
|
||||||
@transitionTo('index').then (route)->
|
@transitionTo('index').then (route)->
|
||||||
route.get('controller.controllers.application').set 'notice', message if route and route.get
|
#route.get('controller.controllers.application').set 'notice', message if route and route.get
|
||||||
|
route.set 'globals.notice', message if route and route.set
|
||||||
$log
|
$log
|
||||||
action: 'applicationerror'
|
action: 'applicationerror'
|
||||||
error: error.message
|
error: error.message
|
||||||
@@ -164,7 +165,8 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
ar.send('selectQr', _id: table_id)
|
ar.send('selectQr', _id: table_id)
|
||||||
else
|
else
|
||||||
ar.transitionTo('index').then (route)->
|
ar.transitionTo('index').then (route)->
|
||||||
route.get('controller.controllers.application').set 'notice', "we got a barcode: '#{result.text}' but cannot extract a table id"
|
#route.get('controller.controllers.application').set 'notice', "we got a barcode: '#{result.text}' but cannot extract a table id"
|
||||||
|
route.set 'globals.notice', "we got a barcode: '#{result.text}' but cannot extract a table id"
|
||||||
$log
|
$log
|
||||||
action: 'qrscan'
|
action: 'qrscan'
|
||||||
error: 'cannot extract table id'
|
error: 'cannot extract table id'
|
||||||
@@ -176,7 +178,8 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
error: 'scan failed'
|
error: 'scan failed'
|
||||||
info: error
|
info: error
|
||||||
ar.transitionTo('index').then (route)->
|
ar.transitionTo('index').then (route)->
|
||||||
route.get('controller.controllers.application').set 'notice', "scanning failed: #{error}"
|
#route.get('controller.controllers.application').set 'notice', "scanning failed: #{error}"
|
||||||
|
route.set 'globals.notice', "scanning failed: #{error}"
|
||||||
<% else %>
|
<% else %>
|
||||||
@transitionTo 'select_qrcode'
|
@transitionTo 'select_qrcode'
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,40 +1,7 @@
|
|||||||
#App.ApplicationSerializer = DS.ActiveModelSerializer.extend
|
|
||||||
#serializeBelongsTo: (record, json, relationship) ->
|
|
||||||
#console.log "Serialize belongsTo #{record.toString()}"
|
|
||||||
#key = relationship.key
|
|
||||||
#belongsTo = Ember.get(record, key)
|
|
||||||
#key = (if @keyForRelationship then @keyForRelationship(key, "belongsTo") else key)
|
|
||||||
#if relationship.options.embedded is "always"
|
|
||||||
#json[key] = belongsTo.serialize()
|
|
||||||
#else
|
|
||||||
#@_super record, json, relationship
|
|
||||||
|
|
||||||
#serializeHasMany: (record, json, relationship) ->
|
|
||||||
#console.log "Serialize hasMany #{record.toString()}"
|
|
||||||
#key = relationship.key
|
|
||||||
#hasMany = Ember.get(record, key)
|
|
||||||
#relationshipType = DS.RelationshipChange.determineRelationshipType(record.constructor, relationship)
|
|
||||||
#if relationship.options.embedded is "always"
|
|
||||||
#if hasMany and relationshipType is "manyToNone" or relationshipType is "manyToMany" or relationshipType is "manyToOne"
|
|
||||||
#json[key] = []
|
|
||||||
#hasMany.forEach (item, index) ->
|
|
||||||
#json[key].push item.serialize()
|
|
||||||
#else
|
|
||||||
#@_super record, json, relationship
|
|
||||||
|
|
||||||
App.ApplicationSerializer = DS.ActiveModelSerializer.extend()
|
App.ApplicationSerializer = DS.ActiveModelSerializer.extend()
|
||||||
App.ApplicationStore = DS.Store.extend
|
App.ApplicationAdapter = DS.ActiveModelAdapter.extend
|
||||||
#adapter: DS.RESTAdapter.extend
|
host: $data_host
|
||||||
#host: $data_host
|
namespace: 'user'
|
||||||
#namespace: 'user'
|
headers:
|
||||||
## user underscored paths
|
"Accept": "application/json, text/javascript; q=0.01"
|
||||||
#pathForType: (type)->
|
|
||||||
#decamelized = Ember.String.decamelize(type)
|
|
||||||
#Ember.String.pluralize(decamelized)
|
|
||||||
#headers:
|
|
||||||
#Accept: 'application/json'
|
|
||||||
adapter: DS.ActiveModelAdapter.extend
|
|
||||||
host: $data_host
|
|
||||||
namespace: 'user'
|
|
||||||
headers:
|
|
||||||
"Accept": "application/json, text/javascript; q=0.01"
|
|
||||||
|
|||||||
@@ -16,7 +16,11 @@ if list.closed_at
|
|||||||
if list.orders.isLoaded
|
if list.orders.isLoaded
|
||||||
if list.sorted_orders
|
if list.sorted_orders
|
||||||
.list-orders-container
|
.list-orders-container
|
||||||
each order in list.sorted_orders: = view "list-order" contentBinding="order"
|
each order in list.sorted_orders
|
||||||
|
= list-order order=order
|
||||||
|
/= order.display
|
||||||
|
/span.currency= currency order.total
|
||||||
|
/span.created_at= time order.created_at format="H:mm"
|
||||||
if list.showTotal
|
if list.showTotal
|
||||||
.list-orders-total.total
|
.list-orders-total.total
|
||||||
= t 'total'
|
= t 'total'
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
= partial "global/side_menu"
|
= partial "global/side_menu"
|
||||||
.main-section
|
.main-section
|
||||||
.main-section-content
|
.main-section-content
|
||||||
if notice
|
if globals.notice
|
||||||
#notice.alert-box{action "clearNotice"} data-alert=true
|
#notice.alert-box{action "clearNotice"} data-alert=true
|
||||||
a.right href="#"
|
a.right href="#"
|
||||||
span.fa.fa-times.fa-lg
|
span.fa.fa-times.fa-lg
|
||||||
span= notice
|
span= globals.notice
|
||||||
= outlet
|
= outlet
|
||||||
=outlet modal
|
=outlet modal
|
||||||
|
|||||||
@@ -2,30 +2,30 @@
|
|||||||
.top-menu-bar
|
.top-menu-bar
|
||||||
.menu-content
|
.menu-content
|
||||||
section.main-buttons
|
section.main-buttons
|
||||||
if list.id
|
if globals.list.id
|
||||||
link-to 'index' class="top-menu-logo with-list"
|
link-to 'index' class="top-menu-logo with-list"
|
||||||
= image_tag 'user/logo-small.png'
|
= image_tag 'user/logo-small.png'
|
||||||
= view "menu-item" route="active_list"
|
= menu-item route="active_list" reference_controller=controller
|
||||||
= view "menu-item" route="table" route_param=list.table.id
|
= menu-item route="table" route_param=globals.list.table.id reference_controller=controller
|
||||||
= view "menu-item-list-needs-help"
|
= menu-item-list-needs-help reference_controller=controller
|
||||||
= view "menu-item-list-needs-payment"
|
= menu-item-list-needs-payment reference_controller=controller
|
||||||
else
|
else
|
||||||
link-to 'index' class="top-menu-logo without-list"
|
link-to 'index' class="top-menu-logo without-list"
|
||||||
= image_tag 'user/logo-small.png'
|
= image_tag 'user/logo-small.png'
|
||||||
= view "menu-item-scan-qr"
|
= menu-item-scan-qr reference_controller=controller
|
||||||
= view "menu-item-product-orders"
|
= menu-item-product-orders reference_controller=controller
|
||||||
if list
|
if globals.list
|
||||||
.extra-info{action "showSupplierStatusInfo"}
|
.extra-info{action "showSupplierStatusInfo"}
|
||||||
.supplier-info-row
|
.supplier-info-row
|
||||||
/ .supplier-name= list.supplier.name
|
/ .supplier-name= list.supplier.name
|
||||||
.table-number
|
.table-number
|
||||||
|#
|
|#
|
||||||
= list.table.number
|
= globals.list.table.number
|
||||||
.supplier-info-row
|
.supplier-info-row
|
||||||
.counter.supplier-orders-placed-count
|
.counter.supplier-orders-placed-count
|
||||||
= list.supplier.orders_placed_count
|
= globals.list.supplier.orders_placed_count
|
||||||
span.orders-placed-count-icon
|
span.orders-placed-count-icon
|
||||||
.supplier-info-row
|
.supplier-info-row
|
||||||
.counter.supplier-orders-in-process-count
|
.counter.supplier-orders-in-process-count
|
||||||
= list.supplier.orders_in_process_count
|
= globals.list.supplier.orders_in_process_count
|
||||||
span.orders-in-process-count-icon
|
span.orders-in-process-count-icon
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
App.MenuItemListNeedsHelpView = Ember.View.extend Ember.ViewTargetActionSupport,
|
|
||||||
action: 'listNeedsHelp'
|
|
||||||
templateName: "menu/list_needs_help"
|
|
||||||
classNames: 'menu-list-item callout'
|
|
||||||
classNameBindings: ['controller.list.needs_help:active']
|
|
||||||
click: ->
|
|
||||||
if @get('controller.list.needs_help')
|
|
||||||
@set 'controller.notice', t('list_needs_help.help_is_on_its_way')
|
|
||||||
else
|
|
||||||
@triggerAction()
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
App.MenuItemScanQrView = Ember.View.extend Ember.ViewTargetActionSupport,
|
|
||||||
action: 'scanQr'
|
|
||||||
templateName: "menu/scan_qr"
|
|
||||||
classNames: 'menu-list-item'
|
|
||||||
click: -> @triggerAction()
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
App.MenuItemView = Ember.View.extend
|
|
||||||
classNames: 'menu-list-item'
|
|
||||||
classNameBindings: ['active']
|
|
||||||
click: ->
|
|
||||||
if @route_param
|
|
||||||
@get('controller').transitionToRoute(@route, @route_param)
|
|
||||||
else
|
|
||||||
@get('controller').transitionToRoute(@route)
|
|
||||||
active: (->
|
|
||||||
if @get('controller.currentPath') == @route then 'active' else ''
|
|
||||||
).property('controller.currentPath')
|
|
||||||
init: ->
|
|
||||||
@templateName = "menu/#{@route}"
|
|
||||||
@_super()
|
|
||||||
+1
-1
@@ -139,7 +139,7 @@ RSpec.configure do |config|
|
|||||||
|
|
||||||
# Use color in STDOUT
|
# Use color in STDOUT
|
||||||
config.color = true
|
config.color = true
|
||||||
config.fail_fast = false
|
config.fail_fast = true
|
||||||
|
|
||||||
# Use color not only in STDOUT but also in pagers and files
|
# Use color not only in STDOUT but also in pagers and files
|
||||||
config.tty = true
|
config.tty = true
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Supplier
|
|||||||
|
|
||||||
User
|
User
|
||||||
----
|
----
|
||||||
|
- Implement https://github.com/EddyVerbruggen/Custom-URL-scheme with mozo:// scheme
|
||||||
- test met veel producten
|
- test met veel producten
|
||||||
- product variants
|
- product variants
|
||||||
- option to make products inactive, no order plus and click on name
|
- option to make products inactive, no order plus and click on name
|
||||||
|
|||||||
Reference in New Issue
Block a user