Arreglos de errores de vistas y creado el tag para contraseñas

This commit is contained in:
David 2021-04-12 13:25:54 +02:00
parent 6758905a86
commit 8374d8bd1f
6 changed files with 74 additions and 17 deletions

View file

@ -16,7 +16,7 @@
<div class="form-group has-feedback">
<form:hidden path="code"/>
<cheapy:inputField label="Contraseña" placeholder="Restaurante pepito" name="usuar.password"/>
<cheapy:passwordField label="Contraseña" placeholder="Restaurante pepito" name="usuar.password"/>
<cheapy:inputField label="Hora de inicio" placeholder="HH:mm" name="init"/>

View file

@ -20,7 +20,7 @@
<cheapy:inputField label="Direccion" name="direccion"/>
<cheapy:inputField label="Telefono" name="telefono"/>
<cheapy:inputField label="Email" name="email"/>
<cheapy:inputField label="Password" name="usuar.password"/>
<cheapy:passwordField label="Password" name="usuar.password"/>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">

View file

@ -34,23 +34,11 @@
<span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="createOffers"/> </button>
</div>
<div class="btn-home">
<button type="button" role="link" onclick="window.location='/clients/show'" style="font-family: 'Lobster'; font-size: 20px;margin:5px;" class="btn-block">
<span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="clientShow"/> </button>
</div>
</sec:authorize>
</div>
<sec:authorize access="hasAnyAuthority('usuario')">
<div class="btn-home-max">
<div class="btn-home">
<button type="button" role="link" onclick="window.location='/usuarios/show'" style="font-family: 'Lobster'; font-size: 20px;margin:5px;">
<span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="showUsuario"/> </button>
</div>
</div>
</sec:authorize>
</div>
</div>

View file

@ -0,0 +1,28 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ attribute name="name" required="true" rtexprvalue="true"
description="Name of corresponding property in bean object" %>
<%@ attribute name="label" required="true" rtexprvalue="true"
description="Label appears in red color if input is considered as invalid after submission" %>
<%@ attribute name="placeholder" required="false" rtexprvalue="true"
description="Placeholder para los campos en los input fields" %>
<spring:bind path="${name}">
<c:set var="cssGroup" value="form-group ${status.error ? 'has-error' : '' }"/>
<c:set var="valid" value="${not status.error and not empty status.actualValue}"/>
<div class="${cssGroup}">
<label class="col-sm-2 control-label">${label}</label>
<div class="col-sm-10">
<form:input type="datetime-local" class="form-control" path="${name}"/>
<c:if test="${valid}">
<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
</c:if>
<c:if test="${status.error}">
<span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
<span class="help-inline">${status.errorMessage}</span>
</c:if>
</div>
</div>
</spring:bind>

View file

@ -71,8 +71,21 @@
</cheapy:menuItem>
</sec:authorize>
</ul>
<ul class="nav navbar-nav navbar-right">
<sec:authorize access="hasAnyAuthority('client')">
<cheapy:menuItem active="${name eq 'miPerfil'}" url="/clients/show" title="miPerfil">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
<span>Mi perfil</span>
</cheapy:menuItem>
</sec:authorize>
<sec:authorize access="hasAnyAuthority('usuario')">
<cheapy:menuItem active="${name eq 'miPerfil'}" url="/usuarios/show" title="miPerfil">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
<span>Mi perfil</span>
</cheapy:menuItem>
</sec:authorize>
<sec:authorize access="!isAuthenticated()">
<li><a href="<c:url value="/login" />">Iniciar sesión</a></li>
<!--<li><a href="<c:url value="/users/new" />">Register</a></li>-->

View file

@ -0,0 +1,28 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ attribute name="name" required="true" rtexprvalue="true"
description="Name of corresponding property in bean object" %>
<%@ attribute name="label" required="true" rtexprvalue="true"
description="Label appears in red color if input is considered as invalid after submission" %>
<%@ attribute name="placeholder" required="false" rtexprvalue="true"
description="Placeholder para los campos en los input fields" %>
<spring:bind path="${name}">
<c:set var="cssGroup" value="form-group ${status.error ? 'has-error' : '' }"/>
<c:set var="valid" value="${not status.error and not empty status.actualValue}"/>
<div class="${cssGroup}">
<label class="col-sm-2 control-label">${label}</label>
<div class="col-sm-10">
<form:input type="password" class="form-control" placeholder="${placeholder }" path="${name}"/>
<c:if test="${valid}">
<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
</c:if>
<c:if test="${status.error}">
<span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
<span class="help-inline">${status.errorMessage}</span>
</c:if>
</div>
</div>
</spring:bind>