Commit fcc65015 authored by Dallas Reedy's avatar Dallas Reedy Committed by Oswaldo Ferreira

Pass current_plan all the way down partial chain

- This way we only have to calculate it once and we can use it to see if
  the currently rendered plan is also the currently active plan
parent 7af7c7dd
......@@ -5,7 +5,7 @@
- top_most_group_plan = subscription_plan_info(@plans_data, @top_most_group.actual_plan_name)
= render 'shared/billings/billing_plan_header', namespace: @group, plan: top_most_group_plan, parent_group: @top_most_group
- else
= render 'shared/billings/billing_plans', plans_data: @plans_data, namespace: @group
= render 'shared/billings/billing_plans', plans_data: @plans_data, namespace: @group, current_plan: current_plan
#js-billing-plans{ data: subscription_plan_data_attributes(@group, current_plan) }
- page_title _('Billing')
- current_plan = subscription_plan_info(@plans_data, current_user.namespace.actual_plan_name)
= render 'shared/billings/billing_plans', plans_data: @plans_data, namespace: current_user.namespace
= render 'shared/billings/billing_plans', plans_data: @plans_data, namespace: current_user.namespace, current_plan: current_plan
#js-billing-plans{ data: subscription_plan_data_attributes(current_user.namespace, current_plan) }
- purchase_link = plan.purchase_link
- is_current_plan = plan.code == namespace.actual_plan_name
- is_current_plan = plan.code == current_plan&.code
.col-md-6.col-lg-3
.card.mb-5{ class: ("card-active" if is_current_plan) }
......
- current_plan = subscription_plan_info(plans_data, namespace.actual_plan_name)
- support_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: EE::CUSTOMER_SUPPORT_URL }
- support_link_end = '</a>'.html_safe
......
---
title: Pass current_plan all the way down the partial chain
merge_request: 38868
author:
type: changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment