63 lines
1.9 KiB
HTML
63 lines
1.9 KiB
HTML
<!doctype html>
|
|
<html xmlns:th="http://www.thymeleaf.org">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>Détail de la photo</title>
|
|
</head>
|
|
<body>
|
|
|
|
<h1>Détail de la photo</h1>
|
|
|
|
<p>
|
|
<a th:href="@{/}">Accueil</a> |
|
|
<a th:href="@{/galerie}">Galerie publique</a> |
|
|
<a th:href="@{/mes-photos}">Mes photos</a>
|
|
</p>
|
|
|
|
<!-- Affichage de la photo -->
|
|
<div>
|
|
<img th:src="@{'/photo/' + ${photo.id} + '/raw'}"
|
|
alt="Photo"
|
|
style="max-width:500px; border:1px solid #ccc; margin:20px 0;"/>
|
|
</div>
|
|
|
|
<!-- Infos -->
|
|
<ul>
|
|
<li><strong>Nom original :</strong> <span th:text="${photo.nomFichierOriginal}"></span></li>
|
|
<li><strong>Date upload :</strong> <span th:text="${photo.dateUpload}"></span></li>
|
|
<li><strong>Visibilité :</strong> <span th:text="${photo.visibilite}"></span></li>
|
|
<li><strong>Propriétaire :</strong> <span th:text="${photo.proprietaire.email}"></span></li>
|
|
</ul>
|
|
|
|
<!-- Commentaires -->
|
|
<h2>Commentaires</h2>
|
|
<div th:if="${#lists.isEmpty(commentaires)}">
|
|
<p>Aucun commentaire pour l'instant.</p>
|
|
</div>
|
|
<ul th:if="${!#lists.isEmpty(commentaires)}">
|
|
<li th:each="c : ${commentaires}">
|
|
<strong th:text="${c.auteur.email}">Auteur</strong> :
|
|
<span th:text="${c.contenu}"></span>
|
|
<em>(<span th:text="${c.dateCommentaire}"></span>)</em>
|
|
</li>
|
|
</ul>
|
|
<!-- Formulaire d'ajout de commentaire -->
|
|
<div th:if="${currentUser}">
|
|
<h3>Ajouter un commentaire</h3>
|
|
<form th:action="@{'/photo/' + ${photo.id} + '/comment'}" method="post">
|
|
<textarea name="contenu" rows="3" cols="50"></textarea><br/>
|
|
<button type="submit">Envoyer</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div th:if="${currentUser == null}">
|
|
<p><a th:href="@{/login}">Connectez-vous</a> pour commenter.</p>
|
|
</div>
|
|
|
|
<p>
|
|
<a th:href="@{'/photo/' + ${photo.id} + '/raw'}" target="_blank">Voir en grande taille</a>
|
|
</p>
|
|
|
|
</body>
|
|
</html>
|