overleaf/services/web/app/views/subscriptions/dashboard.jade

89 lines
3.3 KiB
Text
Raw Normal View History

2014-02-12 05:23:40 -05:00
extends ../layout
mixin printPlan(plan)
-if (!plan.hideFromUsers)
tr
td
strong #{plan.name}
td
-if (plan.annual)
2014-08-01 07:34:53 -04:00
| $#{plan.price / 100} / #{translate("year")}
2014-02-12 05:23:40 -05:00
-else
2014-08-01 07:34:53 -04:00
| $#{plan.price / 100} / #{translate("month")}
2014-02-12 05:23:40 -05:00
td
-if (subscription.state == "free-trial")
2014-08-01 07:34:53 -04:00
a(href="/user/subscription/new?planCode=#{plan.planCode}").btn.btn-success #{translate("subscribe_to_this_plan")}
2014-02-12 05:23:40 -05:00
-else if (plan.planCode == subscription.planCode)
2014-08-01 07:34:53 -04:00
button.btn.disabled #{translate("your_plan")}
2014-02-12 05:23:40 -05:00
-else
form(action="/user/subscription/update",method="post")
input(type="hidden", name="_csrf", value=csrfToken)
input(type="hidden",name="plan_code",value="#{plan.planCode}")
2014-07-07 08:43:36 -04:00
input(type="submit",value="Change to this plan").btn.btn-success
2014-02-12 05:23:40 -05:00
mixin printPlans(plans)
-each plan in plans
mixin printPlan(plan)
block content
2014-07-07 08:43:36 -04:00
.content.content-alt
.container
.row
.col-md-8.col-md-offset-2
.card
.page-header
2014-08-01 07:34:53 -04:00
h1 #{translate("your_subscription")}
2014-07-07 08:43:36 -04:00
case subscription.state
when "free-trial"
2014-08-01 07:34:53 -04:00
p #{translate("on_free_trial_expiring_at", {expiresAt:"<strong>#{subscription.expiresAt}</strong>"})}
p #{translate("choose_a_plan_below")}
2014-07-07 08:43:36 -04:00
when "active"
2014-08-01 07:34:53 -04:00
p #{translate("currently_subscribed_to_plan", {planName:"<strong>#{subscription.name}</strong>"})}
a(href, ng-click="changePlan = true") #{translate("change_plan")}.
p #{translate("next_payment_of_x_collectected_on_y", {paymentAmmount:"<strong>#{subscription.price}</strong>", collectionDate:"<strong>#{subscription.nextPaymentDueAt}</strong>"})}
2014-07-07 08:43:36 -04:00
p.pull-right
p: form(action="/user/subscription/cancel",method="post")
input(type="hidden", name="_csrf", value=csrfToken)
2014-08-01 07:34:53 -04:00
a(href="/user/subscription/billing-details/edit").btn.btn-info #{translate("update_your_billing_details")}
2014-07-07 08:43:36 -04:00
| &nbsp;
input(type="submit", value="Cancel your subscription").btn.btn-primary#cancelSubscription
when "canceled"
2014-08-01 07:34:53 -04:00
p #{translate("currently_subscribed_to_plan", {planName:"<strong>#{subscription.name}</strong>"})}
p #{translate("subscription_canceled_and_terminate_on_x", {terminateDate:"<strong>#{subscription.nextPaymentDueAt}</strong>"})}
2014-07-07 08:43:36 -04:00
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"
2014-08-01 07:34:53 -04:00
p #{translate("your_subscription_has_expired")}
a(href="/user/subscription/plans") #{translate("create_new_subscription")}
2014-07-07 08:43:36 -04:00
default
2014-08-01 07:34:53 -04:00
p #{translate("problem_with_subscription_contact_us")}
2014-02-12 05:23:40 -05:00
2014-07-07 08:43:36 -04:00
-if(subscription.groupPlan)
2014-08-01 07:34:53 -04:00
a(href="/subscription/group").btn.btn-success #{translate("manage_group")}
2014-02-12 05:23:40 -05:00
2014-07-07 08:43:36 -04:00
div(ng-show="changePlan", ng-cloak)
hr
2014-08-01 07:34:53 -04:00
h2 #{translate("change_plan")}
2014-07-07 08:43:36 -04:00
p: table.table
tr
2014-08-01 07:34:53 -04:00
th #{translate("name")}
th #{translate("price")}
2014-07-07 08:43:36 -04:00
th
mixin printPlans(plans.studentAccounts)
mixin printPlans(plans.individualMonthlyPlans)
mixin printPlans(plans.individualAnnualPlans)
2014-02-12 05:23:40 -05:00
2014-07-07 08:43:36 -04:00
script(type="text/javascript").
$('#cancelSubscription').on("click", function() {
ga('send', 'event', 'subscription-funnel', 'cancelation')
})
2014-02-12 05:23:40 -05:00