fixed bug with subscriptions where if an old user had a subscription and was in a group they would get a confusing page

This commit is contained in:
Henry Oswald 2015-06-01 14:38:09 +01:00
parent 33aa5c732f
commit aaa902cca9

View file

@ -15,8 +15,7 @@ mixin printPlan(plan)
tr(ng-controller="ChangePlanFormController")
td(ng-init="plan=#{JSON.stringify(plan)}")
strong #{plan.name}
td
{{refreshPrice(plan.planCode)}}
td {{refreshPrice(plan.planCode)}}
-if (plan.annual)
| {{prices[plan.planCode]}} / #{translate("year")}
-else
@ -44,7 +43,10 @@ block content
.card
.page-header
h1 #{translate("your_subscription")}
-if (subscription)
-if (groups.length != 0)
each groupSubscription in groups
p !{translate("member_of_group_subscription", {admin_email: "<strong>" + groupSubscription.admin_id.email + "</strong>"})}
- else if (subscription)
case subscription.state
when "free-trial"
p !{translate("on_free_trial_expiring_at", {expiresAt:"<strong>" + subscription.expiresAt + "</strong>"})}
@ -102,11 +104,7 @@ block content
mixin printPlans(plans.individualMonthlyPlans)
mixin printPlans(plans.individualAnnualPlans)
-if (subscription && groups.length > 0)
hr
each groupSubscription in groups
p !{translate("member_of_group_subscription", {admin_email: "<strong>" + groupSubscription.admin_id.email + "</strong>"})}
script(type="text/javascript").
$('#cancelSubscription').on("click", function() {