Conceptual architectural change for CLI user app

This commit is contained in:
2015-09-07 19:10:54 +02:00
parent 4ef7ecba41
commit 1caa488524
15 changed files with 163 additions and 140 deletions
@@ -0,0 +1,7 @@
App.ButtonRemoveListNeedsPaymentComponent = Ember.Component.extend
tagName: 'button'
layoutName: 'components/button/remove-list-needs-payment'
classNames: ['remove_list_needs_payment']
classNameBindings: ['content.needs_payment:show:hide']
click: ->
@get('content').invoke 'remove_needs_payment'
@@ -115,17 +115,17 @@ App.ApplicationRoute = Ember.Route.extend
close: -> table.rollbackAttributes()
events:
list_needs_help: (data) ->
if list = @store.getById('list', data.id)
if list = @store.peekRecord('list', data.id)
list.isNeedingHelp()
return if @get('globals.active_section.id') and list.get('section.id') isnt @get('globals.active_section.id')
@set 'globals.flash_message', t('table.needs_help.flash_message', number: list.get('table.number') || -1)
try ion.sound.play 'bell_ring'
list_needs_payment: (data) ->
if list = @store.getById('list', data.id)
if list = @store.peekRecord('list', data.id)
list.isNeedingPayment()
return if @get('globals.active_section.id') and list.get('section.id') isnt @get('globals.active_section.id')
try ion.sound.play 'water_droplet_3'
list_is_paid: (data) -> list.isPaid() if list = @store.getById('list', data.id)
list_is_paid: (data) -> list.isPaid() if list = @store.peekRecord('list', data.id)
list_update: (data) ->
new_order_id = data.new_order_id
delete data.new_order_id
@@ -19,6 +19,7 @@ td.actions
i.fa.fa-ban.revoke
/= view "mark-list-helped-button" content=list
= button-mark-list-helped content=list
= button-remove-list-needs-payment content=list
/= view "remove-list-needs-payment" content=list
/= view "close-list-button" content=list
= button-close-list content=list
@@ -1,7 +0,0 @@
#App.RemoveListNeedsPaymentView = Ember.View.extend
# templateName: 'remove_list_needs_payment_button'
# classNames: ['remove_list_needs_payment']
# classNameBindings: ['content.needs_payment:show:hide']
# tagName: 'button'
# click: (e)->
# @get('content').then (l)->l.remove_needs_payment()