mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 15:55:49 +00:00
Arreglos de errores de vistas y creado el tag para contraseñas
This commit is contained in:
parent
6758905a86
commit
8374d8bd1f
6 changed files with 74 additions and 17 deletions
|
@ -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"/>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
28
src/main/webapp/WEB-INF/tags/dateField.tag
Normal file
28
src/main/webapp/WEB-INF/tags/dateField.tag
Normal 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>
|
|
@ -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>-->
|
||||
|
|
28
src/main/webapp/WEB-INF/tags/passwordField.tag
Normal file
28
src/main/webapp/WEB-INF/tags/passwordField.tag
Normal 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>
|
Loading…
Reference in a new issue