2014-12-10 16:42:12 -05:00
|
|
|
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")
|
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
if me.get('anonymous')
|
2015-09-09 16:20:18 -04:00
|
|
|
p.logged-out-blurb(data-i18n="subscribe.must_be_logged")
|
2015-03-13 18:19:20 -04:00
|
|
|
else
|
|
|
|
|
|
|
|
//- Personal Subscriptions
|
|
|
|
|
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
|
|
|
h3(data-i18n="subscribe.personal_sub")
|
2015-03-19 18:02:45 -04:00
|
|
|
if personalSub.prepaidCode && !personalSub.usingPrepaidCode
|
|
|
|
div
|
|
|
|
span(data-i18n="subscribe.subscribe_prepaid")
|
|
|
|
span.spl.spr= personalSub.prepaidCode
|
2015-03-13 18:19:20 -04:00
|
|
|
.panel-body
|
|
|
|
if personalSub.state === 'loading'
|
|
|
|
.alert.alert-info(data-i18n="subscribe.loading_info")
|
2015-03-19 18:02:45 -04:00
|
|
|
else if personalSub.state === 'subscribing'
|
|
|
|
.alert.alert-info(data-i18n="subscribe.subscribing")
|
2015-03-13 18:19:20 -04:00
|
|
|
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')
|
2015-03-19 18:02:45 -04:00
|
|
|
|
|
|
|
else if personalSub.usingPrepaidCode
|
|
|
|
div(data-i18n="subscribe.using_prepaid")
|
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
else if personalSub.self
|
2015-03-19 18:02:45 -04:00
|
|
|
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
|
2015-03-13 18:19:20 -04:00
|
|
|
button.start-subscription-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_title") Subscribe
|
2015-03-19 18:02:45 -04:00
|
|
|
else
|
|
|
|
button.end-subscription-button.btn.btn-lg.btn-warning(data-i18n="subscribe.unsubscribe") Unsubscribe
|
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
.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")
|
2015-10-14 19:01:09 -04:00
|
|
|
td= moment(personalSub.activeUntil).format('l')
|
2015-03-13 18:19:20 -04:00
|
|
|
if personalSub.nextPaymentDate
|
|
|
|
tr
|
|
|
|
th(data-i18n="account.next_payment")
|
2015-03-13 19:08:30 -04:00
|
|
|
td= moment(personalSub.nextPaymentDate).format('l')
|
2015-03-13 18:19:20 -04:00
|
|
|
if personalSub.cost
|
|
|
|
tr
|
|
|
|
th(data-i18n="account.cost")
|
|
|
|
td= personalSub.cost
|
2015-03-19 18:02:45 -04:00
|
|
|
if personalSub.card
|
|
|
|
tr
|
|
|
|
th(data-i18n="account.card")
|
|
|
|
td= personalSub.card
|
2015-03-13 18:19:20 -04:00
|
|
|
|
|
|
|
else
|
|
|
|
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')
|
2014-12-10 16:42:12 -05:00
|
|
|
else
|
2015-03-13 18:19:20 -04:00
|
|
|
span(data-i18n="subscribe.was_free_until")
|
|
|
|
span.spl.spr= moment(new Date(personalSub.free)).format('l')
|
2015-08-21 14:10:06 -04:00
|
|
|
else
|
|
|
|
button.start-subscription-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_title") Subscribe
|
2015-03-13 18:19:20 -04:00
|
|
|
|
2015-09-25 13:03:44 -04:00
|
|
|
// - Prepaid Codes
|
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
|
|
|
h3 Prepaid Codes
|
|
|
|
.panel-body
|
|
|
|
p
|
|
|
|
span You can
|
|
|
|
a(href="/account/prepaid") purchase a prepaid code
|
|
|
|
span that can be applied to your own account or given to others.
|
2015-03-13 18:19:20 -04:00
|
|
|
//- Sponsored Subscriptions
|
|
|
|
|
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
|
|
|
h3(data-i18n="subscribe.managed_subs")
|
2015-05-05 18:18:35 -04:00
|
|
|
p(data-i18n="subscribe.managed_subs_desc")
|
|
|
|
p(data-i18n="subscribe.managed_subs_desc_2")
|
2015-03-13 18:19:20 -04:00
|
|
|
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")
|
2014-12-10 16:42:12 -05:00
|
|
|
tr
|
2015-03-13 18:19:20 -04:00
|
|
|
td(data-i18n="subscribe.group_discounts_2nd")
|
|
|
|
td(data-i18n="subscribe.group_discounts_20")
|
2014-12-10 16:42:12 -05:00
|
|
|
tr
|
2015-03-13 18:19:20 -04:00
|
|
|
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")
|
2015-03-19 18:02:45 -04:00
|
|
|
p= recipientSubs.stateMessage
|
2015-03-13 18:19:20 -04:00
|
|
|
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
|
2014-12-10 16:42:12 -05:00
|
|
|
tr
|
2015-03-13 18:19:20 -04:00
|
|
|
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")
|
|
|
|
|