codecombat/app/templates/account/subscription-view.jade
Matt Lott 48786372d8 🐛Prevent parallel managed sub unsubscribes
Our unsubscribe API does not support this.  Removing option from
subscription UI.

Fixes #2976
2015-10-26 13:45:38 -07:00

209 lines
9 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.logged-out-blurb(data-i18n="subscribe.must_be_logged")
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(personalSub.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
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')
else
button.start-subscription-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_title") Subscribe
// - 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.
//- Sponsored Subscriptions
.panel.panel-default
.panel-heading
h3(data-i18n="subscribe.managed_subs")
p(data-i18n="subscribe.managed_subs_desc")
p(data-i18n="subscribe.managed_subs_desc_2")
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") &times;
else if recipientSubs.state === 'unknown_error'
br
.alert.alert-danger.alert-dismissible
button.close(type="button" data-dismiss="alert")
span(aria-hidden="true") &times;
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")
if recipientSubs.unsubscribingRecipients && recipientSubs.unsubscribingRecipients.length > 0
.alert.alert-info
span.spr(data-i18n="subscribe.unsubscribing")
span= recipientSubs.unsubscribingRecipients[0]
else
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
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")