feat(licence): add licence search page with CSV export and reorganize sidebar menus
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Recherche Licences - 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">
|
||||
<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">Recherche de Licences</h2>
|
||||
</header>
|
||||
|
||||
<div class="flex-1 overflow-auto p-6">
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 mb-6">
|
||||
<form th:action="@{/admin/licences/recherche}" method="get" class="flex flex-wrap items-end gap-4">
|
||||
<div class="w-48">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Nom</label>
|
||||
<input type="text" name="nom" th:value="${nomFilter}" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
|
||||
</div>
|
||||
<div class="w-48">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Prénom</label>
|
||||
<input type="text" name="prenom" th:value="${prenomFilter}" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
|
||||
</div>
|
||||
<div class="w-48">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">N° Licence</label>
|
||||
<input type="text" name="numeroLicence" th:value="${numeroLicenceFilter}" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
|
||||
</div>
|
||||
<div class="w-64">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
||||
<input type="text" name="email" th:value="${emailFilter}" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
|
||||
</div>
|
||||
<div class="w-48">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Catégorie</label>
|
||||
<select name="categorieId" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
|
||||
<option value="">Toutes les catégories</option>
|
||||
<option th:each="cat : ${categories}" th:value="${cat.id}" th:text="${cat.nom}" th:selected="${cat.id == categorieId}"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="w-48">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Type de Demande</label>
|
||||
<select name="typeDemande" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
|
||||
<option value="">Tous les types</option>
|
||||
<option value="Nouvelle demande" th:selected="${typeDemandeFilter == 'Nouvelle demande'}">Nouvelle Demande</option>
|
||||
<option value="Renouvellement" th:selected="${typeDemandeFilter == 'Renouvellement'}">Renouvellement</option>
|
||||
<option value="Mutation" th:selected="${typeDemandeFilter == 'Mutation'}">Mutation</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex space-x-2">
|
||||
<button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700">Rechercher</button>
|
||||
<a th:href="@{/admin/licences/recherche}" class="bg-gray-100 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-200">Réinitialiser</a>
|
||||
<a th:href="@{/admin/licences/recherche/export(nom=${nomFilter},prenom=${prenomFilter},categorieId=${categorieId},numeroLicence=${numeroLicenceFilter},email=${emailFilter},typeDemande=${typeDemandeFilter})}"
|
||||
class="bg-indigo-50 text-indigo-700 px-4 py-2 rounded-lg text-sm font-medium hover:bg-indigo-100 flex items-center">
|
||||
Exporter CSV
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-left border-collapse min-w-[900px]">
|
||||
<thead>
|
||||
<tr class="bg-gray-50 text-gray-500 text-sm uppercase tracking-wider border-b border-gray-200">
|
||||
<th class="py-3 px-4 font-medium text-left">Nom Prénom</th>
|
||||
<th class="py-3 px-4 font-medium text-left">Catégorie</th>
|
||||
<th class="py-3 px-4 font-medium text-left">N° Licence</th>
|
||||
<th class="py-3 px-4 font-medium text-left">Type de Demande</th>
|
||||
<th class="py-3 px-4 font-medium text-left">Email</th>
|
||||
<th class="py-3 px-4 font-medium text-left">État</th>
|
||||
<th class="py-3 px-4 font-medium text-right">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 text-sm">
|
||||
<tr th:if="${#lists.isEmpty(licences)}">
|
||||
<td colspan="7" class="py-8 text-center text-gray-500">Aucun résultat trouvé pour cette recherche.</td>
|
||||
</tr>
|
||||
<tr th:each="licence : ${licences}" class="hover:bg-gray-50">
|
||||
<td class="py-3 px-4 font-medium text-gray-900">
|
||||
<span th:text="${licence.adherent.nom + ' ' + licence.adherent.prenom}">Nom Prénom</span>
|
||||
</td>
|
||||
<td class="py-3 px-4 text-gray-600" th:text="${licence.categorie != null ? licence.categorie.nom : '-'}">Catégorie</td>
|
||||
<td class="py-3 px-4 text-gray-600 font-mono" th:text="${licence.numeroLicence != null ? licence.numeroLicence : '-'}">N°</td>
|
||||
<td class="py-3 px-4 text-gray-600" th:text="${licence.typeDemande != null ? licence.typeDemande : '-'}">Type</td>
|
||||
<td class="py-3 px-4 text-gray-600" th:text="${licence.adherent.email != null ? licence.adherent.email : '-'}">Email</td>
|
||||
<td class="py-3 px-4 text-gray-600" th:text="${licence.etat != null ? licence.etat : '-'}">Etat</td>
|
||||
<td class="py-3 px-4 text-right">
|
||||
<a th:href="@{/adherents/{id}/edit(id=${licence.adherent.id})}" class="text-indigo-600 hover:text-indigo-900 font-medium">Voir Profil</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user