fix: only keep war not the all target directory
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -31,4 +31,9 @@ build/
|
|||||||
### VS Code ###
|
### VS Code ###
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
|
### Cause of password leaks ###
|
||||||
src/main/resources/application.properties
|
src/main/resources/application.properties
|
||||||
|
|
||||||
|
### only the WAR to deploy on VMs ###
|
||||||
|
!target/FotoSharing*.war
|
||||||
|
target/*
|
||||||
BIN
target/FotoSharing-0.0.1-SNAPSHOT.war
Normal file
BIN
target/FotoSharing-0.0.1-SNAPSHOT.war
Normal file
Binary file not shown.
BIN
target/FotoSharing-0.0.1-SNAPSHOT.war.original
Normal file
BIN
target/FotoSharing-0.0.1-SNAPSHOT.war.original
Normal file
Binary file not shown.
@@ -1,28 +0,0 @@
|
|||||||
spring.application.name=FotoSharing
|
|
||||||
spring.jmx.enabled=false
|
|
||||||
management.endpoints.jmx.exposure.exclude=*
|
|
||||||
|
|
||||||
|
|
||||||
# ===============================
|
|
||||||
# DATABASE
|
|
||||||
# ===============================
|
|
||||||
spring.datasource.url=jdbc:mariadb://192.168.112.10:3306/fotoshareDB
|
|
||||||
spring.datasource.username=ufoto
|
|
||||||
spring.datasource.password=4AinfoRep-25
|
|
||||||
# ===============================
|
|
||||||
# JPA / HIBERNATE
|
|
||||||
# ===============================
|
|
||||||
spring.jpa.hibernate.ddl-auto=update
|
|
||||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect
|
|
||||||
spring.jpa.show-sql=true
|
|
||||||
spring.jpa.properties.hibernate.format_sql=true
|
|
||||||
spring.thymeleaf.prefix=classpath:/templates/
|
|
||||||
spring.thymeleaf.suffix=.html
|
|
||||||
spring.thymeleaf.mode=HTML
|
|
||||||
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
|
|
||||||
# ===============================
|
|
||||||
# EMPLACEMENT DE STICKAGE
|
|
||||||
# ===============================
|
|
||||||
file.upload-dir=/opt/photo-app/uploads
|
|
||||||
spring.servlet.multipart.max-file-size=20MB
|
|
||||||
spring.servlet.multipart.max-request-size=20MB
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,117 +0,0 @@
|
|||||||
<!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>
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Galerie publique</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>
|
|
||||||
|
|
||||||
<h1>Galerie publique</h1>
|
|
||||||
|
|
||||||
<!-- Affichage des photos -->
|
|
||||||
<div>
|
|
||||||
<a th:each="p : ${photosPage.content}"
|
|
||||||
th:href="@{'/photo/' + ${p.id}}"
|
|
||||||
style="display:inline-block; margin:10px;">
|
|
||||||
<img th:src="@{'/photo/' + ${p.id} + '/thumb'}"
|
|
||||||
width="150"
|
|
||||||
style="border:1px solid #ccc;"/>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Pagination -->
|
|
||||||
<div style="margin-top:20px;">
|
|
||||||
|
|
||||||
<a th:if="${currentPage > 0}"
|
|
||||||
th:href="@{/galerie(page=${currentPage - 1})}">
|
|
||||||
⬅ Précédent
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<span th:text="'Page ' + (${currentPage} + 1)"></span>
|
|
||||||
|
|
||||||
<a th:if="${photosPage.hasNext()}"
|
|
||||||
th:href="@{/galerie(page=${currentPage + 1})}">
|
|
||||||
Suivant ➡
|
|
||||||
</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>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Accueil</title></head>
|
|
||||||
<body>
|
|
||||||
<h1>Bienvenue sur FotoSharing<span th:if="${prenom}" th:text="' : ' + ${prenom}"></span></h1>
|
|
||||||
<p><a th:href="@{/upload}">Uploader une photo</a></p>
|
|
||||||
<p><a th:href="@{/mes-photos}">Voir mes photos</a></p>
|
|
||||||
<p><a th:href="@{/mes-albums}">Voir mes albums</a></p>
|
|
||||||
<p><a th:href="@{/galerie}">Voir la galerie publique</a></p>
|
|
||||||
</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>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>FotoSharing Title!</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>FotoSharing Title!</h1>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Login - FotoSharing</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Connexion</h1>
|
|
||||||
<form th:action="@{/login}" method="post">
|
|
||||||
<label>Email: <input type="text" name="username"/></label><br/>
|
|
||||||
<label>Mot de passe: <input type="password" name="password"/></label><br/>
|
|
||||||
<button type="submit">Se connecter</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div th:if="${param.logout}">
|
|
||||||
Déconnecté avec succès.
|
|
||||||
</div>
|
|
||||||
<div th:if="${param.error}">
|
|
||||||
Erreur d'authentification.
|
|
||||||
</div>
|
|
||||||
<p><a th:href="@{/register}">Créer un compte</a></p>
|
|
||||||
<p><a th:href="@{/galerie}">Galerie publique</a></p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Mes albums</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>
|
|
||||||
|
|
||||||
<h1>Mes albums</h1>
|
|
||||||
|
|
||||||
<!-- FORMULAIRE AJOUT ALBUM -->
|
|
||||||
<h2>Créer un album</h2>
|
|
||||||
<form th:action="@{/albums/create}" method="post">
|
|
||||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
|
||||||
<label>Nom :</label>
|
|
||||||
<input type="text" name="nom" required><br/>
|
|
||||||
<label>Description :</label>
|
|
||||||
<input type="text" name="description"><br/>
|
|
||||||
<label>Visibilité :</label>
|
|
||||||
<select name="visibilite">
|
|
||||||
<option value="PRIVATE">Privé</option>
|
|
||||||
<option value="SHARED">Partagé</option>
|
|
||||||
<option value="PUBLIC">Public</option>
|
|
||||||
</select>
|
|
||||||
<button type="submit">Créer</button>
|
|
||||||
</form>
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<!-- LISTE ALBUMS -->
|
|
||||||
<h2>Liste de mes albums</h2>
|
|
||||||
<div th:each="album : ${albums.content}" style="margin:10px 0;">
|
|
||||||
<a th:href="@{'/album/' + ${album.id}}">
|
|
||||||
<b th:text="${album.nom}"></b>
|
|
||||||
</a>
|
|
||||||
<span th:text="'(' + ${album.visibilite} + ')'"></span>
|
|
||||||
<p th:text="${album.description}"></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- PAGINATION -->
|
|
||||||
<div>
|
|
||||||
<a th:if="${albums.hasPrevious()}"
|
|
||||||
th:href="@{/mes-albums(page=${currentPage - 1})}">⬅</a>
|
|
||||||
<span th:text="${currentPage + 1}"></span>
|
|
||||||
<a th:if="${albums.hasNext()}"
|
|
||||||
th:href="@{/mes-albums(page=${currentPage + 1})}">➡</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<h2>Albums partagés avec moi</h2>
|
|
||||||
<div th:if="${sharedAlbums.isEmpty()}">
|
|
||||||
<p>Aucun album ne vous a été partagé.</p>
|
|
||||||
</div>
|
|
||||||
<div th:unless="${sharedAlbums.isEmpty()}">
|
|
||||||
<div class="album-list">
|
|
||||||
<div th:each="album : ${sharedAlbums}" class="album-item">
|
|
||||||
<a th:href="@{'/album/' + ${album.id}}">
|
|
||||||
<strong th:text="${album.nom}"></strong>
|
|
||||||
</a>
|
|
||||||
<p>
|
|
||||||
Partagé par :
|
|
||||||
<span th:text="${album.proprietaire.email}"></span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</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>
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Mes photos</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>
|
|
||||||
<h1>Mes photos</h1>
|
|
||||||
<h2>Mes photos privées</h2>
|
|
||||||
<div>
|
|
||||||
<a th:each="p : ${photosPrivees.content}" th:if="${p != null}"
|
|
||||||
th:href="@{'/photo/' + ${p.id}}">
|
|
||||||
<img th:src="@{'/photo/' + ${p.id} + '/thumb'}" width="120"/>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a th:if="${photosPrivees.hasPrevious()}"
|
|
||||||
th:href="@{/mes-photos(pagePrivees=${pagePrivees - 1}, pagePubliques=${pagePubliques}, pagePartagees=${pagePartagees})}">⬅</a>
|
|
||||||
<span th:text="'Page ' + (${pagePrivees}+1)"></span>
|
|
||||||
<a th:if="${photosPrivees.hasNext()}"
|
|
||||||
th:href="@{/mes-photos(pagePrivees=${pagePrivees + 1}, pagePubliques=${pagePubliques}, pagePartagees=${pagePartagees})}">➡</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Mes photos publiques</h2>
|
|
||||||
<div>
|
|
||||||
<a th:each="p : ${photosPubliques.content}" th:if="${p != null}"
|
|
||||||
th:href="@{'/photo/' + ${p.id}}">
|
|
||||||
<img th:src="@{'/photo/' + ${p.id} + '/thumb'}" width="120"/>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a th:if="${photosPubliques.hasPrevious()}"
|
|
||||||
th:href="@{/mes-photos(pagePrivees=${pagePrivees}, pagePubliques=${pagePubliques - 1}, pagePartagees=${pagePartagees})}">⬅</a>
|
|
||||||
<span th:text="'Page ' + (${pagePubliques}+1)"></span>
|
|
||||||
<a th:if="${photosPubliques.hasNext()}"
|
|
||||||
th:href="@{/mes-photos(pagePrivees=${pagePrivees}, pagePubliques=${pagePubliques + 1}, pagePartagees=${pagePartagees})}">➡</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2>Mes photos partagées</h2>
|
|
||||||
<div style="display:flex; gap:20px; flex-wrap:wrap;">
|
|
||||||
<div th:each="p : ${mesPhotosPartagees.content}" th:if="${p != null}">
|
|
||||||
<a th:href="@{'/photo/' + ${p.id}}">
|
|
||||||
<img th:src="@{'/photo/' + ${p.id} + '/thumb'}" width="120"
|
|
||||||
style="display:block; border:1px solid #ccc;"/>
|
|
||||||
</a>
|
|
||||||
<!--compteur de partages -->
|
|
||||||
<div style="font-size:0.9em; color:#555; margin-top:4px;">
|
|
||||||
<span th:text="${shareCounts[p.id]} + ' partage(s)'"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a th:if="${mesPhotosPartagees.hasPrevious()}"
|
|
||||||
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(
|
|
||||||
pagePrivees=${pagePrivees},
|
|
||||||
pagePubliques=${pagePubliques},
|
|
||||||
pagePartagees=${pagePartagees},
|
|
||||||
pageMesPartagees=${pageMesPartagees + 1}
|
|
||||||
)}">➡</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Photos partagées avec moi</h2>
|
|
||||||
<div>
|
|
||||||
<a th:each="p : ${photosPartagees.content}"
|
|
||||||
th:if="${p != null}"
|
|
||||||
th:href="@{'/photo/' + ${p.id}}">
|
|
||||||
<img th:src="@{'/photo/' + ${p.id} + '/thumb'}" width="120"/>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a th:if="${photosPartagees.hasPrevious()}"
|
|
||||||
th:href="@{/mes-photos(pagePrivees=${pagePrivees}, pagePubliques=${pagePubliques}, pagePartagees=${pagePartagees - 1})}">⬅</a>
|
|
||||||
<span th:text="'Page ' + (${pagePartagees}+1)"></span>
|
|
||||||
<a th:if="${photosPartagees.hasNext()}"
|
|
||||||
th:href="@{/mes-photos(pagePrivees=${pagePrivees}, pagePubliques=${pagePubliques}, pagePartagees=${pagePartagees + 1})}">➡</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<p><a th:href="@{/galerie}">Galerie publique</a></p>
|
|
||||||
</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>
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Détail de la photo</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>
|
|
||||||
|
|
||||||
<h1>Détail de la photo</h1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 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>Votre rôle :</strong><span
|
|
||||||
th:text="${photo.proprietaire.email == currentUser ? 'Propriétaire' : (canAdmin ? 'Admin' : (canComment ? 'Commentateur' : 'Lecteur'))}"></span>
|
|
||||||
</li>
|
|
||||||
<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>
|
|
||||||
<!-- Suppression de la photo par le propriétaire -->
|
|
||||||
<div th:if="${isOwner}">
|
|
||||||
<form th:action="@{'/photo/' + ${photo.id} + '/delete'}" method="post"
|
|
||||||
onsubmit="return confirm('Supprimer définitivement cette photo ?');">
|
|
||||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
|
||||||
<button type="submit" style="color:red; margin-bottom:20px;">
|
|
||||||
Supprimer la photo
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Partage de la photo -->
|
|
||||||
<!-- 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/>
|
|
||||||
<label>Permission :</label>
|
|
||||||
<select name="permission">
|
|
||||||
<option value="READ">Lecture seule</option>
|
|
||||||
<option value="COMMENT">Commentaire autorisé</option>
|
|
||||||
<option value="ADMIN">Administrateur</option>
|
|
||||||
</select>
|
|
||||||
<button type="submit">Partager</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div th:if="${!canAdmin}">
|
|
||||||
<em>Vous n’avez pas les droits de gestion du partage.</em>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Commentaires -->
|
|
||||||
<h2>Commentaires</h2>
|
|
||||||
<div th:each="c : ${commentairesPage.content}">
|
|
||||||
<p>
|
|
||||||
<b th:text="${c.auteur.email}"></b>
|
|
||||||
<span th:text="${c.contenu}"></span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a th:if="${commentairesPage.hasPrevious()}"
|
|
||||||
th:href="@{/photo/{id}(id=${photo.id}, page=${currentPage - 1})}">⬅</a>
|
|
||||||
<span th:text="'Page ' + (${currentPage}+1)"></span>
|
|
||||||
<a th:if="${commentairesPage.hasNext()}"
|
|
||||||
th:href="@{/photo/{id}(id=${photo.id}, page=${currentPage + 1})}">➡</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Formulaire d'ajout de commentaire -->
|
|
||||||
<!-- Si pas connecté -->
|
|
||||||
<div th:if="${currentUser == null}">
|
|
||||||
<p><a th:href="@{/login}">Connectez-vous</a> pour commenter.</p>
|
|
||||||
</div>
|
|
||||||
<!-- Si connecté mais pas autorisé -->
|
|
||||||
<div th:if="${currentUser != null and !canComment}">
|
|
||||||
<em>Vous pouvez consulter cette photo, mais pas commenter.</em>
|
|
||||||
</div>
|
|
||||||
<!-- Si COMMENT ou ADMIN ou PROPRIÉTAIRE -->
|
|
||||||
<div th:if="${canComment}">
|
|
||||||
<h3>Ajouter un commentaire</h3>
|
|
||||||
<form th:action="@{'/photo/' + ${photo.id} + '/comment'}" method="post">
|
|
||||||
<textarea name="contenu" rows="3" cols="50" required></textarea><br/>
|
|
||||||
<button type="submit">Envoyer</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<a th:href="@{'/photo/' + ${photo.id} + '/raw'}" target="_blank">Voir en grande taille</a>
|
|
||||||
</p>
|
|
||||||
</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>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Inscription - FotoSharing</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Inscription</h1>
|
|
||||||
<form th:action="@{/register}" th:object="${utilisateur}" method="post">
|
|
||||||
<label>Email: <input th:field="*{email}" /></label><br/>
|
|
||||||
<label>Nom: <input th:field="*{nom}" /></label><br/>
|
|
||||||
<label>Prénom: <input th:field="*{prenom}" /></label><br/>
|
|
||||||
<label>Mot de passe: <input th:field="*{motDePasse}" type="password"/></label><br/>
|
|
||||||
<button type="submit">Créer</button>
|
|
||||||
</form>
|
|
||||||
<p><a th:href="@{/galerie}">Galerie publique</a></p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Upload - FotoSharing</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>
|
|
||||||
<h1>Uploader une photo</h1>
|
|
||||||
<form th:action="@{/upload}" method="post" enctype="multipart/form-data">
|
|
||||||
<input type="file" name="file"/><br/>
|
|
||||||
<label>Visibilité:
|
|
||||||
<select name="visibilite">
|
|
||||||
<option value="PRIVATE">Privée</option>
|
|
||||||
<option value="PUBLIC">Publique</option>
|
|
||||||
<option value="SHARED">Partagée</option>
|
|
||||||
</select>
|
|
||||||
</label><br/>
|
|
||||||
<button type="submit">Envoyer</button>
|
|
||||||
</form>
|
|
||||||
<div th:if="${error}" th:text="${error}"></div>
|
|
||||||
<div th:if="${message}" th:text="${message}"></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>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
local/epul4a/fotosharing/service/PhotoService.class
|
|
||||||
local/epul4a/fotosharing/model/Partage.class
|
|
||||||
local/epul4a/fotosharing/security/SecurityConfig.class
|
|
||||||
local/epul4a/fotosharing/repository/PartageRepository.class
|
|
||||||
local/epul4a/fotosharing/controller/PhotoController.class
|
|
||||||
local/epul4a/fotosharing/security/CustomUserDetails.class
|
|
||||||
local/epul4a/fotosharing/service/CommentaireService.class
|
|
||||||
local/epul4a/fotosharing/repository/UtilisateurRepository.class
|
|
||||||
local/epul4a/fotosharing/repository/CommentaireRepository.class
|
|
||||||
local/epul4a/fotosharing/security/SecurityService.class
|
|
||||||
local/epul4a/fotosharing/FotoSharingApplication.class
|
|
||||||
local/epul4a/fotosharing/model/Photo.class
|
|
||||||
local/epul4a/fotosharing/controller/AuthController.class
|
|
||||||
local/epul4a/fotosharing/service/impl/CommentaireServiceImpl.class
|
|
||||||
local/epul4a/fotosharing/repository/PhotoRepository.class
|
|
||||||
local/epul4a/fotosharing/model/Commentaire.class
|
|
||||||
local/epul4a/fotosharing/model/Photo$Visibilite.class
|
|
||||||
local/epul4a/fotosharing/model/Utilisateur.class
|
|
||||||
local/epul4a/fotosharing/service/impl/PhotoServiceImpl.class
|
|
||||||
local/epul4a/fotosharing/security/CustomUserDetailsService.class
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/FotoSharingApplication.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/controller/AuthController.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/controller/PhotoController.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/model/Commentaire.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/model/Partage.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/model/Photo.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/model/Utilisateur.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/repository/CommentaireRepository.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/repository/PartageRepository.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/repository/PhotoRepository.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/repository/UtilisateurRepository.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/security/CustomUserDetails.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/security/CustomUserDetailsService.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/security/SecurityConfig.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/security/SecurityService.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/service/CommentaireService.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/service/PhotoService.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/service/impl/CommentaireServiceImpl.java
|
|
||||||
/home/gtrnet/FotoSharing/src/main/java/local/epul4a/fotosharing/service/impl/PhotoServiceImpl.java
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
local/epul4a/fotosharing/FotoSharingApplicationTests.class
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/home/gtrnet/FotoSharing/src/test/java/local/epul4a/fotosharing/FotoSharingApplicationTests.java
|
|
||||||
Binary file not shown.
Reference in New Issue
Block a user