{# app/templates/platform/sections/_pricing.html #}
{# Pricing section partial with multi-language support #}
{#
Parameters:
- pricing: PricingSection object (or dict)
- lang: Current language code
- default_lang: Fallback language
- tiers: List of subscription tiers from DB (passed via context)
#}
{% macro render_pricing(pricing, lang, default_lang, tiers) %}
{% if pricing and pricing.enabled %}
{# Section header #}
{% set title = pricing.title.translations.get(lang) or pricing.title.translations.get(default_lang) or '' %}
{% if title %}
{{ title }}
{% endif %}
{% if pricing.subtitle and pricing.subtitle.translations %}
{% set subtitle = pricing.subtitle.translations.get(lang) or pricing.subtitle.translations.get(default_lang) %}
{% if subtitle %}
{{ subtitle }}
{% endif %}
{% endif %}
{# Pricing toggle (monthly/annual) #}
{% if pricing.use_subscription_tiers and tiers %}
{# Billing toggle #}
{{ _('pricing.monthly') or 'Monthly' }}
{{ _('pricing.annual') or 'Annual' }}
{{ _('pricing.save_months') or 'Save 2 months!' }}
{# Pricing cards #}
{% for tier in tiers %}
{% if tier.is_popular %}
{{ _('pricing.most_popular') or 'Most Popular' }}
{% endif %}
{{ tier.name }}
{{ tier.description or '' }}
{# Price #}
{{ tier.price_monthly }}
/{{ _('pricing.month') or 'mo' }}