Allow a stripe plan to be superseded
If a plan has a direct corrolary, show that one as the selected plan instead of showing the plan as deprecated even though it has the same details
This commit is contained in:
parent
a5d0569e35
commit
ec6bee35b6
4 changed files with 44 additions and 3 deletions
|
@ -45,7 +45,7 @@
|
|||
</thead>
|
||||
|
||||
<tr ng-repeat="plan in plans" ng-show="isPlanVisible(plan, subscribedPlan)"
|
||||
ng-class="{'active':(subscribedPlan.stripeId === plan.stripeId), 'deprecated-plan':plan.deprecated}">
|
||||
ng-class="{'active':isPlanActive(plan, subscribedPlan), 'deprecated-plan':plan.deprecated}">
|
||||
<td>
|
||||
{{ plan.title }}
|
||||
<div class="deprecated-plan-label" ng-show="plan.deprecated">
|
||||
|
@ -63,7 +63,7 @@
|
|||
</button>
|
||||
</div>
|
||||
<div ng-switch-default>
|
||||
<button class="btn" ng-show="subscribedPlan.stripeId !== plan.stripeId"
|
||||
<button class="btn" ng-show="!isPlanActive(plan, subscribedPlan)"
|
||||
ng-class="subscribedPlan.price == 0 ? 'btn-primary' : 'btn-default'"
|
||||
ng-click="changeSubscription(plan.stripeId)">
|
||||
<span class="cor-loader-inline" ng-show="planChanging"></span>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<span ng-show="!planChanging && subscribedPlan.price == 0 && !isExistingCustomer">Start Free Trial</span>
|
||||
<span ng-show="!planChanging && subscribedPlan.price == 0 && isExistingCustomer">Subscribe</span>
|
||||
</button>
|
||||
<button class="btn btn-danger" ng-show="subscription.plan === plan.stripeId && plan.price > 0"
|
||||
<button class="btn btn-danger" ng-show="isPlanActive(plan, subscribedPlan) && plan.price > 0"
|
||||
ng-click="cancelSubscription()">
|
||||
<span class="cor-loader-inline" ng-show="planChanging"></span>
|
||||
<span ng-show="!planChanging">Cancel</span>
|
||||
|
|
Reference in a new issue