Feature: Implement secure public pre-registration flow with CAPTCHA and HTMX dashboard
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 3m12s
AS Talange CI/CD Pipeline / Build & Run in Docker Container (push) Successful in 3m4s

- Created V16 Flyway migration for pre_inscription and token_pre_inscription tables.
- Added PreInscription and TokenPreInscription entities with respective repositories.
- Updated SecurityConfig to allow public access to /inscription-public/**.
- Implemented CaptchaValidationService to interact with Cloudflare Turnstile API.
- Created PublicInscriptionController for managing the QR code entry, CAPTCHA validation, ephemeral tokens, and public form submission.
- Added public Thymeleaf views (demarrer, formulaire, succes, lien-expire) with TailwindCSS.
- Developed AdminPreInscriptionController and PreInscriptionService to handle back-office validation and rejection workflows.
- Built the admin pre-inscriptions dashboard list view.
- Added a dynamic, polling notification badge in the sidebar using HTMX, auto-updating on validation/rejection events.
This commit is contained in:
2026-06-11 23:11:34 +02:00
parent bca84be16a
commit 2e8298b3b6
16 changed files with 669 additions and 1 deletions
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Pré-inscriptions - AS Talange</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/htmx.org@1.9.11"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style> body { font-family: 'Inter', sans-serif; } </style>
</head>
<body class="bg-gray-50 text-gray-900 flex h-screen overflow-hidden">
<!-- Sidebar -->
<div th:replace="~{fragments/sidebar :: sidebar}"></div>
<main class="flex-1 flex flex-col h-screen overflow-hidden">
<header class="h-16 bg-white border-b border-gray-200 flex items-center px-6">
<h2 class="text-lg font-semibold text-gray-800">Dossiers en attente</h2>
</header>
<div class="flex-1 overflow-auto p-6">
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
<table class="w-full text-left border-collapse">
<thead>
<tr class="bg-gray-50 text-gray-500 text-sm uppercase tracking-wider border-b border-gray-200">
<th class="py-3 px-6 font-medium">Date</th>
<th class="py-3 px-6 font-medium">Adhérent</th>
<th class="py-3 px-6 font-medium">Contact</th>
<th class="py-3 px-6 font-medium text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 text-sm">
<tr th:if="${#lists.isEmpty(preInscriptions)}">
<td colspan="4" class="py-8 text-center text-gray-500">Aucune pré-inscription en attente.</td>
</tr>
<tr th:each="pre : ${preInscriptions}" th:id="'pre-' + ${pre.id}" class="hover:bg-gray-50 transition-colors">
<td class="py-4 px-6 text-gray-600" th:text="${#temporals.format(pre.dateCreation, 'dd/MM/yyyy HH:mm')}"></td>
<td class="py-4 px-6">
<div class="font-medium text-gray-900" th:text="${pre.nom + ' ' + pre.prenom}"></div>
<div class="text-xs text-gray-500" th:text="'Né(e) le ' + ${#temporals.format(pre.dateNaissance, 'dd/MM/yyyy')}"></div>
<div th:if="${pre.representantLegal != null}" class="text-[10px] text-blue-600 font-semibold mt-1" th:text="'Parent : ' + ${pre.representantLegal}"></div>
</td>
<td class="py-4 px-6">
<div class="text-gray-900" th:text="${pre.telephone}"></div>
<div class="text-xs text-gray-500" th:text="${pre.email}"></div>
</td>
<td class="py-4 px-6 text-right space-x-2">
<button th:hx-post="@{/admin/pre-inscriptions/{id}/valider(id=${pre.id})}"
class="bg-blue-600 text-white px-3 py-1.5 rounded hover:bg-blue-700 transition-colors">
Créer la fiche
</button>
<button th:hx-post="@{/admin/pre-inscriptions/{id}/rejeter(id=${pre.id})}"
th:hx-target="'#pre-' + ${pre.id}"
hx-swap="outerHTML"
hx-confirm="Confirmer le rejet du dossier ?"
class="bg-red-50 text-red-600 border border-red-200 px-3 py-1.5 rounded hover:bg-red-100 transition-colors">
Rejeter
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</main>
</body>
</html>