All checks were successful
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>
47 lines
1.9 KiB
HTML
47 lines
1.9 KiB
HTML
{# app/modules/loyalty/templates/loyalty/admin/program-edit.html #}
|
|
{% extends "admin/base.html" %}
|
|
{% from 'shared/macros/headers.html' import detail_page_header %}
|
|
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
|
|
{% from 'shared/macros/modals.html' import confirm_modal %}
|
|
|
|
{% block title %}{{ _('loyalty.admin.program_edit.title') }}{% endblock %}
|
|
|
|
{% block i18n_modules %}['loyalty']{% endblock %}
|
|
|
|
{% block alpine_data %}adminLoyaltyProgramEdit(){% endblock %}
|
|
|
|
{% block content %}
|
|
{% call detail_page_header("isNewProgram ? 'Create Program: ' + (merchant?.name || '') : 'Edit Program: ' + (merchant?.name || '')", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='merchant') %}
|
|
<span x-text="isNewProgram ? '{{ _('loyalty.admin.program_edit.create_subtitle')|replace("'", "\\'") }}' : '{{ _('loyalty.admin.program_edit.edit_subtitle')|replace("'", "\\'") }}'"></span>
|
|
{% endcall %}
|
|
|
|
{{ loading_state(_('loyalty.admin.program_edit.loading')) }}
|
|
{{ error_state(_('loyalty.admin.program_edit.error_loading')) }}
|
|
|
|
<div x-show="!loading">
|
|
<form @submit.prevent="saveSettings">
|
|
{% set show_delete = true %}
|
|
{% set show_status = true %}
|
|
{% set cancel_url = '/admin/loyalty/merchants/' ~ merchant_id %}
|
|
{% include "loyalty/shared/program-form.html" %}
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Delete Confirmation Modal -->
|
|
{{ confirm_modal(
|
|
'deleteProgramModal',
|
|
_('loyalty.admin.program_edit.delete_title'),
|
|
_('loyalty.admin.program_edit.delete_message'),
|
|
'deleteProgram()',
|
|
'showDeleteModal',
|
|
_('loyalty.admin.program_edit.delete_confirm'),
|
|
_('loyalty.common.cancel'),
|
|
'danger'
|
|
) }}
|
|
{% endblock %}
|
|
|
|
{% block extra_scripts %}
|
|
<script defer src="{{ static_v(request, 'loyalty_static', path='shared/js/loyalty-program-form.js') }}"></script>
|
|
<script defer src="{{ static_v(request, 'loyalty_static', path='admin/js/loyalty-program-edit.js') }}"></script>
|
|
{% endblock %}
|