overleaf/services/web/app/views/subscriptions/dashboard.pug
Thomas 72af966c9c Schedule subscription downgrades to occur at the current term end (#3801)
* Schedule subscription downgrades to occur at the current term end.

If the plan is a downgrade, schedule the subscription change for term
end. Use Recurly v3 API subscription change event instead of v2 update
subscription.

* Add ability for user to revert a pending subscription change

In the case where a user has downgraded, but has since decided they'd
rather stay on their current plan, we need a way to let them revert. It
isn't enough to re-use a subscription change, because Recurly sees it as
an attempt to make a change from the current plan to itself.

Instead, we use a new dialog and call a new endpoint that has the
specific intent of reverting the pending plan change, by calling the
removeSubscriptionChange recurly client method.

* Add message prompting users to contact support for immediate changes

We're showing this in the confirmation modal for a plan change that
would occur in the future, and and on the subscription page if a pending
change is due.

Most users shouldn't need this, but it should help them out if they find
an edge case like moving from eg. Student (Annual) to Professional
(Monthly) and were expecting to be "upgraded" immediately.

GitOrigin-RevId: c5be0efbeb8568ed9caa941aadcef6f6db65c420
2021-04-28 02:10:31 +00:00

61 lines
2.3 KiB
Text

extends ../layout
include ./dashboard/_team_name_mixin
block head-scripts
script(type="text/javascript", nonce=scriptNonce, src="https://js.recurly.com/v4/recurly.js")
block append meta
meta(name="ol-managedInstitutions", data-type="json", content=managedInstitutions)
meta(name="ol-planCodesChangingAtTermEnd", data-type="json", content=plans.planCodesChangingAtTermEnd)
if (personalSubscription && personalSubscription.recurly)
meta(name="ol-recurlyApiKey" content=settings.apis.recurly.publicKey)
meta(name="ol-subscription" data-type="json" content=personalSubscription)
meta(name="ol-recomendedCurrency" content=personalSubscription.recurly.currency)
block content
main.content.content-alt(ng-cloak)
.container
.row
.col-md-8.col-md-offset-2
if (fromPlansPage)
.alert.alert-warning
p You already have a subscription
.card
.page-header
h1 #{translate("your_subscription")}
-var hasDisplayedSubscription = false
if (personalSubscription)
-hasDisplayedSubscription = true
include ./dashboard/_personal_subscription
if (managedGroupSubscriptions && managedGroupSubscriptions.length > 0)
include ./dashboard/_managed_groups
if (managedInstitutions && managedInstitutions.length > 0)
include ./dashboard/_managed_institutions
if (managedPublishers && managedPublishers.length > 0)
include ./dashboard/_managed_publishers
if (memberGroupSubscriptions && memberGroupSubscriptions.length > 0)
-hasDisplayedSubscription = true
include ./dashboard/_group_memberships
if (confirmedMemberAffiliations && confirmedMemberAffiliations.length > 0)
include ./dashboard/_institution_memberships
if (v1SubscriptionStatus)
include ./dashboard/_v1_subscription_status
if (!hasDisplayedSubscription)
if (hasSubscription)
-hasDisplayedSubscription = true
p(ng-non-bindable) You're on an #{settings.appName} Paid plan. Contact
a(href="mailto:support@overleaf.com") support@overleaf.com
| to find out more.
else
p(ng-non-bindable) You're on the #{settings.appName} Free plan.
|
a(ng-controller="UpgradeSubscriptionController" href="/user/subscription/plans" ng-click="upgradeSubscription()").btn.btn-primary Upgrade now