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