FEAT : Ajout pagination galerie publique

This commit is contained in:
2025-12-02 09:12:07 +01:00
parent 109cc8065e
commit 6cb141293c
15 changed files with 181 additions and 78 deletions

View File

@@ -1,17 +1,40 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head><meta charset="utf-8"><title>Galerie</title></head>
<head>
<meta charset="utf-8"/>
<title>Galerie publique</title>
</head>
<body>
<h1>Galerie publique</h1>
<p><a th:href="@{/}">Accueil</a></p>
<!-- Affichage des photos -->
<div>
<a th:each="p : ${photosPage.content}"
th:href="@{'/photo/' + ${p.id}}"
style="display:inline-block; margin:10px;">
<img th:src="@{'/photo/' + ${p.id} + '/raw'}"
width="150"
style="border:1px solid #ccc;"/>
</a>
</div>
<!-- Pagination -->
<div style="margin-top:20px;">
<a th:if="${currentPage > 0}"
th:href="@{/galerie(page=${currentPage - 1})}">
⬅ Précédent
</a>
<span th:text="'Page ' + (${currentPage} + 1)"></span>
<a th:if="${photosPage.hasNext()}"
th:href="@{/galerie(page=${currentPage + 1})}">
Suivant ➡
</a>
</div>
<ul>
<li th:each="p : ${photos}">
<span th:text="${p.nomFichierOriginal}">nom</span>
<a th:href="@{'/photo/' + ${p.id}}">Voir</a>
</li>
</ul>
</body>
</html>