fix(loyalty): show merchant name in admin on-behalf page headers
Switch admin sub-pages (cards, pins, transactions) from page_header_flex to detail_page_header with merchant name context, matching the settings page pattern. Headers now show "MerchantName — Cards" with back button to merchant detail hub. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
{% block alpine_data %}adminMerchantCardDetail(){% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% call detail_page_header("card?.card_number || 'Card Detail'", '/admin/loyalty/merchants/' + merchant_id|string + '/cards', subtitle_show='card') %}
|
||||
<span x-text="card ? (card.customer_name || card.customer_email || '') : ''"></span>
|
||||
{% call detail_page_header("(card?.customer_name || '" + _('loyalty.admin.merchant_card_detail.title') + "')", '/admin/loyalty/merchants/' ~ merchant_id ~ '/cards', subtitle_show='card') %}
|
||||
<span x-text="card?.card_number || ''"></span>
|
||||
{% endcall %}
|
||||
|
||||
{{ loading_state(_('loyalty.admin.merchant_card_detail.loading')) }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{# app/modules/loyalty/templates/loyalty/admin/merchant-cards.html #}
|
||||
{% extends "admin/base.html" %}
|
||||
{% from 'shared/macros/headers.html' import page_header_flex, refresh_button %}
|
||||
{% from 'shared/macros/headers.html' import detail_page_header, refresh_button %}
|
||||
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
|
||||
|
||||
{% block title %}{{ _('loyalty.admin.merchant_cards.title') }}{% endblock %}
|
||||
@@ -8,15 +8,8 @@
|
||||
{% block alpine_data %}adminMerchantCards(){% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% call page_header_flex(title=_('loyalty.admin.merchant_cards.title'), subtitle=_('loyalty.admin.merchant_cards.subtitle')) %}
|
||||
<div class="flex items-center gap-3">
|
||||
{{ refresh_button(loading_var='loading', onclick='loadCards()', variant='secondary') }}
|
||||
<a href="/admin/loyalty/merchants/{{ merchant_id }}"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600">
|
||||
<span x-html="$icon('arrow-left', 'w-4 h-4 mr-2')"></span>
|
||||
{{ _('loyalty.common.back') }}
|
||||
</a>
|
||||
</div>
|
||||
{% call detail_page_header("(program?.merchant_name || '') + ' — " + _('loyalty.admin.merchant_cards.title') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
|
||||
{{ _('loyalty.admin.merchant_cards.subtitle') }}
|
||||
{% endcall %}
|
||||
|
||||
{{ loading_state(_('loyalty.admin.merchant_cards.loading')) }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{# app/modules/loyalty/templates/loyalty/admin/merchant-pins.html #}
|
||||
{% extends "admin/base.html" %}
|
||||
{% from 'shared/macros/headers.html' import page_header_flex, refresh_button %}
|
||||
{% from 'shared/macros/headers.html' import detail_page_header, refresh_button %}
|
||||
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
|
||||
|
||||
{% block title %}{{ _('loyalty.admin.merchant_pins.title') }}{% endblock %}
|
||||
@@ -8,15 +8,8 @@
|
||||
{% block alpine_data %}adminMerchantPins(){% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% call page_header_flex(title=_('loyalty.admin.merchant_pins.title'), subtitle=_('loyalty.admin.merchant_pins.subtitle')) %}
|
||||
<div class="flex items-center gap-3">
|
||||
{{ refresh_button(loading_var='loading', onclick='loadPins()', variant='secondary') }}
|
||||
<a href="/admin/loyalty/merchants/{{ merchant_id }}"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600">
|
||||
<span x-html="$icon('arrow-left', 'w-4 h-4 mr-2')"></span>
|
||||
{{ _('loyalty.common.back') }}
|
||||
</a>
|
||||
</div>
|
||||
{% call detail_page_header("(program?.merchant_name || '') + ' — " + _('loyalty.admin.merchant_pins.title') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
|
||||
{{ _('loyalty.admin.merchant_pins.subtitle') }}
|
||||
{% endcall %}
|
||||
|
||||
{{ loading_state(_('loyalty.admin.merchant_pins.loading')) }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{# app/modules/loyalty/templates/loyalty/admin/merchant-transactions.html #}
|
||||
{% extends "admin/base.html" %}
|
||||
{% from 'shared/macros/headers.html' import page_header_flex, refresh_button %}
|
||||
{% from 'shared/macros/headers.html' import detail_page_header, refresh_button %}
|
||||
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
|
||||
|
||||
{% block title %}{{ _('loyalty.admin.merchant_transactions.title') }}{% endblock %}
|
||||
@@ -8,15 +8,8 @@
|
||||
{% block alpine_data %}adminMerchantTransactions(){% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% call page_header_flex(title=_('loyalty.admin.merchant_transactions.title'), subtitle=_('loyalty.admin.merchant_transactions.subtitle')) %}
|
||||
<div class="flex items-center gap-3">
|
||||
{{ refresh_button(loading_var='loading', onclick='loadTransactions()', variant='secondary') }}
|
||||
<a href="/admin/loyalty/merchants/{{ merchant_id }}"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600">
|
||||
<span x-html="$icon('arrow-left', 'w-4 h-4 mr-2')"></span>
|
||||
{{ _('loyalty.common.back') }}
|
||||
</a>
|
||||
</div>
|
||||
{% call detail_page_header("(program?.merchant_name || '') + ' — " + _('loyalty.admin.merchant_transactions.title') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
|
||||
{{ _('loyalty.admin.merchant_transactions.subtitle') }}
|
||||
{% endcall %}
|
||||
|
||||
{{ loading_state(_('loyalty.admin.merchant_transactions.loading')) }}
|
||||
|
||||
Reference in New Issue
Block a user