Created
August 29, 2019 23:11
-
-
Save parzibyte/9c7689e03bc9accff6cd68c1e85fa82e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="es" xmlns:th="http://www.thymeleaf.org" | |
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | |
layout:decorate="master"> | |
<body> | |
<main layout:fragment="contenido"> | |
<div class="col-12"> | |
<h2>Agregar producto</h2> | |
<form th:object="${producto}" th:action="@{/productos/agregar}" method="post"> | |
<div class="form-group"> | |
<label for="nombre">Nombre del producto</label> | |
<input th:field="*{nombre}" id="nombre" placeholder="Escribe el nombre del producto" type="text" | |
class="form-control" th:classappend="${#fields.hasErrors('nombre')} ? 'is-invalid' : ''"> | |
<div class="invalid-feedback" th:errors="*{nombre}"></div> | |
</div> | |
<div class="form-group"> | |
<label for="codigo">Código de barras</label> | |
<input th:field="*{codigo}" id="codigo" placeholder="Escribe el código del producto" type="text" | |
class="form-control" th:classappend="${#fields.hasErrors('codigo')} ? 'is-invalid' : ''"> | |
<div class="invalid-feedback" th:errors="*{codigo}"></div> | |
</div> | |
<div class="form-group"> | |
<label for="existencia">Existencia actual</label> | |
<input th:field="*{existencia}" id="existencia" placeholder="Cantidad actual del producto" type="number" | |
class="form-control" th:classappend="${#fields.hasErrors('existencia')} ? 'is-invalid' : ''"> | |
<div class="invalid-feedback" th:errors="*{existencia}"></div> | |
</div> | |
<div class="form-group"> | |
<label for="existencia">Precio</label> | |
<input th:field="*{precio}" id="precio" placeholder="Precio del producto" type="number" | |
class="form-control" th:classappend="${#fields.hasErrors('precio')} ? 'is-invalid' : ''"> | |
<div class="invalid-feedback" th:errors="*{precio}"></div> | |
</div> | |
<button class="btn btn-success" type="submit">Guardar</button> | |
<a class="btn btn-warning" th:href="@{/productos/mostrar}">Ver todos</a> | |
</form> | |
</div> | |
</main> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment