118 lines
4.3 KiB
HTML
118 lines
4.3 KiB
HTML
<!doctype html>
|
||
<html xmlns:th="http://www.thymeleaf.org">
|
||
<head>
|
||
<meta charset="utf-8"/>
|
||
<title>Détail album</title>
|
||
</head>
|
||
<header>
|
||
<p>
|
||
<a th:href="@{/}">Accueil</a> |
|
||
<a th:href="@{/upload}">Uploader une photo</a> |
|
||
<a th:href="@{/mes-photos}">Mes photos</a> |
|
||
<a th:href="@{/mes-albums}">Mes albums</a> |
|
||
<a th:href="@{/galerie}">Galerie publique</a>
|
||
</p>
|
||
<hr/>
|
||
</header>
|
||
<body>
|
||
|
||
<a th:href="@{/mes-albums}">⬅ Retour aux albums</a>
|
||
<h1 th:text="${album.nom}"></h1>
|
||
<p><b>Description :</b> <span th:text="${album.description}"></span></p>
|
||
<p><b>Propriétaire :</b> <span th:text="${album.proprietaire.email}"></span></p>
|
||
<p><b>Visibilité :</b> <span th:text="${album.visibilite}"></span></p>
|
||
<hr/>
|
||
<!-- LISTE DES PHOTOS -->
|
||
<h2>Photos dans l’album</h2>
|
||
<div th:each="p : ${album.photos}" style="display:inline-block; margin:10px;">
|
||
<a th:href="@{'/photo/' + ${p.id}}">
|
||
<img th:src="@{'/photo/' + ${p.id} + '/thumb'}" width="120"/>
|
||
</a>
|
||
<br/>
|
||
<a th:if="${canAdmin}" th:href="@{'/album/' + ${album.id} + '/remove/' + ${p.id}}"
|
||
style="color:red;">Retirer</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
<!-- Bloc visible uniquement par le propriétaire ou ADMIN album -->
|
||
<div th:if="${canAdmin}">
|
||
|
||
<hr/>
|
||
<!-- AJOUT PHOTO -->
|
||
<h2>Ajouter une photo</h2>
|
||
<div th:if="${param.added}" style="color:green; font-weight:bold;">
|
||
Photo ajoutée !
|
||
</div>
|
||
<form th:action="@{'/album/' + ${album.id} + '/add'}" method="post">
|
||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||
<select name="photoId">
|
||
<option th:each="p : ${myPhotos}"
|
||
th:value="${p.id}"
|
||
th:text="${p.nomFichierOriginal}">
|
||
</option>
|
||
</select>
|
||
<button type="submit">Ajouter</button>
|
||
</form>
|
||
<hr/>
|
||
<h2>Gestion des partages de l’album</h2>
|
||
<div th:if="${param.error}" style="color:red; font-weight:bold;">
|
||
<span th:text="${param.error}"></span>
|
||
</div>
|
||
<!-- FORMULAIRE AJOUT PARTAGE -->
|
||
<form th:action="@{'/album/' + ${album.id} + '/share'}" method="post">
|
||
<label>Email du destinataire :</label>
|
||
<input type="email" name="email" required>
|
||
<label>Permission :</label>
|
||
<select name="permission">
|
||
<option value="READ">Lecture</option>
|
||
<option value="COMMENT">Commentaire</option>
|
||
<option value="ADMIN">Admin</option>
|
||
</select>
|
||
<button type="submit">Partager</button>
|
||
</form>
|
||
<h4>Utilisateurs ayant accès :</h4>
|
||
<table>
|
||
<tr>
|
||
<th>Utilisateur</th>
|
||
<th>Permission</th>
|
||
<th>Actions</th>
|
||
</tr>
|
||
<tr th:each="p : ${partages}">
|
||
<td th:text="${p.utilisateur.email}"></td>
|
||
<!-- FORMULAIRE UPDATE PERMISSION -->
|
||
<td>
|
||
<form th:action="@{'/album/' + ${album.id} + '/share/update'}" method="post">
|
||
<input type="hidden" name="email" th:value="${p.utilisateur.email}"/>
|
||
<select name="permission">
|
||
<option value="READ" th:selected="${p.permission == 'READ'}">Lecture</option>
|
||
<option value="COMMENT" th:selected="${p.permission == 'COMMENT'}">Commentaire</option>
|
||
<option value="ADMIN" th:selected="${p.permission == 'ADMIN'}">Admin</option>
|
||
</select>
|
||
<button type="submit">Modifier</button>
|
||
</form>
|
||
</td>
|
||
<td>
|
||
<a th:href="@{'/album/' + ${album.id} + '/unshare/' + ${p.utilisateur.email}}">Retirer</a>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
<hr>
|
||
<!-- SUPPRESSION ALBUM -->
|
||
<a th:href="@{'/album/' + ${album.id} + '/delete'}" style="color:red;">
|
||
Supprimer l’album
|
||
</a>
|
||
</div>
|
||
</body>
|
||
<footer>
|
||
<hr/>
|
||
<form th:action="@{/logout}" method="post" style="display: inline;">
|
||
<button type="submit"
|
||
style="background: none; border: none; color: blue; text-decoration: underline; cursor: pointer;">
|
||
Se déconnecter
|
||
</button>
|
||
</form>
|
||
</footer>
|
||
</html>
|