Este commit está contenido en:
manalejandro
2018-11-24 19:24:46 +01:00
padre 503b18ad53
commit 169dd24f0e
Se han modificado 7 ficheros con 144 adiciones y 51 borrados

Ver fichero

@@ -2,7 +2,25 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<div th:replace="fragments/head :: head" />
<body>
<body class="container">
<h2 class="h1 text-center">Edit Item</h2>
<form th:action="@{/{id}/edit(id=${indexForm.id})}"
th:object="${indexForm}" method="post">
<div class="form-group">
<label for="nombre">Nombre:</label> <input type="text"
class="form-control" th:field="*{nombre}">
</div>
<div class="form-group">
<label for="apellido1">Primer Apellido:</label> <input type="text"
class="form-control" th:field="*{apellido1}">
</div>
<div class="form-group">
<label for="apellido2">Segundo Apellido:</label> <input type="text"
class="form-control" th:field="*{apellido2}">
</div>
<button type="submit" class="btn btn-primary">Enviar</button>
<button th:onclick="'window.location=\'' + @{/} + '\';return false;'"
class="btn btn-default">Volver</button>
</form>
</body>
</html>

Ver fichero

@@ -2,28 +2,33 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<div th:replace="fragments/head :: head" />
<body>
<div class="container">
<h2>Items</h2>
<p>Items in MongoDB CRUD</p>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>Nombre</th>
<th>Primer Apellido</th>
<th>Segundo Apellido</th>
<th>Opciones</th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${indexVO.listItem}">
<td>[[${item.nombre}]]</td>
<td>[[${item.apellido1}]]</td>
<td>[[${item.apellido2}]]</td>
<td><a th:href="@{/{id}/edit(id=${item.id})}">Editar</a></td>
</tr>
</tbody>
</table>
</div>
<body class="container">
<div>
<h2 class="h2">Items</h2>
<p>Items in MongoDB CRUD</p>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>Nombre</th>
<th>Primer Apellido</th>
<th>Segundo Apellido</th>
<th>Opciones</th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${indexVO.listItem}">
<td>[[${item.nombre}]]</td>
<td>[[${item.apellido1}]]</td>
<td>[[${item.apellido2}]]</td>
<td><button class="btn btn-info"
th:onclick="'window.location=\'' + @{/{id}/edit(id=${item.id})} + '\';'">Editar</button>
<button class="btn btn-danger"
th:onclick="'window.confirm(\'Va a elimitar el Item\') ? window.location=\'' + @{/{id}/delete(id=${item.id})} + '\' : false;'">Borrar</button></td>
</tr>
</tbody>
</table>
</div>
<button th:onclick="'window.location=\'' + @{/new} + '\';'"
class="btn btn-primary">Nuevo</button>
</body>
</html>

Ver fichero

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<div th:replace="fragments/head :: head" />
<body class="container">
<h2 class="h2 text-center">New Item</h2>
<form th:action="@{/new}" th:object="${indexForm}" method="post">
<div class="form-group">
<label for="nombre">Nombre:</label> <input type="text"
class="form-control" th:field="*{nombre}">
</div>
<div class="form-group">
<label for="apellido1">Primer Apellido:</label> <input type="text"
class="form-control" th:field="*{apellido1}">
</div>
<div class="form-group">
<label for="apellido2">Segundo Apellido:</label> <input type="text"
class="form-control" th:field="*{apellido2}">
</div>
<button type="submit" class="btn btn-primary">Enviar</button>
<button th:onclick="'window.location=\'' + @{/} + '\';return false;'"
class="btn btn-default">Volver</button>
</form>
</body>
</html>