Refactor PaymentsView to use view in template

This commit is contained in:
Scott Erickson 2015-10-21 17:11:10 -07:00
parent 680eb04285
commit ddf351aac7
2 changed files with 2 additions and 7 deletions
app
templates/account
views/account

View file

@ -10,7 +10,7 @@ block content
a(href="/account", data-i18n="nav.account") a(href="/account", data-i18n="nav.account")
li.active(data-i18n="account.payments") li.active(data-i18n="account.payments")
if payments.models.length if view.payments.models.length
table.table.table-striped table.table.table-striped
tr tr
th(data-i18n="account.purchased") th(data-i18n="account.purchased")
@ -18,7 +18,7 @@ block content
th(data-i18n="account.service") th(data-i18n="account.service")
th(data-i18n="account.price") th(data-i18n="account.price")
th(data-i18n="account.gems") th(data-i18n="account.gems")
for payment in payments.models for payment in view.payments.models
- var service = payment.get('service') - var service = payment.get('service')
tr tr
if payment.get('productID') if payment.get('productID')

View file

@ -11,8 +11,3 @@ module.exports = class PaymentsView extends RootView
super(options) super(options)
@payments = new CocoCollection([], { url: '/db/payment', model: Payment, comparator:'_id' }) @payments = new CocoCollection([], { url: '/db/payment', model: Payment, comparator:'_id' })
@supermodel.loadCollection(@payments, 'payments', {cache: false}) @supermodel.loadCollection(@payments, 'payments', {cache: false})
getRenderData: ->
c = super()
c.payments = @payments
c