2014-02-12 05:23:40 -05:00
|
|
|
extends ../layout
|
2014-09-05 10:47:08 -04:00
|
|
|
block scripts
|
2015-02-06 10:54:16 -05:00
|
|
|
script(src="https://js.recurly.com/v3/recurly.js")
|
2014-09-05 10:47:08 -04:00
|
|
|
script(type='text/javascript').
|
2015-02-06 10:54:16 -05:00
|
|
|
|
2014-10-13 11:27:27 -04:00
|
|
|
window.recomendedCurrency = '#{recomendedCurrency}'
|
2015-02-06 10:54:16 -05:00
|
|
|
window.recurlyApiKey = "!{settings.apis.recurly.publicKey}"
|
2015-02-12 04:21:45 -05:00
|
|
|
window.taxRate = #{taxRate}
|
2015-12-08 10:45:52 -05:00
|
|
|
window.subscription = !{JSON.stringify(subscription)}
|
2015-02-06 10:54:16 -05:00
|
|
|
|
|
|
|
|
2014-02-12 05:23:40 -05:00
|
|
|
|
|
|
|
mixin printPlan(plan)
|
|
|
|
-if (!plan.hideFromUsers)
|
2017-01-31 09:57:22 -05:00
|
|
|
tr(ng-controller="ChangePlanFormController", ng-init="plan="+JSON.stringify(plan), ng-show="shouldShowPlan(plan.planCode)")
|
2016-10-13 08:47:05 -04:00
|
|
|
td
|
2014-02-12 05:23:40 -05:00
|
|
|
strong #{plan.name}
|
2015-06-01 09:38:09 -04:00
|
|
|
td {{refreshPrice(plan.planCode)}}
|
2014-02-12 05:23:40 -05:00
|
|
|
-if (plan.annual)
|
2015-02-06 10:54:16 -05:00
|
|
|
| {{prices[plan.planCode]}} / #{translate("year")}
|
2014-02-12 05:23:40 -05:00
|
|
|
-else
|
2015-02-06 10:54:16 -05:00
|
|
|
| {{prices[plan.planCode]}} / #{translate("month")}
|
2014-02-12 05:23:40 -05:00
|
|
|
td
|
|
|
|
-if (subscription.state == "free-trial")
|
2017-01-31 09:57:22 -05:00
|
|
|
a(href="/user/subscription/new?planCode="+plan.planCode).btn.btn-success #{translate("subscribe_to_this_plan")}
|
2014-10-13 11:33:01 -04:00
|
|
|
-else if (typeof(subscription.planCode) != "undefined" && plan.planCode == subscription.planCode.split("_")[0])
|
2014-08-01 07:34:53 -04:00
|
|
|
button.btn.disabled #{translate("your_plan")}
|
2014-02-12 05:23:40 -05:00
|
|
|
-else
|
2014-08-27 07:31:01 -04:00
|
|
|
form
|
2017-01-31 09:57:22 -05:00
|
|
|
input(type="hidden", ng-model="plan_code", name="plan_code", value=plan.planCode)
|
2014-08-27 07:31:01 -04:00
|
|
|
input(type="submit", ng-click="changePlan()", value=translate("change_to_this_plan")).btn.btn-success
|
|
|
|
|
2014-02-12 05:23:40 -05:00
|
|
|
|
|
|
|
mixin printPlans(plans)
|
2017-01-31 09:57:22 -05:00
|
|
|
each plan in plans
|
|
|
|
+printPlan(plan)
|
2014-02-12 05:23:40 -05:00
|
|
|
|
|
|
|
block content
|
2015-12-08 10:45:52 -05:00
|
|
|
.content.content-alt(ng-cloak)
|
|
|
|
.container(ng-controller="UserSubscriptionController")
|
2014-07-07 08:43:36 -04:00
|
|
|
.row
|
2015-12-08 13:23:28 -05:00
|
|
|
.col-md-8.col-md-offset-2
|
2016-08-22 12:36:33 -04:00
|
|
|
if saved_billing_details
|
|
|
|
.alert.alert-success
|
|
|
|
i.fa.fa-check
|
|
|
|
|
|
|
|
|
| #{translate("your_billing_details_were_saved")}
|
2015-12-08 10:45:52 -05:00
|
|
|
.card(ng-if="view == 'overview'")
|
2017-01-31 09:57:22 -05:00
|
|
|
.page-header(x-current-plan=subscription.planCode)
|
2016-10-13 08:47:05 -04:00
|
|
|
h1 #{translate("your_subscription")}
|
2016-06-15 13:34:56 -04:00
|
|
|
|
|
|
|
- if (subscription && user._id+'' == subscription.admin_id+'')
|
2014-08-07 10:29:06 -04:00
|
|
|
case subscription.state
|
|
|
|
when "free-trial"
|
|
|
|
p !{translate("on_free_trial_expiring_at", {expiresAt:"<strong>" + subscription.expiresAt + "</strong>"})}
|
2016-02-19 07:27:01 -05:00
|
|
|
|
2014-08-07 10:29:06 -04:00
|
|
|
when "active"
|
|
|
|
p !{translate("currently_subscribed_to_plan", {planName:"<strong>" + subscription.name + "</strong>"})}
|
2016-10-13 08:47:05 -04:00
|
|
|
span(ng-show="!isNextGenPlan")
|
|
|
|
a(href, ng-click="changePlan = true") !{translate("change_plan")}.
|
2014-08-07 10:29:06 -04:00
|
|
|
p !{translate("next_payment_of_x_collectected_on_y", {paymentAmmount:"<strong>" + subscription.price + "</strong>", collectionDate:"<strong>" + subscription.nextPaymentDueAt + "</strong>"})}
|
|
|
|
p.pull-right
|
2015-12-08 10:45:52 -05:00
|
|
|
p
|
2014-08-07 10:29:06 -04:00
|
|
|
a(href="/user/subscription/billing-details/edit").btn.btn-info #{translate("update_your_billing_details")}
|
2015-12-08 13:23:28 -05:00
|
|
|
|
|
|
|
|
a(href, ng-click="switchToCancelationView()").btn.btn-primary !{translate("cancel_your_subscription")}
|
2014-08-07 10:29:06 -04:00
|
|
|
when "canceled"
|
|
|
|
p !{translate("currently_subscribed_to_plan", {planName:"<strong>" + subscription.name + "</strong>"})}
|
|
|
|
p !{translate("subscription_canceled_and_terminate_on_x", {terminateDate:"<strong>" + subscription.nextPaymentDueAt + "</strong>"})}
|
|
|
|
p: form(action="/user/subscription/reactivate",method="post")
|
|
|
|
input(type="hidden", name="_csrf", value=csrfToken)
|
|
|
|
input(type="submit",value="Reactivate your subscription").btn.btn-success
|
|
|
|
when "expired"
|
|
|
|
p !{translate("your_subscription_has_expired")}
|
|
|
|
a(href="/user/subscription/plans") !{translate("create_new_subscription")}
|
|
|
|
default
|
2016-06-15 13:34:56 -04:00
|
|
|
-if(groupSubscriptions.length == 0)
|
2015-02-04 15:56:50 -05:00
|
|
|
p !{translate("problem_with_subscription_contact_us")}
|
2014-02-12 05:23:40 -05:00
|
|
|
|
2015-02-02 09:53:29 -05:00
|
|
|
div(ng-show="changePlan", ng-cloak)#changePlanSection
|
2014-09-05 11:11:19 -04:00
|
|
|
h2.col-md-7 !{translate("change_plan")}
|
2015-06-03 06:14:26 -04:00
|
|
|
span.dropdown.col-md-1.changePlanButton(ng-controller="CurrenyDropdownController", style="display:none", dropdown)
|
2014-09-05 11:11:19 -04:00
|
|
|
a.btn.btn-primary.dropdown-toggle(
|
2014-09-05 10:47:08 -04:00
|
|
|
href="#",
|
2015-06-03 06:14:26 -04:00
|
|
|
data-toggle="dropdown",
|
|
|
|
dropdown-toggle
|
2014-09-05 10:47:08 -04:00
|
|
|
)
|
|
|
|
| {{currencyCode}} ({{plans[currencyCode]['symbol']}})
|
|
|
|
ul.dropdown-menu(role="menu")
|
|
|
|
li(ng-repeat="(currency, value) in plans", dropdown-toggle)
|
|
|
|
a(
|
|
|
|
href,
|
2014-10-13 11:27:27 -04:00
|
|
|
ng-click="changeCurrency(currency)"
|
2014-09-05 10:47:08 -04:00
|
|
|
) {{currency}} ({{value['symbol']}})
|
2014-08-07 10:29:06 -04:00
|
|
|
p: table.table
|
|
|
|
tr
|
|
|
|
th !{translate("name")}
|
|
|
|
th !{translate("price")}
|
|
|
|
th
|
2017-01-31 09:57:22 -05:00
|
|
|
+printPlans(plans.studentAccounts)
|
|
|
|
+printPlans(plans.individualMonthlyPlans)
|
|
|
|
+printPlans(plans.individualAnnualPlans)
|
2014-08-07 10:29:06 -04:00
|
|
|
|
2016-06-15 13:34:56 -04:00
|
|
|
|
|
|
|
each groupSubscription in groupSubscriptions
|
|
|
|
- if (user._id+'' != groupSubscription.admin_id._id+'')
|
|
|
|
div
|
|
|
|
p !{translate("member_of_group_subscription", {admin_email: "<strong>" + groupSubscription.admin_id.email + "</strong>"})}
|
|
|
|
span
|
2017-01-31 09:57:22 -05:00
|
|
|
button.btn.btn-danger(ng-click="removeSelfFromGroup('"+groupSubscription.admin_id._id+"')") #{translate("leave_group")}
|
2016-06-15 13:34:56 -04:00
|
|
|
|
|
|
|
-if(subscription.groupPlan && user._id+'' == subscription.admin_id+'')
|
|
|
|
div
|
|
|
|
a(href="/subscription/group").btn.btn-primary !{translate("manage_group")}
|
|
|
|
|
2016-02-19 07:27:01 -05:00
|
|
|
.card(ng-if="view == 'cancelation'")
|
2015-12-08 10:45:52 -05:00
|
|
|
.page-header
|
|
|
|
h1 #{translate("Cancel Subscription")}
|
2015-12-08 13:23:28 -05:00
|
|
|
|
2016-11-02 06:09:02 -04:00
|
|
|
div(ng-show="showExtendFreeTrial", style="text-align: center")
|
|
|
|
p !{translate("have_more_days_to_try", {days:14})}
|
|
|
|
button(type="submit", ng-click="exendTrial()", ng-disabled='inflight').btn.btn-success #{translate("ill_take_it")}
|
|
|
|
p
|
|
|
|
|
|
|
|
|
p
|
|
|
|
a(href, ng-click="cancelSubscription()", ng-disabled='inflight') #{translate("no_thanks_cancel_now")}
|
2015-12-08 13:23:28 -05:00
|
|
|
|
2016-11-02 06:09:02 -04:00
|
|
|
div(ng-show="showDowngradeToStudent", style="text-align: center")
|
|
|
|
span(ng-controller="ChangePlanFormController")
|
|
|
|
p !{translate("interested_in_cheaper_plan",{price:'{{studentPrice}}'})}
|
|
|
|
button(type="submit", ng-click="downgradeToStudent()", ng-disabled='inflight').btn.btn-success #{translate("yes_please")}
|
2015-12-08 13:23:28 -05:00
|
|
|
p
|
|
|
|
|
|
|
|
|
p
|
2016-11-02 06:09:02 -04:00
|
|
|
a(href, ng-click="cancelSubscription()", ng-disabled='inflight') #{translate("no_thanks_cancel_now")}
|
2015-12-08 13:23:28 -05:00
|
|
|
|
2016-11-02 06:09:02 -04:00
|
|
|
div(ng-show="showBasicCancel")
|
2015-12-09 09:44:26 -05:00
|
|
|
p #{translate("sure_you_want_to_cancel")}
|
|
|
|
a(href="/project").btn.btn-info #{translate("i_want_to_stay")}
|
|
|
|
|
|
|
|
|
a(ng-click="cancelSubscription()", ng-disabled='inflight').btn.btn-primary #{translate("cancel_my_account")}
|
2015-12-08 13:23:28 -05:00
|
|
|
|
2014-07-07 08:43:36 -04:00
|
|
|
script(type="text/javascript").
|
2014-03-11 07:22:03 -04:00
|
|
|
$('#cancelSubscription').on("click", function() {
|
|
|
|
ga('send', 'event', 'subscription-funnel', 'cancelation')
|
|
|
|
})
|
2014-03-09 05:56:58 -04:00
|
|
|
|
2014-08-27 07:31:01 -04:00
|
|
|
script(type='text/ng-template', id='confirmChangePlanModalTemplate')
|
|
|
|
.modal-header
|
2015-12-09 06:24:14 -05:00
|
|
|
h3 #{translate("change_plan")}
|
2014-08-27 07:31:01 -04:00
|
|
|
.modal-body
|
|
|
|
p !{translate("sure_you_want_to_change_plan", {planName:"<strong>{{plan.name}}</strong>"})}
|
|
|
|
.modal-footer
|
|
|
|
button.btn.btn-default(
|
|
|
|
ng-disabled="inflight"
|
|
|
|
ng-click="cancel()"
|
|
|
|
) #{translate("cancel")}
|
|
|
|
button.btn.btn-success(
|
|
|
|
ng-disabled="state.inflight"
|
|
|
|
ng-click="confirmChangePlan()"
|
|
|
|
)
|
|
|
|
span(ng-hide="inflight") #{translate("change_plan")}
|
|
|
|
span(ng-show="inflight") #{translate("processing")}...
|
|
|
|
|
2014-03-09 05:56:58 -04:00
|
|
|
|
2016-02-19 07:27:01 -05:00
|
|
|
script(type='text/ng-template', id='LeaveGroupModalTemplate')
|
|
|
|
.modal-header
|
|
|
|
h3 #{translate("leave_group")}
|
|
|
|
.modal-body
|
|
|
|
p #{translate("sure_you_want_to_leave_group")}
|
|
|
|
.modal-footer
|
|
|
|
button.btn.btn-default(
|
|
|
|
ng-disabled="inflight"
|
|
|
|
ng-click="cancel()"
|
|
|
|
) #{translate("cancel")}
|
|
|
|
button.btn.btn-danger(
|
|
|
|
ng-disabled="state.inflight"
|
|
|
|
ng-click="confirmLeaveGroup()"
|
|
|
|
)
|
|
|
|
span(ng-hide="inflight") #{translate("leave_now")}
|
|
|
|
span(ng-show="inflight") #{translate("processing")}...
|
|
|
|
|
|
|
|
|
2014-02-12 05:23:40 -05:00
|
|
|
|