feat(mail): ajout du service de relances par e-mail et intégration HTMX dans l'admin

This commit is contained in:
2026-08-07 23:30:18 +02:00
parent 5f372254f0
commit 1bd6407c39
7 changed files with 586 additions and 5 deletions
@@ -10,6 +10,8 @@
body { font-family: 'Inter', sans-serif; }
.hidden-block { display: none; }
</style>
<meta name="_csrf" th:content="${_csrf.token}"/>
<meta name="_csrf_header" th:content="${_csrf.headerName}"/>
</head>
<body class="bg-gray-50 text-gray-900 flex h-screen overflow-hidden">
@@ -306,6 +308,15 @@
th:data-reste-a-payer="${lic.getResteAPayer()}"
onclick="openPaiementModal(this.getAttribute('data-licence-id'), this.getAttribute('data-reste-a-payer'))"
class="text-green-600 hover:text-green-800 font-medium bg-green-50 px-3 py-1 rounded-lg btn-payer">Payer</button>
<span th:if="${lic.getResteAPayer().compareTo(T(java.math.BigDecimal).ZERO) > 0}" th:id="'relance-licence-container-' + ${lic.id}">
<button type="button"
th:attr="hx-post=@{/adherents/{id}/relancer-paiement-htmx(id=${adherent.id})}, hx-target=|#relance-licence-container-${lic.id}|"
hx-swap="innerHTML"
class="text-amber-700 hover:text-amber-900 font-medium bg-amber-50 hover:bg-amber-100 border border-amber-200 px-3 py-1 rounded-lg inline-flex items-center gap-1.5 transition-colors cursor-pointer" title="Envoyer un e-mail de relance pour la cotisation impayée">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 002-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/></svg>
Relancer
</button>
</span>
</td>
</tr>
<tr th:if="${!#lists.isEmpty(lic.paiements)}" class="bg-gray-50/50">
@@ -1081,6 +1092,14 @@
if (typeMaillotSelect) {
typeMaillotSelect.addEventListener('change', updateEquipmentStyleLabels);
}
document.body.addEventListener('htmx:configRequest', function(evt) {
var csrfHeader = document.querySelector('meta[name="_csrf_header"]');
var csrfToken = document.querySelector('meta[name="_csrf"]');
if (csrfHeader && csrfToken) {
evt.detail.headers[csrfHeader.content] = csrfToken.content;
}
});
});
</script>
</body>