44 lines
1.7 KiB
HTML
44 lines
1.7 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="${actionsUrl.delete}" method="post" style="display:inline;">
|
||
|
|
<input type="hidden" th:name="id" th:value="${item.id}"/>
|
||
|
|
<button type="submit" th:title="Borrar" formaction="#"
|
||
|
|
onclick="if(confirm('¿Estás seguro de que deseas borrar este elemento?')) { this.form.action = this.form.getAttribute('th:action'); } else { return false; }">
|
||
|
|
🗑️
|
||
|
|
</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>
|