2015-09-25 13:03:44 -04:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
|
|
|
|
|
|
|
if me.get('anonymous')
|
|
|
|
p(data-i18n="account_settings.not_logged_in") Log in or create an account to change your settings.
|
|
|
|
|
|
|
|
else
|
|
|
|
ol.breadcrumb
|
|
|
|
li
|
|
|
|
a(href="/")
|
|
|
|
span.glyphicon.glyphicon-home
|
|
|
|
li
|
|
|
|
a(href="/account", data-i18n="nav.account")
|
|
|
|
li.active(data-i18n="account.prepaid")
|
|
|
|
|
|
|
|
.row
|
|
|
|
.col-md-12
|
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
|
|
|
.panel-title
|
|
|
|
a(data-toggle="collapse" href="#purchasepanel")
|
|
|
|
span(data-i18n="account_prepaid.purchase_code")
|
2015-09-25 18:21:48 -04:00
|
|
|
.panel-collapse.collapse(class=ppcQuery ? "": "in")#purchasepanel
|
2015-09-25 13:03:44 -04:00
|
|
|
.panel-body
|
|
|
|
p Subscription Codes can be redeemed to add premium subscription time to one or more Code Combat accounts.
|
|
|
|
p Each Code Combat account can only redeem a particular Subscription Code once.
|
|
|
|
p Subscription Code months will be added to the end of any existing subscription on the account.
|
|
|
|
.form-horizontal
|
|
|
|
.form-group
|
|
|
|
label.control-label.col-md-2(for="users") Users
|
|
|
|
.col-md-2
|
2015-10-21 17:16:44 -04:00
|
|
|
input#users-input.form-control(name="users", type="number", value="#{purchase.users}", min=1)
|
2015-09-25 13:03:44 -04:00
|
|
|
.form-group
|
|
|
|
label.control-label.col-md-2(for="months") Months
|
|
|
|
.col-md-2
|
2015-10-21 17:16:44 -04:00
|
|
|
input#months-input.form-control(name="months", type="number", value="#{purchase.months}", min=1)
|
2015-09-25 13:03:44 -04:00
|
|
|
.form-group
|
|
|
|
label.control-label.col-md-2(data-i18n="account_prepaid.purchase_total")
|
|
|
|
.col-md-10
|
|
|
|
p.form-control-static $
|
2015-10-01 18:23:20 -04:00
|
|
|
span#total #{purchase.total.toFixed(2)}
|
2015-10-21 17:16:44 -04:00
|
|
|
button#purchase-btn.btn.btn-success.pull-right(data-i18n="account_prepaid.purchase_button")
|
2015-09-25 13:03:44 -04:00
|
|
|
.row
|
|
|
|
.col-md-12
|
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
|
|
|
.panel-title
|
|
|
|
a(data-toggle="collapse" href="#redeempanel")
|
|
|
|
span(data-i18n="account_prepaid.redeem_codes")
|
|
|
|
.panel-collapse.collapse.in#redeempanel
|
|
|
|
.panel-body
|
2015-09-25 18:21:48 -04:00
|
|
|
p
|
|
|
|
span.spr Prepaid Code:
|
|
|
|
input.input-ppc(name="ppc", type="text", value="#{ppc}", required)
|
|
|
|
if ppcInfo && ppcInfo.length > 0
|
|
|
|
p
|
|
|
|
each info in ppcInfo
|
|
|
|
div
|
|
|
|
!= info
|
|
|
|
p
|
|
|
|
span.spr
|
2015-10-21 17:16:44 -04:00
|
|
|
button#lookup-code-btn.btn.btn-info Lookup prepaid code
|
2015-09-25 18:21:48 -04:00
|
|
|
span
|
2015-10-21 17:16:44 -04:00
|
|
|
button#redeem-code-btn.btn.btn-success Apply to your account
|
2015-09-25 13:03:44 -04:00
|
|
|
.row
|
|
|
|
.col-md-12
|
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
|
|
|
.panel-title
|
|
|
|
a(data-toggle="collapse" href="#codeslist")
|
|
|
|
span(data-i18n="account_prepaid.your_codes")
|
|
|
|
.panel-collapse.collapse.in#codeslist
|
|
|
|
.panel-body
|
|
|
|
if codes && codes.length
|
|
|
|
table.table.table-striped
|
|
|
|
tr
|
|
|
|
th
|
|
|
|
span(title="You can copy the code's link and send it to someone.") Code
|
|
|
|
span.glyphicon.glyphicon-question-sign(aria-hidden="true")
|
|
|
|
th Months
|
|
|
|
th Quantity
|
|
|
|
th Status
|
|
|
|
for code in codes.models
|
|
|
|
if code.get('type') === 'terminal_subscription'
|
|
|
|
- var owner = (code.get('creator') == me.id ? true : false)
|
|
|
|
- var properties = code.get('properties')
|
|
|
|
- var redeemers = code.get('redeemers')
|
|
|
|
if redeemers
|
|
|
|
- var redeemed = redeemers.length
|
|
|
|
else
|
|
|
|
- var redeemed = '0'
|
|
|
|
tr
|
|
|
|
td
|
|
|
|
a(href="/account/prepaid?_ppc=#{code.get('code')}")= code.get('code')
|
|
|
|
td= properties.months || '-'
|
|
|
|
if owner
|
|
|
|
td= code.get('maxRedeemers') - redeemed
|
|
|
|
else
|
|
|
|
td -
|
|
|
|
if owner
|
|
|
|
td Purchased
|
|
|
|
else
|
|
|
|
td Redeemed
|
|
|
|
else
|
2015-09-25 18:21:48 -04:00
|
|
|
p No codes yet!
|