Files
orion/app/modules/loyalty/templates/loyalty/admin/merchant-card-detail.html
Samir Boulahtit 54247ca4f0
All checks were successful
CI / ruff (push) Successful in 18s
CI / pytest (push) Successful in 2h50m43s
CI / validate (push) Successful in 33s
CI / dependency-scanning (push) Successful in 33s
CI / docs (push) Successful in 50s
CI / deploy (push) Successful in 1m15s
feat(static-assets): cache-bust JS/CSS via ?v=<commit-sha>, immutable in prod
Adds a `static_v(request, name, path=...)` Jinja helper that appends
?v=<commit-sha> from app.core.build_info, plus a CachedStaticFiles
subclass that serves Cache-Control: public, max-age=31536000, immutable
in production and no-cache in development. Browsers refetch JS/CSS
automatically on every deploy without the user having to hard-reload.

- New: app/core/static_files.py (CachedStaticFiles)
- Updated: app/templates_config.py (static_v helper)
- Updated: main.py (use CachedStaticFiles for *_static mounts)
- Codemod: 143 url_for('*_static', path='*.js'|'*.css') → static_v(...)
  across 123 templates. Images/fonts/JSON locales intentionally
  unchanged (out of scope).
- Arch rule: FE-024 (warning) flags raw url_for on JS/CSS to prevent
  drift. Note: FE-008 was already taken by the number_stepper rule.
- docs/proposals/static-asset-cache-busting.md marked Done.

Closes plan from docs/proposals/static-asset-cache-busting.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 19:35:59 +02:00

27 lines
1.4 KiB
HTML

{# app/modules/loyalty/templates/loyalty/admin/merchant-card-detail.html #}
{% extends "admin/base.html" %}
{% from 'shared/macros/headers.html' import detail_page_header %}
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
{% block title %}{{ _('loyalty.admin.merchant_card_detail.title') }}{% endblock %}
{% block i18n_modules %}['loyalty']{% endblock %}
{% block alpine_data %}adminMerchantCardDetail(){% endblock %}
{% block content %}
{% 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')) }}
{{ error_state(_('loyalty.admin.merchant_card_detail.error_loading')) }}
{% set card_detail_api_prefix = '/admin/loyalty/merchants/' + merchant_id|string %}
{% set card_detail_back_url = '/admin/loyalty/merchants/' + merchant_id|string + '/cards' %}
{% include 'loyalty/shared/card-detail-view.html' %}
{% endblock %}
{% block extra_scripts %}
<script defer src="{{ static_v(request, 'loyalty_static', path='shared/js/loyalty-card-detail-view.js') }}"></script>
<script defer src="{{ static_v(request, 'loyalty_static', path='admin/js/loyalty-merchant-card-detail.js') }}"></script>
{% endblock %}