FEAT : Ajout du mécanisme d'album avec partage et visibilité
This commit is contained in:
101
target/classes/templates/album-detail.html
Normal file
101
target/classes/templates/album-detail.html
Normal file
@@ -0,0 +1,101 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Détail album</title>
|
||||
</head>
|
||||
<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} + '/raw'}" 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/>
|
||||
<h3>Gestion des partages de l’album</h3>
|
||||
<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>
|
||||
</html>
|
||||
Reference in New Issue
Block a user