Gestion-inventario/src/main/resources/templates/list.html

43 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html lang="es" xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="${title}">Página Genérica</title>
<link rel="stylesheet" th:href="@{/css/table_style.css}">
</head>
<body>
<div class="contenido">
<h2 th:text="${title}"></h2>
<div class="table-container">
<table class="table1">
<thead>
<tr>
<th th:each="header : ${headers}" th:text="${header}"></th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${items}">
<td th:each="value : ${item.values}" th:text="${value}"></td>
<td class="celda-acciones">
<button th:if="${actionsUrl.edit}" th:href="${actionsUrl.edit} + '/' + ${item.id}" th:title="Editar">✏️</button>
<form th:if="${actionsUrl.delete}" th:action="@{/delete_user}" method="post" style="display:inline;">
<input type="hidden" name="id" th:value="${item.id}" />
<button type="submit" th:title="Borrar" onclick="return confirm('¿Estás seguro de que deseas borrar este elemento?');">
🗑️
</button>
</form>
</td>
</tr>
</tbody>
</table>
</div>
<div class="botones">
<a th:if="${backUrl}" th:href="${backUrl}">
<button class="button_salir">Volver</button>
</a>
<a th:if="${addUrl}" th:href="${addUrl}">
<button>Añadir</button>
</a>
</div>
</div>
</body>
</html>