refactor pour intégrer l'architecture 3-tiers

This commit is contained in:
2025-12-02 23:21:44 +01:00
parent f0e20be396
commit 6a3569029d
41 changed files with 530 additions and 226 deletions

View File

@@ -8,9 +8,6 @@
<h2>Mes photos</h2>
<p><a th:href="@{/upload}">Uploader une photo</a></p>
<p><a th:href="@{/}">Retour accueil</a></p>
<div th:if="${#lists.isEmpty(mesPhotos)}">
<p>Vous n'avez pas encore de photos.</p>
</div>
<h2>Mes photos privées</h2>
<div>
<a th:each="p : ${photosPrivees.content}"
@@ -52,10 +49,21 @@
</div>
<div>
<a th:if="${mesPhotosPartagees.hasPrevious()}"
th:href="@{/mes-photos(pageMesPartagees=${pageMesPartagees - 1})}"></a>
th:href="@{/mes-photos(
pagePrivees=${pagePrivees},
pagePubliques=${pagePubliques},
pagePartagees=${pagePartagees},
pageMesPartagees=${pageMesPartagees - 1}
)}"></a>
<span th:text="'Page ' + (${pageMesPartagees}+1)"></span>
<a th:if="${mesPhotosPartagees.hasNext()}"
th:href="@{/mes-photos(pageMesPartagees=${pageMesPartagees + 1})}"></a>
th:href="@{/mes-photos(
pagePrivees=${pagePrivees},
pagePubliques=${pagePubliques},
pagePartagees=${pagePartagees},
pageMesPartagees=${pageMesPartagees + 1}
)}"></a>
</div>

View File

@@ -34,6 +34,8 @@
<ul>
<li th:each="p : ${partages}">
<span th:text="${p.utilisateur.email}"></span>
<span th:text="${p.permission}"></span>
<a th:href="@{'/photo/' + ${photo.id} + '/unshare/' + ${p.utilisateur.email}}"
style="color:red;">Retirer</a>
</li>
@@ -43,6 +45,12 @@
<form th:action="@{'/photo/' + ${photo.id} + '/share'}" method="post">
<label>Email de l'utilisateur :</label>
<input type="email" name="email" required />
<label>Permission :</label>
<select name="permission">
<option value="READ">Lecture</option>
<option value="COMMENT">Commenter</option>
<option value="ADMIN">Administrer</option>
</select>
<button type="submit">Partager</button>
</form>
</div>