Browse Source

Error Fix

master
Ivan 1 year ago
parent
commit
f030d3555c
8 changed files with 35 additions and 7 deletions
  1. BIN
      DiagramaER.png
  2. +4
    -0
      src/main/java/com/ims/rallyModels/controlador/MaquetaControlador.java
  3. +1
    -1
      src/main/java/com/ims/rallyModels/security/SecurityConfig.java
  4. +15
    -1
      src/main/resources/templates/public/editar_maqueta.html
  5. +11
    -0
      src/main/resources/templates/public/logout.html
  6. +2
    -2
      src/main/resources/templates/public/maqueta.html
  7. +2
    -3
      src/main/resources/templates/public/maqueta_detalle.html
  8. BIN
      workbench.mwb

BIN
DiagramaER.png View File

Before After
Width: 654  |  Height: 560  |  Size: 45 KiB

+ 4
- 0
src/main/java/com/ims/rallyModels/controlador/MaquetaControlador.java View File

@ -258,6 +258,10 @@ public class MaquetaControlador {
maquetaExistente.setIdMaqueta(maqueta.getIdMaqueta());
//System.out.println(maquetaExistente.getIdMaqueta()); == 4
maquetaExistente.setDescripcion(maqueta.getDescripcion());
maquetaExistente.setMarca(maqueta.getMarca());
maquetaExistente.setModelo(maqueta.getModelo());
maquetaExistente.setPiloto(maqueta.getPiloto());
maquetaExistente.setPrecio(maqueta.getPrecio());
maquetasServicio.actualizarMaqueta(maquetaExistente);
return "redirect:/public/maquetas";


+ 1
- 1
src/main/java/com/ims/rallyModels/security/SecurityConfig.java View File

@ -48,7 +48,7 @@ public class SecurityConfig {
.defaultSuccessUrl("/public/maquetas")
.permitAll()
.and()
.logout().logoutSuccessUrl("/login").permitAll();
.logout().logoutSuccessUrl("/").permitAll();
return http.build();
}

+ 15
- 1
src/main/resources/templates/public/editar_maqueta.html View File

@ -29,12 +29,26 @@
<div class="card-body">
<form th:action="@{/public/maquetas/{id}(id=${maqueta.idMaqueta})}" th:object="${maqueta}" method="post">
<input type="hidden" th:field="*{idMaqueta}" th:value="${maqueta.idMaqueta}"/>
<div class="form-group">
<label>Piloto: </label>
<input type="text" name="piloto" th:field="*{piloto}"
class="form-control" placeholder="Piloto: " required>
</div>
<div class="form-group">
<label>Marca del coche: </label>
<input type="text" name="marca" th:field="*{marca}"
class="form-control" placeholder="Marca coche: " required>
</div>
<div class="form-group">
<label>Marca del coche: </label>
<input type="text" name="modelo" th:field="*{modelo}"
class="form-control" placeholder="Modelo coche: " required>
</div>
<div class="form-group">
<label>Descripcion: </label>
<input type="text" name="descripcion" th:field="*{descripcion}"
class="form-control" placeholder="Descripción de la maqueta: " required>
</div>
<br/>
<div class="form-group">
<label>Precio: </label>
<input type="number" name="precio" th:field="*{precio}"


+ 11
- 0
src/main/resources/templates/public/logout.html View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p>Hasta Pronto!</p>
</body>
</html>

+ 2
- 2
src/main/resources/templates/public/maqueta.html View File

@ -24,7 +24,7 @@
<a class="nav-link" href="#">Control de maquetas</a>
</li>
<li class="nav-item">
<a th:href="@{/logout}" method="POST" id="logoutForm">Cerrar Sesion</a>
<a th:action="@{/logout}" method="POST" id="logoutForm">Cerrar Sesion</a>
</li>
</ul>
@ -62,7 +62,7 @@
<thead class="table-dark">
<tr>
<th>Descripcion</th>
<th>Piloto</th>
<th>Coche</th>
<th>Competicion</th>
<th>Precio</th>


+ 2
- 3
src/main/resources/templates/public/maqueta_detalle.html View File

@ -25,9 +25,8 @@
<p class="lead" th:text="${maqueta.descripcion}">Descripcion</p>
<div class="d-flex">
<input class="form-control text-center me-3" id="inputQuantity" type="num" value="1" style="max-width: 3rem" />
<button th:href="@{/public/carrito/add/{id}(id=${maqueta.idMaqueta})}" class="btn btn-outline-dark flex-shrink-0" type="button"><!-- OJO -->
<i class="bi-cart-fill me-1"></i>
Añadir al carrito
<button class="btn btn-outline-dark flex-shrink-0" type="button"><!-- OJO -->
<a th:href="@{/public/carrito/add/{id}(id=${maqueta.idMaqueta})}" class="bi-cart-fill me-1">Añadir al carrito</a>
</button>
</div>
</div>


BIN
workbench.mwb View File


Loading…
Cancel
Save