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
|
2015-10-27 15:07:16 -04:00
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
//- Personal Subscriptions
|
2015-10-27 15:07:16 -04:00
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
|
|
|
h3(data-i18n="subscribe.personal_sub")
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.personalSub.prepaidCode && !view.personalSub.usingPrepaidCode
|
|
|
|
div
|
2015-03-19 18:02:45 -04:00
|
|
|
span(data-i18n="subscribe.subscribe_prepaid")
|
2015-10-27 15:07:16 -04:00
|
|
|
span.spl.spr= view.personalSub.prepaidCode
|
2015-03-13 18:19:20 -04:00
|
|
|
.panel-body
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.personalSub.state === 'loading'
|
2015-03-13 18:19:20 -04:00
|
|
|
.alert.alert-info(data-i18n="subscribe.loading_info")
|
2015-10-27 15:07:16 -04:00
|
|
|
else if view.personalSub.state === 'subscribing'
|
2015-03-19 18:02:45 -04:00
|
|
|
.alert.alert-info(data-i18n="subscribe.subscribing")
|
2015-10-27 15:07:16 -04:00
|
|
|
else if view.personalSub.sponsor
|
2015-03-13 18:19:20 -04:00
|
|
|
div
|
2015-10-27 17:57:49 -04:00
|
|
|
span.spr(data-i18n="subscribe.managed_by")
|
|
|
|
span #{view.personalSub.sponsorName} (#{view.personalSub.sponsorEmail})
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.personalSub.endDate
|
2015-03-13 18:19:20 -04:00
|
|
|
div
|
2015-10-27 17:57:49 -04:00
|
|
|
span.spr(data-i18n="subscribe.will_be_cancelled")
|
|
|
|
span= moment(view.personalSub.endDate).format('l')
|
2015-03-19 18:02:45 -04:00
|
|
|
|
2015-10-27 15:07:16 -04:00
|
|
|
else if view.personalSub.usingPrepaidCode
|
2015-03-19 18:02:45 -04:00
|
|
|
div(data-i18n="subscribe.using_prepaid")
|
|
|
|
|
2015-10-27 15:07:16 -04:00
|
|
|
else if view.personalSub.self
|
|
|
|
if view.personalSub.state === 'declined'
|
2015-03-19 18:02:45 -04:00
|
|
|
.alert.alert-danger.alert-dismissible
|
|
|
|
span(data-i18n="buy_gems.declined")
|
|
|
|
button.close(type="button" data-dismiss="alert")
|
2015-10-27 15:07:16 -04:00
|
|
|
span(aria-hidden="true") ×
|
2015-03-19 18:02:45 -04:00
|
|
|
br
|
2015-10-27 15:07:16 -04:00
|
|
|
else if view.personalSub.state === 'unknown_error'
|
2015-03-19 18:02:45 -04:00
|
|
|
.alert.alert-danger.alert-dismissible
|
|
|
|
button.close(type="button" data-dismiss="alert")
|
|
|
|
span(aria-hidden="true") ×
|
|
|
|
p(data-i18n="loading_error.unknown")
|
2015-10-27 15:07:16 -04:00
|
|
|
p= view.personalSub.stateMessage
|
2015-03-19 18:02:45 -04:00
|
|
|
br
|
|
|
|
|
2015-10-27 15:07:16 -04:00
|
|
|
if !view.personalSub.subscribed || view.personalSub.prepaidCode
|
2015-10-27 17:57:49 -04:00
|
|
|
button.start-subscription-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_title")
|
2015-03-19 18:02:45 -04:00
|
|
|
else
|
2015-10-27 17:57:49 -04:00
|
|
|
button.end-subscription-button.btn.btn-lg.btn-warning(data-i18n="subscribe.unsubscribe")
|
2015-03-19 18:02:45 -04:00
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
.unsubscribe-feedback.row.secret
|
|
|
|
.col-lg-7
|
|
|
|
h3
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.personalSub.monthsSubscribed > 1
|
2015-10-27 17:57:49 -04:00
|
|
|
span.spr(data-i18n="subscribe.thank_you_months_prefix")
|
|
|
|
span= view.personalSub.monthsSubscribed
|
|
|
|
span.spl(data-i18n="subscribe.thank_you_months_suffix")
|
2015-03-13 18:19:20 -04:00
|
|
|
else
|
2015-10-27 17:57:49 -04:00
|
|
|
span(data-i18n="subscribe.thank_you")
|
|
|
|
div(data-i18n="subscribe.sorry_to_see_you_go")
|
2015-03-13 18:19:20 -04:00
|
|
|
textarea(rows=3, data-i18n="[placeholder]subscribe.unsubscribe_feedback_placeholder")
|
|
|
|
.col-lg-5
|
2015-10-27 17:57:49 -04:00
|
|
|
button.cancel-end-subscription-button.btn.btn-lg.btn-default(data-i18n="subscribe.never_mind")
|
|
|
|
button.confirm-end-subscription-button.btn.btn-lg.btn-warning(data-i18n="subscribe.confirm_unsubscribe")
|
2015-10-27 15:07:16 -04:00
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
table.table.table-striped.table-condensed
|
|
|
|
tr
|
2015-10-29 11:57:22 -04:00
|
|
|
th(data-i18n="user.status")
|
2015-03-13 18:19:20 -04:00
|
|
|
td
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.personalSub.subscribed
|
2015-03-13 18:19:20 -04:00
|
|
|
strong(data-i18n="account.subscribed")
|
|
|
|
else
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.personalSub.active
|
2015-03-13 18:19:20 -04:00
|
|
|
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")
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.personalSub.activeUntil
|
2015-03-13 18:19:20 -04:00
|
|
|
tr
|
|
|
|
th(data-i18n="account.active_until")
|
2015-10-27 15:07:16 -04:00
|
|
|
td= moment(view.personalSub.activeUntil).format('l')
|
|
|
|
if view.personalSub.nextPaymentDate
|
2015-03-13 18:19:20 -04:00
|
|
|
tr
|
|
|
|
th(data-i18n="account.next_payment")
|
2015-10-27 15:07:16 -04:00
|
|
|
td= moment(view.personalSub.nextPaymentDate).format('l')
|
|
|
|
if view.personalSub.cost
|
2015-03-13 18:19:20 -04:00
|
|
|
tr
|
|
|
|
th(data-i18n="account.cost")
|
2015-10-27 15:07:16 -04:00
|
|
|
td= view.personalSub.cost
|
|
|
|
if view.personalSub.card
|
2015-03-19 18:02:45 -04:00
|
|
|
tr
|
|
|
|
th(data-i18n="account.card")
|
2015-10-27 15:07:16 -04:00
|
|
|
td= view.personalSub.card
|
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
else
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.personalSub.free === true
|
2015-03-13 18:19:20 -04:00
|
|
|
div(data-i18n="subscribe.currently_free")
|
2015-10-27 15:07:16 -04:00
|
|
|
else if typeof view.personalSub.free === 'string'
|
|
|
|
if new Date() < new Date(view.personalSub.free)
|
2015-03-13 18:19:20 -04:00
|
|
|
div
|
2015-10-27 17:57:49 -04:00
|
|
|
span.spr(data-i18n="subscribe.currently_free_until")
|
|
|
|
span= moment(new Date(view.personalSub.free)).format('l')
|
2014-12-10 16:42:12 -05:00
|
|
|
else
|
2015-10-27 17:57:49 -04:00
|
|
|
span.spr(data-i18n="subscribe.was_free_until")
|
|
|
|
span= moment(new Date(view.personalSub.free)).format('l')
|
2015-08-21 14:10:06 -04:00
|
|
|
else
|
2015-10-27 17:57:49 -04:00
|
|
|
button.start-subscription-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_title")
|
2015-03-13 18:19:20 -04:00
|
|
|
|
2015-09-25 13:03:44 -04:00
|
|
|
// - Prepaid Codes
|
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
2015-10-29 11:57:22 -04:00
|
|
|
h3(data-i18n="account.prepaid_codes")
|
2015-09-25 13:03:44 -04:00
|
|
|
.panel-body
|
2015-10-27 15:07:16 -04:00
|
|
|
p
|
2015-10-29 11:57:22 -04:00
|
|
|
span.spr(data-i18n="account_prepaid.you_can1")
|
|
|
|
a(href="/account/prepaid", data-i18n="account_prepaid.you_can2")
|
|
|
|
span.spl(data-i18n="account_prepaid.you_can3")
|
2015-03-13 18:19:20 -04:00
|
|
|
//- Sponsored Subscriptions
|
|
|
|
|
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
|
|
|
h3(data-i18n="subscribe.managed_subs")
|
2015-12-14 14:59:31 -05:00
|
|
|
p
|
|
|
|
span.spr Managed subscriptions are discontinued. Please contact
|
|
|
|
a(href='mailto:team@codecombat.com') team@codecombat.com
|
|
|
|
span.spl for more information.
|
2015-12-26 09:21:06 -05:00
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
.panel-body
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.recipientSubs.nextPaymentAmount > 0 && view.recipientSubs.sponsorSub
|
2015-03-13 18:19:20 -04:00
|
|
|
h4(data-i18n="account.next_payment")
|
2015-10-27 15:07:16 -04:00
|
|
|
p= moment(new Date(view.recipientSubs.sponsorSub.current_period_end * 1000)).format('l')
|
|
|
|
p $#{view.recipientSubs.nextPaymentAmount / 100}
|
|
|
|
p= view.recipientSubs.card
|
|
|
|
|
2015-03-13 18:19:20 -04:00
|
|
|
h4(data-i18n="subscribe.current_recipients")
|
2015-10-27 15:07:16 -04:00
|
|
|
if view.recipientSubs.unsubscribingRecipients && view.recipientSubs.unsubscribingRecipients.length > 0
|
2015-10-26 16:45:33 -04:00
|
|
|
.alert.alert-info
|
|
|
|
span.spr(data-i18n="subscribe.unsubscribing")
|
2015-10-27 15:07:16 -04:00
|
|
|
span= view.recipientSubs.unsubscribingRecipients[0]
|
2015-10-26 16:45:33 -04:00
|
|
|
else
|
|
|
|
table.table.table-striped.table-condensed.recipients-table
|
2015-03-13 18:19:20 -04:00
|
|
|
tr
|
2015-10-26 16:45:33 -04:00
|
|
|
th(data-i18n="general.email")
|
|
|
|
th(data-i18n="general.name")
|
2015-10-27 15:07:16 -04:00
|
|
|
th
|
|
|
|
for recipient in view.recipientSubs.recipients
|
2015-10-26 16:45:33 -04:00
|
|
|
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
|
2015-10-29 11:57:22 -04:00
|
|
|
button.recipient-unsubscribe-button.btn.btn-sm.btn-warning(data-i18n="subscribe.unsubscribe")
|
2015-10-26 16:45:33 -04:00
|
|
|
button.confirm-recipient-unsubscribe-button.btn.btn-sm.btn-primary.hide(data-i18n="play.confirm")
|