mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
fec3ac38e9
Admins can generate a prepaid code, which a user can use to subscribe for free via the account/subscription page. The subscription will be identical to the normal monthly subscription (e.g. 3500 gems per month), except they won’t be charged. Does not require the recipient to enter billing information. Can be applied to an existing subscription, which will be converted to free. Prepaid code can only be used once. Prepaid subscription cannot be unsubscribed via the UI.
195 lines
8.5 KiB
Text
195 lines
8.5 KiB
Text
extends /templates/base
|
|
|
|
block content
|
|
|
|
ol.breadcrumb
|
|
li
|
|
a(href="/")
|
|
span.glyphicon.glyphicon-home
|
|
li
|
|
a(href="/account", data-i18n="nav.account")
|
|
li.active(data-i18n="account.subscription")
|
|
|
|
if me.get('anonymous')
|
|
p(data-i18n="account_settings.not_logged_in")
|
|
else
|
|
|
|
//- Personal Subscriptions
|
|
|
|
.panel.panel-default
|
|
.panel-heading
|
|
h3(data-i18n="subscribe.personal_sub")
|
|
if personalSub.prepaidCode && !personalSub.usingPrepaidCode
|
|
div
|
|
span(data-i18n="subscribe.subscribe_prepaid")
|
|
span.spl.spr= personalSub.prepaidCode
|
|
.panel-body
|
|
if personalSub.state === 'loading'
|
|
.alert.alert-info(data-i18n="subscribe.loading_info")
|
|
else if personalSub.state === 'subscribing'
|
|
.alert.alert-info(data-i18n="subscribe.subscribing")
|
|
else if personalSub.sponsor
|
|
div
|
|
span(data-i18n="subscribe.managed_by")
|
|
span.spl.spr #{personalSub.sponsorName} (#{personalSub.sponsorEmail})
|
|
if personalSub.endDate
|
|
div
|
|
span(data-i18n="subscribe.will_be_cancelled")
|
|
span.spl.spr= moment(personalSub.endDate).format('l')
|
|
|
|
else if personalSub.usingPrepaidCode
|
|
div(data-i18n="subscribe.using_prepaid")
|
|
|
|
else if personalSub.self
|
|
if personalSub.state === 'declined'
|
|
.alert.alert-danger.alert-dismissible
|
|
span(data-i18n="buy_gems.declined")
|
|
button.close(type="button" data-dismiss="alert")
|
|
span(aria-hidden="true") ×
|
|
br
|
|
else if personalSub.state === 'unknown_error'
|
|
.alert.alert-danger.alert-dismissible
|
|
button.close(type="button" data-dismiss="alert")
|
|
span(aria-hidden="true") ×
|
|
p(data-i18n="loading_error.unknown")
|
|
p= personalSub.stateMessage
|
|
br
|
|
|
|
if !personalSub.subscribed || personalSub.prepaidCode
|
|
button.start-subscription-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_title") Subscribe
|
|
else
|
|
button.end-subscription-button.btn.btn-lg.btn-warning(data-i18n="subscribe.unsubscribe") Unsubscribe
|
|
|
|
.unsubscribe-feedback.row.secret
|
|
.col-lg-7
|
|
h3
|
|
if personalSub.monthsSubscribed > 1
|
|
span(data-i18n="subscribe.thank_you_months_prefix") Thank you for supporting us these last
|
|
span.spl.spr= personalSub.monthsSubscribed
|
|
span(data-i18n="subscribe.thank_you_months_suffix") months.
|
|
else
|
|
span(data-i18n="subscribe.thank_you") Thank you for supporting CodeCombat.
|
|
div(data-i18n="subscribe.sorry_to_see_you_go") Sorry to see you go! Please let us know what we could have done better.
|
|
textarea(rows=3, data-i18n="[placeholder]subscribe.unsubscribe_feedback_placeholder")
|
|
.col-lg-5
|
|
button.cancel-end-subscription-button.btn.btn-lg.btn-default(data-i18n="subscribe.never_mind") Never Mind, I Still Love You
|
|
button.confirm-end-subscription-button.btn.btn-lg.btn-warning(data-i18n="subscribe.confirm_unsubscribe") Confirm Unsubscribe
|
|
|
|
table.table.table-striped.table-condensed
|
|
tr
|
|
th(data-i18n="user.status") Status
|
|
td
|
|
if personalSub.subscribed
|
|
strong(data-i18n="account.subscribed")
|
|
else
|
|
if personalSub.active
|
|
strong(data-i18n="account.active")
|
|
.text-muted(data-i18n="account.status_unsubscribed_active")
|
|
else
|
|
strong(data-i18n="account.unsubscribed")
|
|
.text-muted(data-i18n="account.status_unsubscribed")
|
|
if personalSub.activeUntil
|
|
tr
|
|
th(data-i18n="account.active_until")
|
|
td= moment(activeUntil).format('l')
|
|
if personalSub.nextPaymentDate
|
|
tr
|
|
th(data-i18n="account.next_payment")
|
|
td= moment(personalSub.nextPaymentDate).format('l')
|
|
if personalSub.cost
|
|
tr
|
|
th(data-i18n="account.cost")
|
|
td= personalSub.cost
|
|
if personalSub.card
|
|
tr
|
|
th(data-i18n="account.card")
|
|
td= personalSub.card
|
|
|
|
else
|
|
button.start-subscription-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_title") Subscribe
|
|
if personalSub.free === true
|
|
div(data-i18n="subscribe.currently_free")
|
|
else if typeof personalSub.free === 'string'
|
|
if new Date() < new Date(personalSub.free)
|
|
div
|
|
span(data-i18n="subscribe.currently_free_until")
|
|
span.spl.spr= moment(new Date(personalSub.free)).format('l')
|
|
else
|
|
span(data-i18n="subscribe.was_free_until")
|
|
span.spl.spr= moment(new Date(personalSub.free)).format('l')
|
|
|
|
//- Sponsored Subscriptions
|
|
|
|
.panel.panel-default
|
|
.panel-heading
|
|
h3(data-i18n="subscribe.managed_subs")
|
|
div(data-i18n="subscribe.managed_subs_desc")
|
|
h4(data-i18n="subscribe.group_discounts")
|
|
table.table.table-striped.table-condensed.discount-table
|
|
tr
|
|
td(data-i18n="subscribe.group_discounts_1st")
|
|
td(data-i18n="subscribe.group_discounts_full")
|
|
tr
|
|
td(data-i18n="subscribe.group_discounts_2nd")
|
|
td(data-i18n="subscribe.group_discounts_20")
|
|
tr
|
|
td(data-i18n="subscribe.group_discounts_12th")
|
|
td(data-i18n="subscribe.group_discounts_40")
|
|
.panel-body
|
|
if recipientSubs.state === 'subscribing'
|
|
.alert.alert-info(data-i18n="subscribe.subscribing")
|
|
else
|
|
textarea.recipient-emails(rows=3, data-i18n="[placeholder]subscribe.recipient_emails_placeholder")
|
|
div
|
|
button.recipients-subscribe-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_users")
|
|
if recipientSubs.state === 'declined'
|
|
br
|
|
.alert.alert-danger.alert-dismissible
|
|
span(data-i18n="buy_gems.declined")
|
|
button.close(type="button" data-dismiss="alert")
|
|
span(aria-hidden="true") ×
|
|
else if recipientSubs.state === 'unknown_error'
|
|
br
|
|
.alert.alert-danger.alert-dismissible
|
|
button.close(type="button" data-dismiss="alert")
|
|
span(aria-hidden="true") ×
|
|
p(data-i18n="loading_error.unknown")
|
|
p= recipientSubs.stateMessage
|
|
else if recipientSubs.justSubscribed && recipientSubs.justSubscribed.length > 0
|
|
br
|
|
.alert.alert-success.alert-dismissible
|
|
if recipientSubs.justSubscribed.length > 0
|
|
div(data-i18n="subscribe.users_subscribed")
|
|
ul
|
|
each email in recipientSubs.justSubscribed
|
|
li= email
|
|
else if recipientSubs.justSubscribed && recipientSubs.justSubscribed.length === 0
|
|
br
|
|
.alert.alert-success.alert-dismissible
|
|
div(data-i18n="subscribe.no_users_subscribed")
|
|
|
|
if recipientSubs.nextPaymentAmount > 0 && recipientSubs.sponsorSub
|
|
h4(data-i18n="account.next_payment")
|
|
p= moment(new Date(recipientSubs.sponsorSub.current_period_end * 1000)).format('l')
|
|
p $#{recipientSubs.nextPaymentAmount / 100}
|
|
p= recipientSubs.card
|
|
|
|
h4(data-i18n="subscribe.current_recipients")
|
|
table.table.table-striped.table-condensed.recipients-table
|
|
tr
|
|
th(data-i18n="general.email")
|
|
th(data-i18n="general.name")
|
|
th
|
|
for recipient in recipientSubs.recipients
|
|
tr
|
|
td.recipient-email= recipient.emailLower
|
|
td.recipient-name= recipient.name
|
|
td.recipient-unsubscribe
|
|
if recipient.cancel_at_period_end
|
|
div Ends #{moment(recipient.cancel_at_period_end).format('l')}
|
|
else if recipientSubs.unsubscribingRecipients.indexOf(recipient.emailLower) >= 0
|
|
div(data-i18n="subscribe.unsubscribing")
|
|
else
|
|
button.recipient-unsubscribe-button.btn.btn-sm.btn-warning Unsubscribe
|
|
button.confirm-recipient-unsubscribe-button.btn.btn-sm.btn-primary.hide(data-i18n="play.confirm")
|
|
|