mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
commit
0fb6b3095f
4 changed files with 14 additions and 29 deletions
app
templates/account
views/account
|
@ -1,19 +1,19 @@
|
|||
extends /templates/core/modal-base
|
||||
|
||||
block modal-header-content
|
||||
h3 Prepaid Code Details (#{ppc.get('code')})
|
||||
h3 Prepaid Code Details (#{view.ppc.get('code')})
|
||||
|
||||
block modal-body-content
|
||||
if redeemedOn
|
||||
p You redeemed this code: #{redeemedOn}
|
||||
if view.redeemedOn
|
||||
p You redeemed this code: #{view.redeemedOn}
|
||||
else
|
||||
if ppc.openSpots()
|
||||
p: strong Adds #{ppc.get('properties').months} month(s) to your current subscription.
|
||||
if view.ppc.openSpots()
|
||||
p: strong Adds #{view.ppc.get('properties').months} month(s) to your current subscription.
|
||||
p You can redeem this code.
|
||||
else
|
||||
p You cannot redeem this code.
|
||||
|
||||
block modal-footer-content
|
||||
button#close.btn.btn-primary(type="button", data-dismiss="modal") Cancel
|
||||
if !redeemedOn && ppc.openSpots() > 0
|
||||
if !view.redeemedOn && view.ppc.openSpots() > 0
|
||||
button#redeem.btn.btn-primary(type="button", data-dismiss="modal") Redeem Code To My Account
|
||||
|
|
|
@ -30,16 +30,16 @@ block content
|
|||
.form-group
|
||||
label.control-label.col-md-2(for="users", data-i18n="account_prepaid.users")
|
||||
.col-md-2
|
||||
input#users-input.form-control(name="users", type="number", value="#{purchase.users}", min=1)
|
||||
input#users-input.form-control(name="users", type="number", value="#{view.purchase.users}", min=1)
|
||||
.form-group
|
||||
label.control-label.col-md-2(for="months", data-i18n="account_prepaid.months")
|
||||
.col-md-2
|
||||
input#months-input.form-control(name="months", type="number", value="#{purchase.months}", min=1)
|
||||
input#months-input.form-control(name="months", type="number", value="#{view.purchase.months}", min=1)
|
||||
.form-group
|
||||
label.control-label.col-md-2(data-i18n="account_prepaid.purchase_total")
|
||||
.col-md-10
|
||||
p.form-control-static $
|
||||
span#total #{(purchase.total/100).toFixed(2)}
|
||||
span#total #{(view.purchase.total/100).toFixed(2)}
|
||||
button#purchase-btn.btn.btn-success.pull-right(data-i18n="account_prepaid.purchase_button")
|
||||
.row
|
||||
.col-md-12
|
||||
|
@ -53,10 +53,10 @@ block content
|
|||
p
|
||||
span(data-i18n="account_prepaid.prepaid_code")
|
||||
span.spr :
|
||||
input.input-ppc(name="ppc", type="text", value="#{ppc}", required)
|
||||
if ppcInfo && ppcInfo.length > 0
|
||||
input.input-ppc(name="ppc", type="text", value="#{view.ppc}", required)
|
||||
if view.ppcInfo && view.ppcInfo.length > 0
|
||||
p
|
||||
each info in ppcInfo
|
||||
each info in view.ppcInfo
|
||||
div
|
||||
!= info
|
||||
p
|
||||
|
@ -73,7 +73,7 @@ block content
|
|||
span(data-i18n="account_prepaid.your_codes")
|
||||
.panel-collapse.collapse.in#codeslist
|
||||
.panel-body
|
||||
if codes && codes.length
|
||||
if view.codes && view.codes.length
|
||||
table.table.table-striped
|
||||
tr
|
||||
th
|
||||
|
@ -83,7 +83,7 @@ block content
|
|||
th Remaining Users
|
||||
th Total Users
|
||||
th(data-i18n="user.status")
|
||||
for code in codes.models
|
||||
for code in view.codes.models
|
||||
if code.get('type') === 'terminal_subscription'
|
||||
- var owner = (code.get('creator') == me.id ? true : false)
|
||||
- var properties = code.get('properties')
|
||||
|
|
|
@ -17,11 +17,5 @@ module.exports = class PrepaidRedeemModal extends ModalView
|
|||
hasRedeemed = @ppc.userHasRedeemed(me.get('_id'))
|
||||
@redeemedOn = new moment(hasRedeemed).calendar() if hasRedeemed
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.ppc = @ppc
|
||||
c.redeemedOn = @redeemedOn if @redeemedOn
|
||||
c
|
||||
|
||||
onRedeemClicked: ->
|
||||
@trigger 'confirm-redeem'
|
||||
|
|
|
@ -52,15 +52,6 @@ module.exports = class PrepaidView extends RootView
|
|||
@updateTotal()
|
||||
super()
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.purchase = @purchase
|
||||
c.codes = @codes
|
||||
c.ppc = @ppc
|
||||
c.ppcInfo = @ppcInfo ? []
|
||||
c.ppcQuery = @ppcQuery ? false
|
||||
c
|
||||
|
||||
afterRender: ->
|
||||
super()
|
||||
@$el.find("span[title]").tooltip()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue