152 lines
8.1 KiB
ERB
152 lines
8.1 KiB
ERB
<%# locals: (club: nil, entitlements: nil, subscription: nil, current_plan_slug: nil, show_stripe_portal: false, show_guarantee_banner: nil) %>
|
|
<% club ||= @club %>
|
|
<% entitlements ||= @entitlements %>
|
|
<% subscription ||= @subscription %>
|
|
<% current_slug = local_assigns.fetch(:current_plan_slug, nil).presence || entitlements&.plan&.slug || subscription&.plan&.slug || "free" %>
|
|
<% current_interval = subscription&.billing_interval %>
|
|
<% billing_mode = club.present? %>
|
|
|
|
<div class="plans">
|
|
<% @plans.each do |plan| %>
|
|
<% action = billing_mode ? plan_billing_action(
|
|
current_slug: current_slug,
|
|
target_plan: plan,
|
|
stripe_subscription_active: stripe_subscription_active?(subscription),
|
|
current_interval: current_interval,
|
|
subscription: subscription,
|
|
club: club
|
|
) : nil %>
|
|
<% featured = plan.slug == "premium_full" %>
|
|
<div class="plan-card<%= " plan-card--featured" if featured %>">
|
|
<% if featured %>
|
|
<p class="plan-card__recommend"><%= t("pages.plans.recommended_badge") %></p>
|
|
<% end %>
|
|
<%= render "shared/plan_title", plan: plan %>
|
|
<% if plan.slug == "free" %>
|
|
<div class="plan-price">€0</div>
|
|
<% elsif billing_mode && club&.active_billing_quote&.plan_slug == plan.slug %>
|
|
<% quote = club.active_billing_quote %>
|
|
<div class="plan-price-block">
|
|
<div class="plan-price<%= " plan-price--featured" if featured %>"><%= quote.formatted_amount %></div>
|
|
<span class="plan-price-badge"><%= t("billing.bank_transfer.quoted_badge") %></span>
|
|
<p class="plan-price-equiv"><%= t("billing.bank_transfer.quoted_interval.#{quote.billing_interval}") %></p>
|
|
</div>
|
|
<% else %>
|
|
<% yearly = Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: "yearly") %>
|
|
<% monthly = Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: "monthly") %>
|
|
<% list = Billing::Stripe::PriceCatalog.list_label(plan_slug: plan.slug, interval: "yearly") %>
|
|
<% equiv = Billing::Stripe::PriceCatalog.equivalent_monthly_label(plan_slug: plan.slug) %>
|
|
<div class="plan-price-block">
|
|
<% if list.present? %>
|
|
<div class="plan-price-list"><s><%= list %></s></div>
|
|
<% end %>
|
|
<div class="plan-price<%= " plan-price--featured" if featured %>"><%= yearly %></div>
|
|
<span class="plan-price-badge"><%= t("pages.plans.launch_price") %></span>
|
|
<% if equiv.present? %>
|
|
<p class="plan-price-equiv"><%= t("pages.plans.price_equiv", price: equiv) %></p>
|
|
<% end %>
|
|
</div>
|
|
<p class="plan-price-alt"><%= raw t("pages.plans.price_alt_html", price: monthly) %></p>
|
|
<% end %>
|
|
<ul>
|
|
<li><%= raw(plan.max_staff_transmission ? t("pages.plans.staff_html", count: plan.max_staff_transmission) : t("pages.plans.staff_unlimited_html")) %></li>
|
|
<li><%= raw t("pages.plans.matches_html", count: plan.concurrent_streams_limit || t("pages.plans.matches_unlimited")) %></li>
|
|
<li><%= raw t(
|
|
"pages.plans.replay_html",
|
|
value: plan.recordings_enabled? ? t("pages.plans.replay_days", count: plan.recording_days) : t("pages.plans.replay_none")
|
|
) %></li>
|
|
<li><%= raw t(
|
|
"pages.plans.youtube_html",
|
|
value: if plan.slug == "premium_light"
|
|
t("pages.plans.youtube_mltv")
|
|
elsif plan.youtube_enabled?
|
|
t("pages.plans.youtube_club")
|
|
else
|
|
t("pages.plans.youtube_none")
|
|
end
|
|
) %></li>
|
|
<% if plan.slug == "premium_full" %>
|
|
<li><%= raw t("pages.plans.cover_sponsor_html") %></li>
|
|
<li><%= raw t("pages.plans.tournaments_html") %></li>
|
|
<% end %>
|
|
</ul>
|
|
<% if plan.slug == "premium_full" %>
|
|
<p class="plan-staff-note"><%= t("pages.plans.staff_note_full") %></p>
|
|
<% end %>
|
|
<% first_purchase = !billing_mode || action&.fetch(:kind, nil).in?(%i[checkout_options bank_only quoted]) %>
|
|
<% show_cta_guarantee = plan.slug.in?(%w[premium_light premium_full]) && first_purchase %>
|
|
<div class="plan-card__cta">
|
|
<% if billing_mode %>
|
|
<% action_kind = action[:kind] %>
|
|
<% quote = club&.active_billing_quote %>
|
|
<% pending_transfer = club&.pending_transfer_order %>
|
|
<% if action_kind == :current %>
|
|
<span class="btn btn-secondary" style="opacity:0.7"><%= action[:label] %></span>
|
|
<% elsif action_kind == :none %>
|
|
<% elsif action_kind.in?(%i[contact disabled quoted_other]) %>
|
|
<p class="plan-action-hint"><%= action[:label] %></p>
|
|
<% elsif action_kind.in?(%i[checkout_options change_options interval_switch quoted bank_only]) %>
|
|
<% if billing_profile_blocks_premium?(club) %>
|
|
<p class="plan-action-hint" style="color:#e53935;margin-bottom:10px">
|
|
<%= billing_profile_incomplete_message(club) %>
|
|
</p>
|
|
<%= link_to t("pages.plans.complete_billing"),
|
|
public_club_billing_profile_path(club, plan: plan.slug),
|
|
class: "btn btn-primary" %>
|
|
<% else %>
|
|
<% unless action_kind.in?(%i[quoted bank_only]) %>
|
|
<div class="plan-interval-actions">
|
|
<% plan_intervals_for_display(action[:intervals]).each do |interval| %>
|
|
<% btn_kind = action_kind == :checkout_options ? :checkout_options : action_kind %>
|
|
<%= link_to plan_interval_button_label(plan, interval, kind: btn_kind),
|
|
plan_interval_checkout_path(club, plan, interval),
|
|
class: plan_interval_button_class(interval) %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% transfer_intervals = action_kind == :quoted ? action[:intervals] : (action[:intervals].presence || bank_transfer_intervals_for(plan)) %>
|
|
<% if MatchLiveTv.bank_transfer_configured? && transfer_intervals.any? %>
|
|
<% unless action_kind.in?(%i[quoted bank_only]) %>
|
|
<p class="plan-action-hint" style="margin:10px 0 6px"><%= t("billing.bank_transfer.or_label") %></p>
|
|
<% end %>
|
|
<div class="plan-interval-actions">
|
|
<% plan_intervals_for_display(transfer_intervals).each do |interval| %>
|
|
<% next unless show_bank_transfer_for?(club: club, plan: plan, interval: interval, quote: quote, pending_transfer: pending_transfer) %>
|
|
<%= button_to t("billing.bank_transfer.pay_button_with_price", price: bank_transfer_price_label(plan, interval, quote: quote)),
|
|
public_club_billing_bank_transfer_path(club, plan: plan.slug, interval: interval),
|
|
method: :post,
|
|
class: "btn btn-outline plan-interval-btn",
|
|
form: { data: { turbo_confirm: t("billing.bank_transfer.confirm") } } %>
|
|
<% end %>
|
|
</div>
|
|
<p class="plan-action-hint" style="margin-top:8px"><%= t("billing.bank_transfer.hint") %></p>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% elsif plan.slug == "free" %>
|
|
<%= link_to t("pages.plans.start_free"), public_signup_path, class: "btn btn-secondary" %>
|
|
<% else %>
|
|
<div class="plan-interval-actions">
|
|
<% %w[yearly monthly].each do |interval| %>
|
|
<%= link_to t(
|
|
"billing.messages.activate_button",
|
|
plan: plan_cta_name(plan),
|
|
price: Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: interval)
|
|
),
|
|
public_signup_path(plan: plan.slug, interval: interval),
|
|
class: plan_interval_button_class(interval) %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% if show_cta_guarantee %>
|
|
<%= render "shared/refund_guarantee", variant: "compact" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if local_assigns.fetch(:show_guarantee_banner) { !billing_mode || current_slug.to_s == "free" } %>
|
|
<%= render "shared/refund_guarantee", variant: "pricing" %>
|
|
<% end %>
|