Files
ENI-enchere/src/main/resources/templates/admin.html

89 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html th:replace="~{modele-page :: layout('Panel administrateur',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css"> <!-- Ajoutez le lien vers votre fichier CSS si nécessaire -->
</head>
<body>
<div id="container-main">
<h2>Liste des catégories modifiées</h2>
<table>
<thead>
<tr>
<th>Nom</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr th:each="categorie : ${categories}">
<td>
<form th:action="@{/admin/update}" method="post">
<input type="text" name="newCategorie" id="newCategorie" th:value="${categorie.libelle}">
<input type="hidden" name="IdCategorie" id="IdCategorie" th:value="${categorie.id}">
<button>Sauvegarder</button>
</form>
</td>
<td>
<form th:action="@{/admin/deleteC}" method="post">
<input type="hidden" name="deleteIdCategorie" id="deleteIdCategorie" th:value="${categorie.id}">
<button>Supprimer</button>
</form>
</td>
</tr>
</tbody>
</table>
<form th:action="@{/admin/new}" th:object="${categorie}" method="post">
<input type="text" th:field="*{libelle}" id="nom">
<button>Ajouter</button>
</form>
<h2>Liste des utilisateurs</h2>
<table>
<thead>
<tr>
<th>ID</th>
<th>Pseudo</th>
<th>Nom</th>
<th>Prénom</th>
<th>Email</th>
<th>Crédit(s)</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr th:each="user : ${userProfil}">
<td th:text="${user.id}"></td>
<td th:text="${user.pseudo}"></td>
<td th:text="${user.nom}"></td>
<td th:text="${user.prenom}"></td>
<td th:text="${user.email}"></td>
<td>
<form th:action="@{/admin/update/credit}" method="post">
<input type="number" name="newCredit" id="newCredit" th:value="${user.credit}">
<input type="hidden" name="idUser" id="idUser" th:value="${user.id}">
<button>Sauvegarder</button>
</form>
</td>
<td>
<form th:action="@{/admin/disabled}" method="post">
<input type="hidden" name="userDisabled" id="userDisabled" th:value="${user.id}">
<input type="hidden" name="isDis" id="isDis" th:value="${user.isDisabled}">
<button th:text="${user.isDisabled} ? 'Activer' : 'Désactiver'"></button>
</form>
<form th:action="@{/admin/delete}" method="post">
<input type="hidden" name="userDelete" id="userDelete" th:value="${user.id}">
<button>Supprimer</button>
</form>
<form th:action="@{/admin/administrateur}" method="post">
<input type="hidden" name="userAdmin" id="userAdmin" th:value="${user.id}">
<input type="hidden" name="isAdmin" id="isAdmin" th:value="${user.admin}">
<button th:text="${user.admin} ? 'Retirer admin' : 'Ajouter admin'"></button>
</form>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>