Fix closing list problem not unlinking the table active list
This commit is contained in:
@@ -21,6 +21,7 @@ App.List = DS.Model.extend
|
||||
markClosed: ->
|
||||
@set('state', 'closed')
|
||||
#@set 'has_active_orders', false
|
||||
@set 'table', null
|
||||
@markHelped()
|
||||
@markIsPaid()
|
||||
markHelped: ->
|
||||
|
||||
@@ -32,3 +32,7 @@ App.Order = DS.Model.extend
|
||||
display: (->
|
||||
@get('product_orders').map((po) -> "#{po.get('quantity')} x #{po.get('product.name')}").join(', ')
|
||||
).property('product_orders.@each.quantity', 'product_orders.@each.product.@each.name')
|
||||
|
||||
display_tag: (->
|
||||
"<span class='display order-display order-#{@get('id')} #{@get('state')}'><span class='pre-display'></span>#{@get('display')}<span class='post-display'></span></span>".htmlSafe()
|
||||
).property('display', 'state')
|
||||
|
||||
@@ -6,10 +6,15 @@
|
||||
if table.active_list
|
||||
div.table-actions
|
||||
.title= table.number
|
||||
.table-action-row
|
||||
= view "mark-list-helped-button" contentBinding="table.active_list"
|
||||
= view "close-list-button" contentBinding="table.active_list"
|
||||
.table-action-row=currency table.active_list.total
|
||||
if table.active_list
|
||||
.table-action-row
|
||||
= view "mark-list-helped-button" contentBinding="table.active_list"
|
||||
= view "close-list-button" contentBinding="table.active_list"
|
||||
each order in table.active_list.active_orders
|
||||
.table-action-row= order.display_tag
|
||||
.table-action-row.total
|
||||
= link-to "list" table.active_list
|
||||
=currency table.active_list.total
|
||||
/.table-action-row
|
||||
a{action "editTable" table}: span.fa.fa-lg.fa-wrench
|
||||
each user in table.active_list.users
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
if content.list.needs_help
|
||||
li
|
||||
button.btn.btn-info.btn-small id="list-is-helped-button-#{content.list.id}" onclick="Qsupplier.mark_list_as_helped('{{content.list.id}}')" {{t "list.is_helped_button"}}
|
||||
button.btn.btn-warning.btn-small class="of-list-#{content.list.id}" onclick="Qsupplier.close_list('#{content.list.id}')" data-t="list.close_list"
|
||||
li
|
||||
a data-t='section.tables_view.table_actions.got_to_table' href="suppliers_table_path(@table)" {{t 'section.tables_view.table_actions.got_to_table'}}
|
||||
@@ -1,3 +0,0 @@
|
||||
App.TableActionsView = Ember.Component.extend
|
||||
tagName: 'ul'
|
||||
templateName: 'table_actions'
|
||||
@@ -102,6 +102,15 @@
|
||||
background-color: #aaa
|
||||
.table-action-row
|
||||
margin-top: 10px
|
||||
&.total
|
||||
font-size: 1.2em
|
||||
font-weight: bold
|
||||
.order-display
|
||||
&.active
|
||||
.post-display
|
||||
margin-left: 10px
|
||||
@extend .fa
|
||||
@extend .fa-check
|
||||
.table-settings
|
||||
width: 200px
|
||||
height: 30px
|
||||
|
||||
Reference in New Issue
Block a user