Add remove list needs payment functionality
This commit is contained in:
@@ -49,4 +49,7 @@ App.List = DS.Model.extend
|
||||
is_helped: ->
|
||||
@markHelped()
|
||||
$.post Routes.supplier_mark_list_as_helped_path(), list_id: @id
|
||||
remove_needs_payment: ->
|
||||
@set 'needs_payment', false
|
||||
$.post Routes.supplier_remove_list_needs_payment_path(), list_id: @id
|
||||
sorted_orders: (-> @get('relevant_orders').sortBy('created_at').reverseObjects()).property('relevant_orders.@each.isLoaded')
|
||||
|
||||
@@ -17,6 +17,7 @@ td.actions
|
||||
i.fa.fa-bell.fa-stack-small
|
||||
i.fa.fa-ban.revoke
|
||||
App.MarkListHelpedButtonView content=view.content
|
||||
App.RemoveListNeedsPaymentView content=view.content
|
||||
App.CloseListButtonView content=view.content
|
||||
|
||||
button.show-list.button{action "showList" view.content.id}: span
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
span.fa-stack.fa-2x.fa-stack-sized
|
||||
i.fa.fa-money.fa-stack-small
|
||||
i.fa.fa-ban.revoke
|
||||
@@ -0,0 +1,7 @@
|
||||
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()
|
||||
@@ -60,6 +60,10 @@ root.Qsupplier =
|
||||
else if e.event == 'order_being_delivered'
|
||||
order.markDelivered() if order = App.Order.findCached(e.data.id)
|
||||
|
||||
else if e.event == 'remove_list_needs_payment'
|
||||
if list = App.List.findCached(e.data.id)
|
||||
list.set 'needs_payment', false
|
||||
|
||||
else if e.event == 'orders_in_process_count'
|
||||
$('.supplier-orders-in-process-count-number').text e.data.count
|
||||
else if e.event == 'orders_placed_count'
|
||||
|
||||
@@ -78,6 +78,9 @@ App.ApplicationController = Ember.Controller.extend
|
||||
# list.get('orders').addObject(order)
|
||||
|
||||
|
||||
remove_list_needs_payment: (data)->
|
||||
if list = @store.all('list').findBy 'id', data.id
|
||||
list.set 'needs_payment', false
|
||||
setCurrentList: (callback)->
|
||||
success = (list)=>
|
||||
#@store.find('list', 'current').deleteRecord() # gets not replaced, buty stays as dummy
|
||||
|
||||
@@ -19,6 +19,12 @@ $button-spacing: 8px
|
||||
padding-left: 8px //do not ask me why, just looks
|
||||
padding-right: 2px //do not ask me why, just looks
|
||||
margin-right: $button-spacing
|
||||
.remove_list_needs_payment
|
||||
+button-icon-only
|
||||
vertical-align: top
|
||||
padding-left: 8px //do not ask me why, just looks
|
||||
padding-right: 2px //do not ask me why, just looks
|
||||
margin-right: $button-spacing
|
||||
.close-list-button
|
||||
+button-icon-only
|
||||
.active-orders-table
|
||||
|
||||
Reference in New Issue
Block a user