fix(loyalty): pass merchant name server-side to admin on-behalf headers

Load merchant name in page route handlers and pass to template context.
Headers now render as "Cards: Fashion Group S.A." using server-side
Jinja2 variables instead of relying on JS program.merchant_name which
was not in the ProgramResponse schema.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 14:15:05 +01:00
parent a423bcf03e
commit 1107de989b
4 changed files with 18 additions and 8 deletions

View File

@@ -8,7 +8,7 @@
{% block alpine_data %}adminMerchantCards(){% endblock %}
{% block content %}
{% call detail_page_header("(program?.merchant_name || '') + ' — " + _('loyalty.admin.merchant_cards.title') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
{% call detail_page_header("'" + _('loyalty.admin.merchant_cards.title') + ": " + (merchant_name or '') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
{{ _('loyalty.admin.merchant_cards.subtitle') }}
{% endcall %}

View File

@@ -8,7 +8,7 @@
{% block alpine_data %}adminMerchantPins(){% endblock %}
{% block content %}
{% call detail_page_header("(program?.merchant_name || '') + ' — " + _('loyalty.admin.merchant_pins.title') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
{% call detail_page_header("'" + _('loyalty.admin.merchant_pins.title') + ": " + (merchant_name or '') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
{{ _('loyalty.admin.merchant_pins.subtitle') }}
{% endcall %}

View File

@@ -8,7 +8,7 @@
{% block alpine_data %}adminMerchantTransactions(){% endblock %}
{% block content %}
{% call detail_page_header("(program?.merchant_name || '') + ' — " + _('loyalty.admin.merchant_transactions.title') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
{% call detail_page_header("'" + _('loyalty.admin.merchant_transactions.title') + ": " + (merchant_name or '') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
{{ _('loyalty.admin.merchant_transactions.subtitle') }}
{% endcall %}