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

211 lines
9.2 KiB
Text
Raw Normal View History

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-03-13 18:19:20 -04:00
//- Personal Subscriptions
2015-03-13 18:19:20 -04:00
.panel.panel-default
.panel-heading
h3(data-i18n="subscribe.personal_sub")
if view.personalSub.prepaidCode && !view.personalSub.usingPrepaidCode
div
span(data-i18n="subscribe.subscribe_prepaid")
span.spl.spr= view.personalSub.prepaidCode
2015-03-13 18:19:20 -04:00
.panel-body
if view.personalSub.state === 'loading'
2015-03-13 18:19:20 -04:00
.alert.alert-info(data-i18n="subscribe.loading_info")
else if view.personalSub.state === 'subscribing'
.alert.alert-info(data-i18n="subscribe.subscribing")
else if view.personalSub.sponsor
2015-03-13 18:19:20 -04:00
div
span.spr(data-i18n="subscribe.managed_by")
span #{view.personalSub.sponsorName} (#{view.personalSub.sponsorEmail})
if view.personalSub.endDate
2015-03-13 18:19:20 -04:00
div
span.spr(data-i18n="subscribe.will_be_cancelled")
span= moment(view.personalSub.endDate).format('l')
else if view.personalSub.usingPrepaidCode
div(data-i18n="subscribe.using_prepaid")
else if view.personalSub.self
if view.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 view.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= view.personalSub.stateMessage
br
if !view.personalSub.subscribed || view.personalSub.prepaidCode
button.start-subscription-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_title")
else
button.end-subscription-button.btn.btn-lg.btn-warning(data-i18n="subscribe.unsubscribe")
2015-03-13 18:19:20 -04:00
.unsubscribe-feedback.row.secret
.col-lg-7
h3
if view.personalSub.monthsSubscribed > 1
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
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
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-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
if view.personalSub.subscribed
2015-03-13 18:19:20 -04:00
strong(data-i18n="account.subscribed")
else
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")
if view.personalSub.activeUntil
2015-03-13 18:19:20 -04:00
tr
th(data-i18n="account.active_until")
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")
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")
td= view.personalSub.cost
if view.personalSub.card
tr
th(data-i18n="account.card")
td= view.personalSub.card
2015-03-13 18:19:20 -04:00
else
if view.personalSub.free === true
2015-03-13 18:19:20 -04:00
div(data-i18n="subscribe.currently_free")
else if typeof view.personalSub.free === 'string'
if new Date() < new Date(view.personalSub.free)
2015-03-13 18:19:20 -04:00
div
span.spr(data-i18n="subscribe.currently_free_until")
span= moment(new Date(view.personalSub.free)).format('l')
else
span.spr(data-i18n="subscribe.was_free_until")
span= moment(new Date(view.personalSub.free)).format('l')
else
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
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")
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
2015-03-13 18:19:20 -04:00
td(data-i18n="subscribe.group_discounts_1st")
td(data-i18n="subscribe.group_discounts_full")
tr
2015-03-13 18:19:20 -04:00
td(data-i18n="subscribe.group_discounts_2nd")
td(data-i18n="subscribe.group_discounts_20")
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 view.recipientSubs.state === 'subscribing'
2015-03-13 18:19:20 -04:00
.alert.alert-info(data-i18n="subscribe.subscribing")
else
if emailValidator.state === 'invalid'
div.invalid-email-message(aria-hidden="true") please make sure all entries are valid emails
textarea.recipient-emails(rows=3, data-i18n="[placeholder]subscribe.recipient_emails_placeholder")=emailValidator.lastEmails
2015-03-13 18:19:20 -04:00
div
button.recipients-subscribe-button.btn.btn-lg.btn-success(data-i18n="subscribe.subscribe_users")
if view.recipientSubs.state === 'declined'
2015-03-13 18:19:20 -04:00
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 view.recipientSubs.state === 'unknown_error'
2015-03-13 18:19:20 -04:00
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= view.recipientSubs.stateMessage
else if view.recipientSubs.justSubscribed && view.recipientSubs.justSubscribed.length > 0
2015-03-13 18:19:20 -04:00
br
.alert.alert-success.alert-dismissible
if view.recipientSubs.justSubscribed.length > 0
2015-03-13 18:19:20 -04:00
div(data-i18n="subscribe.users_subscribed")
ul
each email in view.recipientSubs.justSubscribed
2015-03-13 18:19:20 -04:00
li= email
else if view.recipientSubs.justSubscribed && view.recipientSubs.justSubscribed.length === 0
2015-03-13 18:19:20 -04:00
br
.alert.alert-success.alert-dismissible
div(data-i18n="subscribe.no_users_subscribed")
if view.recipientSubs.nextPaymentAmount > 0 && view.recipientSubs.sponsorSub
2015-03-13 18:19:20 -04:00
h4(data-i18n="account.next_payment")
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")
if view.recipientSubs.unsubscribingRecipients && view.recipientSubs.unsubscribingRecipients.length > 0
.alert.alert-info
span.spr(data-i18n="subscribe.unsubscribing")
span= view.recipientSubs.unsubscribingRecipients[0]
else
table.table.table-striped.table-condensed.recipients-table
2015-03-13 18:19:20 -04:00
tr
th(data-i18n="general.email")
th(data-i18n="general.name")
th
for recipient in view.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
2015-10-29 11:57:22 -04:00
button.recipient-unsubscribe-button.btn.btn-sm.btn-warning(data-i18n="subscribe.unsubscribe")
button.confirm-recipient-unsubscribe-button.btn.btn-sm.btn-primary.hide(data-i18n="play.confirm")