CORRECTION BUG & AMELIORATION : Gestion de la visibilite et des partages de photos (ACL)
This commit is contained in:
@@ -31,21 +31,34 @@
|
||||
</ul>
|
||||
|
||||
<!-- Partage de la photo -->
|
||||
<h2>Partagée avec :</h2>
|
||||
<ul>
|
||||
<li th:each="p : ${partages}">
|
||||
<span th:text="${p.utilisateur.email}"></span>
|
||||
<span> - <b th:text="${p.permission}"></b></span>
|
||||
<!-- ADMIN OU PROPRIÉTAIRE : peut retirer -->
|
||||
<a th:if="${canAdmin}"
|
||||
th:href="@{'/photo/' + ${photo.id} + '/unshare/' + ${p.utilisateur.email}}"
|
||||
style="color:red; margin-left:10px;">Retirer</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Formulaire d’ajout visible uniquement en ADMIN ou PROPRIÉTAIRE -->
|
||||
<!-- Formulaire gestion visible uniquement en ADMIN ou PROPRIÉTAIRE -->
|
||||
<div th:if="${canAdmin}">
|
||||
<h2>Partagée avec :</h2>
|
||||
<ul>
|
||||
<li th:each="p : ${partages}">
|
||||
<span th:text="${p.utilisateur.email}"></span>
|
||||
<!-- Formulaire modification permission -->
|
||||
<form th:action="@{'/photo/' + ${photo.id} + '/share/update'}" method="post" style="display:inline;">
|
||||
<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'}">Administration</option>
|
||||
</select>
|
||||
<button type="submit">Modifier</button>
|
||||
</form>
|
||||
<!-- Unshare -->
|
||||
<a th:href="@{'/photo/' + ${photo.id} + '/unshare/' + ${p.utilisateur.email}}"
|
||||
style="color:red; margin-left:10px;">Retirer</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Partager la photo</h3>
|
||||
<div th:if="${param.error}" style="color:red; font-weight:bold;">
|
||||
<span th:text="${param.error}"></span>
|
||||
</div>
|
||||
<div th:if="${param.shared}" style="color:green; font-weight:bold;">
|
||||
Partage effectué avec succès !
|
||||
</div>
|
||||
<form th:action="@{'/photo/' + ${photo.id} + '/share'}" method="post">
|
||||
<label>Email de l'utilisateur :</label>
|
||||
<input type="email" name="email" required />
|
||||
|
||||
Reference in New Issue
Block a user