codecombat/app/templates/account/prepaid-view.jade

106 lines
4.6 KiB
Text
Raw Normal View History

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")
2015-10-23 11:49:05 -04:00
li.active(data-i18n="account.prepaid_codes")
2015-09-25 13:03:44 -04:00
.row
.col-md-12
.panel.panel-default
.panel-heading
.panel-title
a(data-toggle="collapse" href="#purchasepanel")
span(data-i18n="account_prepaid.purchase_code")
.panel-collapse.collapse(class=view.ppcQuery ? "": "in")#purchasepanel
2015-09-25 13:03:44 -04:00
.panel-body
2015-10-23 11:49:05 -04:00
p(data-i18n="account_prepaid.purchase_code1")
p(data-i18n="account_prepaid.purchase_code2")
p(data-i18n="account_prepaid.purchase_code3")
2015-09-25 13:03:44 -04:00
.form-horizontal
.form-group
2015-10-23 11:49:05 -04:00
label.control-label.col-md-2(for="users", data-i18n="account_prepaid.users")
2015-09-25 13:03:44 -04:00
.col-md-2
2016-05-13 07:18:17 -04:00
input#users-input.form-control(name="users", type="number", value="#{view.purchase.users}", min=1)
2015-09-25 13:03:44 -04:00
.form-group
2015-10-23 11:49:05 -04:00
label.control-label.col-md-2(for="months", data-i18n="account_prepaid.months")
2015-09-25 13:03:44 -04:00
.col-md-2
2016-05-13 07:18:17 -04:00
input#months-input.form-control(name="months", type="number", value="#{view.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 $
2016-05-13 07:18:17 -04:00
span#total #{(view.purchase.total/100).toFixed(2)}
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
p
2015-10-23 11:49:05 -04:00
span(data-i18n="account_prepaid.prepaid_code")
span.spr :
2016-05-13 07:18:17 -04:00
input.input-ppc(name="ppc", type="text", value="#{view.ppc}", required)
if view.ppcInfo && view.ppcInfo.length > 0
p
2016-05-13 07:18:17 -04:00
each info in view.ppcInfo
div
!= info
p
span.spr
2015-10-23 11:49:05 -04:00
button#lookup-code-btn.btn.btn-info(data-i18n="account_prepaid.lookup_code")
span
2015-10-23 11:49:05 -04:00
button#redeem-code-btn.btn.btn-success(data-i18n="account_prepaid.apply_account")
2015-09-25 13:03:44 -04:00
.row
.col-md-12
2015-12-14 14:10:37 -05:00
#codes-panel.panel.panel-default
2015-09-25 13:03:44 -04:00
.panel-heading
.panel-title
a(data-toggle="collapse" href="#codeslist")
span(data-i18n="account_prepaid.your_codes")
.panel-collapse.collapse.in#codeslist
.panel-body
2016-05-13 07:18:17 -04:00
if view.codes && view.codes.length
2015-09-25 13:03:44 -04:00
table.table.table-striped
tr
th
2015-10-23 11:49:05 -04:00
span.spr(data-i18n="[title]account_prepaid.copy_link;general.code", title="You can copy the code's link and send it to someone.")
2015-09-25 13:03:44 -04:00
span.glyphicon.glyphicon-question-sign(aria-hidden="true")
2015-10-23 11:49:05 -04:00
th(data-i18n="account_prepaid.months")
th Remaining Users
th Total Users
2015-10-23 11:49:05 -04:00
th(data-i18n="user.status")
2016-05-13 07:18:17 -04:00
for code in view.codes.models
2015-09-25 13:03:44 -04:00
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')
- var redeemed = redeemers ? redeemers.length : 0
2015-09-25 13:03:44 -04:00
tr
td
a(href="/account/prepaid?_ppc=#{code.get('code')}")= code.get('code')
td= properties.months || '-'
if owner
td= code.get('maxRedeemers') - redeemed
td= code.get('maxRedeemers')
2015-10-23 11:49:05 -04:00
td(data-i18n="account.purchased")
2015-09-25 13:03:44 -04:00
else
td -
td -
2015-10-23 11:49:05 -04:00
td(data-i18n="account_prepaid.redeemed")
2015-09-25 13:03:44 -04:00
else
2015-10-23 11:49:05 -04:00
p(data-i18n="account_prepaid.no_codes")