_change_plans_mixins.pug 1.3 KB

12345678910111213141516171819202122232425262728
  1. mixin printPlan(plan)
  2. if (!plan.hideFromUsers)
  3. tr(ng-controller="ChangePlanFormController", ng-init="plan="+JSON.stringify(plan))
  4. td
  5. strong(ng-non-bindable) #{plan.name}
  6. td
  7. if (plan.annual)
  8. | {{displayPrice}} / #{translate("year")}
  9. else
  10. | {{displayPrice}} / #{translate("month")}
  11. td
  12. if (typeof(personalSubscription.planCode) != "undefined" && plan.planCode == personalSubscription.planCode.split("_")[0])
  13. if (personalSubscription.pendingPlan)
  14. form
  15. input(type="hidden", ng-model="plan_code", name="plan_code", value=plan.planCode)
  16. input(type="submit", ng-click="cancelPendingPlanChange()", value=translate("keep_current_plan")).btn.btn-success
  17. else
  18. button.btn.disabled #{translate("your_plan")}
  19. else if (personalSubscription.pendingPlan && typeof(personalSubscription.pendingPlan.planCode) != "undefined" && plan.planCode == personalSubscription.pendingPlan.planCode.split("_")[0])
  20. button.btn.disabled #{translate("your_new_plan")}
  21. else
  22. form
  23. input(type="hidden", ng-model="plan_code", name="plan_code", value=plan.planCode)
  24. input(type="submit", ng-click="changePlan()", value=translate("change_to_this_plan")).btn.btn-success
  25. mixin printPlans(plans)
  26. each plan in plans
  27. +printPlan(plan)