Fix bug with unlinking user orders on lists load over active list
This commit is contained in:
@@ -9,4 +9,4 @@ App.Order = DS.Model.extend
|
||||
).property('product_orders.@each.quantity')
|
||||
display: (->
|
||||
@get('product_orders').map((po) -> "#{po.get('quantity')} x #{po.get('product.name')}").join(', ')
|
||||
).property('product_orders.@each.quantity')
|
||||
).property('product_orders.@each.quantity', 'product_orders.@each.product.@each.name')
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
attr = DS.attr
|
||||
App.ProductOrder = DS.Model.extend
|
||||
quantity: attr 'number', defaultValue: 1
|
||||
product: DS.belongsTo('product')
|
||||
price: attr 'number'
|
||||
product_name: attr('string')
|
||||
product: DS.belongsTo('product')
|
||||
order: DS.belongsTo('order')
|
||||
placed: attr('boolean', defaultValue: false)
|
||||
placed: attr('boolean', defaultValue: false) # virtual attribute for new orders to be placed, should be more elegant
|
||||
increment: ->
|
||||
@set('quantity', @get('quantity') + 1)
|
||||
total: (-> @get('quantity') * @get('product.price')).property('quantity')
|
||||
total: (-> @get('quantity') * @get('price')).property('quantity', 'price')
|
||||
setOrder: (order)->
|
||||
@set('placed', true)
|
||||
@set('order', order)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
App.Section = DS.Model.extend {}
|
||||
@@ -1,50 +1,3 @@
|
||||
/.top-menu.off-canvas-wrap
|
||||
.inner-wrap
|
||||
nav.tab-bar
|
||||
section.left-small
|
||||
a.left-off-canvas-toggle.menu-icon
|
||||
span
|
||||
section.right.tab-bar-section
|
||||
= link-to 'index'
|
||||
= image_tag 'icons/logo-small.png'
|
||||
a{ action "openDebugger"} alt=""
|
||||
span.fa.fa-wrench.fa-lg
|
||||
.right
|
||||
if list.id
|
||||
App.MenuItemView route="active_list"
|
||||
App.MenuItemView route='table' route_param=list.table.id
|
||||
App.MenuItemListNeedsHelpView
|
||||
App.MenuItemListNeedsPaymentView
|
||||
aside.left-off-canvas-menu
|
||||
ul.off-canvas-list
|
||||
li: h3 Menu
|
||||
li
|
||||
= link-to 'index'
|
||||
span Home
|
||||
li
|
||||
a{action scanQr bubbles=false}
|
||||
span Scan QR
|
||||
if list.id
|
||||
li
|
||||
=link-to 'table' list.table.id
|
||||
span= t 'list_products.title'
|
||||
li
|
||||
=link-to 'active_list'
|
||||
span= t 'active_list.title'
|
||||
li
|
||||
=link-to 'lists'
|
||||
span= t 'models.plural.list'
|
||||
li
|
||||
=link-to 'join_requests'
|
||||
span= t 'models.plural.join_request'
|
||||
section.main-section
|
||||
if notice
|
||||
#notice.alert-box{action clearNotice} data-alert=true
|
||||
a.right href="#"
|
||||
span.fa.fa-times.fa-lg
|
||||
span= notice
|
||||
= outlet
|
||||
a.exit-off-canvas
|
||||
header.top-menu
|
||||
.toggle-side-menu
|
||||
span
|
||||
@@ -85,16 +38,16 @@ aside.side-menu
|
||||
span Scan QR
|
||||
if list.id
|
||||
li
|
||||
=link-to 'table' list.table.id
|
||||
=link-to 'table' list.table.id class="side-menu-list-products"
|
||||
span.fa.fa-cutlery
|
||||
span.fa.fa-glass
|
||||
= t 'list_products.title'
|
||||
li
|
||||
=link-to 'active_list'
|
||||
=link-to 'active_list' class="side-menu-active-list"
|
||||
span.active-list-icon
|
||||
span= t 'active_list.title'
|
||||
li
|
||||
=link-to 'lists'
|
||||
=link-to 'lists' class="side-menu-lists"
|
||||
span= t 'models.plural.list'
|
||||
li
|
||||
=link-to 'join_requests'
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
.row
|
||||
h2=t 'models.plural.list'
|
||||
each list in controller
|
||||
.lists-overview-entry{action showList list}
|
||||
.lists-overview-entry{action "showList" list}
|
||||
span.created_at=time list.created_at
|
||||
span.price.currency= currency list.price
|
||||
span.name= list.supplier_name
|
||||
hr
|
||||
.clearfix
|
||||
if hasMore
|
||||
button{action showMore} Show more
|
||||
button{action "showMore"}=t 'lists.show_more'
|
||||
|
||||
Reference in New Issue
Block a user