mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 15:55:49 +00:00
Merge pull request #52 from cheapy-ispp/hotfix-reviews
Develop funcional
This commit is contained in:
commit
e82006d71c
13 changed files with 113 additions and 47 deletions
|
@ -76,7 +76,7 @@ public class ReviewController {
|
|||
Review review = this.reviewService.findReviewById(reviewId);
|
||||
|
||||
model.put("review", review);
|
||||
|
||||
|
||||
|
||||
return "reviews/reviewsShow";
|
||||
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
|
||||
<cheapy:layout pageName="error">
|
||||
|
||||
<h2 style="text-align:center">Algo malo ha pasado...</h2>
|
||||
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>Algo malo ha pasado...</em></h2>
|
||||
|
||||
<spring:url value="/resources/images/Logo Cheapy.png" htmlEscape="true" var="cheapyImage"/>
|
||||
<img class="img-responsive" src="${cheapyImage}"/>
|
||||
|
|
|
@ -282,26 +282,24 @@
|
|||
<div class="fadeIn first">
|
||||
<img src="/resources/images/Logo Cheapy.png" id="icon" />
|
||||
<c:if test= "${not empty param}" >
|
||||
<p class="text-danger"> El usuario y/o la contraseña son incorrectos </p>
|
||||
<p class="text-danger"> El usuario y/o la contraseña son incorrectos </p>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
<div th:if="${param.error}">
|
||||
<p class="text-danger">Nombre de usuario o contraseña inválido</p>
|
||||
</div>
|
||||
|
||||
<!-- Login Form -->
|
||||
<form class='form-signin' action="/login" method='POST'>
|
||||
<input type="text" id="username" class="fadeIn second" name="username" placeholder="nombre de usuario" required autofocus>
|
||||
<input type="password" id="password" class="fadeIn third" name="password" placeholder="contraseña" required>
|
||||
<input type="text" id="username" class="fadeIn second" name="username" placeholder="Usuario" required autofocus>
|
||||
<input type="password" id="password" class="fadeIn third" name="password" placeholder="Contraseña" required>
|
||||
<sec:csrfInput />
|
||||
<input type="submit" class="fadeIn fourth" value="Acceder">
|
||||
<input type="submit" class="fadeIn fourth" value="Iniciar sesión">
|
||||
</form>
|
||||
|
||||
<!-- Remind Passowrd
|
||||
<!-- Remind Passowrd
|
||||
<div id="formFooter">
|
||||
<a class="underlineHover" href="#">¿Olvidó su contraseña?</a>
|
||||
<a class="underlineHover" href="#">¿Olvidó su contraseña?</a>
|
||||
</div>
|
||||
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,21 +4,34 @@
|
|||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<cheapy:layout pageName="foodOffer">
|
||||
|
||||
<jsp:body>
|
||||
<h2> ¿Está seguro de que quiere eliminar su oferta? </h2>
|
||||
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
|
||||
|
||||
<form:form modelAttribute="foodOffer" class="form-horizontal">
|
||||
|
||||
<input type="hidden" name="food" value="${foodOffer.food}" />
|
||||
<input type="hidden" name="discount" value="${foodOffer.discount}" />
|
||||
|
||||
<button class="btn btn-default" type="submit">Eliminar Oferta</button>
|
||||
<div class="btns-edit">
|
||||
<button type="submit" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Dar de baja</button>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
<a class="btn btn-default" href='<spring:url value="/offers" htmlEscape="true"/>'>Volver</a>
|
||||
|
||||
<div class="btn-return">
|
||||
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
|
||||
<fmt:message key="return"/> </button>
|
||||
</div>
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
}
|
||||
</script>
|
||||
</jsp:body>
|
||||
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Editar oferta</button>
|
||||
|
||||
<c:if test="${foodOffer.status eq 'inactive' }">
|
||||
<c:if test="${foodOffer.status eq 'hidden' }">
|
||||
<spring:url value="{foodOfferId}/activate" var="activateUrl">
|
||||
<spring:param name="foodOfferId" value="${foodOffer.id}"/>
|
||||
</spring:url>
|
||||
|
@ -72,9 +72,8 @@
|
|||
Desactivar oferta</button>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
</sec:authorize>
|
||||
</div>
|
||||
</sec:authorize>
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<cheapy:inputField label="Fecha de Inicio" placeholder="dd/MM/yyyy HH:mm" name="start"/>
|
||||
<cheapy:inputField label="Fecha de Fin" placeholder="dd/MM/yyyy HH:mm" name="end"/>
|
||||
|
||||
<cheapy:inputField label="Número de comensales (nivel Oro)" placeholder="XX (Ej. 6)" name="gold"/>
|
||||
<cheapy:inputField label="Número de comensales (nivel Oro)" placeholder="XX (Ej. 6)" name="gold"/>
|
||||
<cheapy:inputField label="Descuento de nivel oro" placeholder="XX% (Ej. 30)" name="discountGold"/>
|
||||
<cheapy:inputField label="Número de comensales (nivel Plata)" placeholder="XX (Ej. 4)" name="silver"/>
|
||||
<cheapy:inputField label="Número de comensales (nivel Plata)" placeholder="XX (Ej. 4)" name="silver"/>
|
||||
<cheapy:inputField label="Descuento de plata" placeholder="XX% (Ej. 15)" name="discountSilver"/>
|
||||
<cheapy:inputField label="Número de comensales (nivel Bronce)" placeholder="XX (Ej. 2)" name="bronze"/>
|
||||
<cheapy:inputField label="Número de comensales (nivel Bronce)" placeholder="XX (Ej. 2)" name="bronze"/>
|
||||
<cheapy:inputField label="Descuento de bronce" placeholder="XX% (Ej. 5)" name="discountBronze"/>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<petclinic:layout pageName="nuOfferDisable">
|
||||
<cheapy:layout pageName="nuOfferDisable">
|
||||
|
||||
<jsp:body>
|
||||
<h2> ¿Está seguro de que quiere dar de baja su offer? </h2>
|
||||
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
|
||||
|
||||
<form:form modelAttribute="nuOffer" class="form-horizontal">
|
||||
<input type="hidden" name="gold" value="${nuOffer.gold}" />
|
||||
|
@ -18,10 +19,23 @@
|
|||
<input type="hidden" name="bronze" value="${nuOffer.bronze}" />
|
||||
<input type="hidden" name="discountBronze" value="${nuOffer.discountBronze}" />
|
||||
|
||||
<button class="btn btn-default" type="submit">Dar de baja</button>
|
||||
<div class="btns-edit">
|
||||
<button type="submit" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Dar de baja</button>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
<a class="btn btn-default" href='<spring:url value="/offers" htmlEscape="true"/>'>Volver</a>
|
||||
<div class="btn-return">
|
||||
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
|
||||
<fmt:message key="return"/> </button>
|
||||
</div>
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
}
|
||||
</script>
|
||||
|
||||
</jsp:body>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Editar oferta</button>
|
||||
<c:if test="${nuOffer.status eq 'inactive' }">
|
||||
<c:if test="${nuOffer.status eq 'hidden' }">
|
||||
<spring:url value="{nuOfferId}/activate" var="activateUrl">
|
||||
<spring:param name="nuOfferId" value="${nuOffer.id}"/>
|
||||
</spring:url>
|
||||
|
@ -84,8 +84,8 @@
|
|||
Desactivar oferta</button>
|
||||
</c:if>
|
||||
</div>
|
||||
</sec:authorize>
|
||||
</div>
|
||||
</sec:authorize>
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<cheapy:layout pageName="speedOffer">
|
||||
|
||||
<jsp:body>
|
||||
<h2> <20>Est<73> seguro de que quiere dar de baja su oferta? </h2>
|
||||
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
|
||||
|
||||
<form:form modelAttribute="speedOffer" class="form-horizontal">
|
||||
|
||||
|
@ -19,10 +20,23 @@
|
|||
<input type="hidden" name="bronze" value="${speedOffer.bronze}" />
|
||||
<input type="hidden" name="discountBronze" value="${speedOffer.discountBronze}" />
|
||||
|
||||
<button class="btn btn-default" type="submit">Dar de baja</button>
|
||||
<div class="btns-edit">
|
||||
<button type="submit" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Dar de baja</button>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
<a class="btn btn-default" href='<spring:url value="/offers" htmlEscape="true"/>'>Volver</a>
|
||||
<div class="btn-return">
|
||||
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
|
||||
<fmt:message key="return"/> </button>
|
||||
</div>
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
}
|
||||
</script>
|
||||
|
||||
</jsp:body>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Editar oferta</button>
|
||||
|
||||
<c:if test="${speedOffer.status eq 'inactive' }">
|
||||
<c:if test="${speedOffer.status eq 'hidden' }">
|
||||
<spring:url value="{speedOfferId}/activate" var="activateUrl">
|
||||
<spring:param name="speedOfferId" value="${speedOffer.id}"/>
|
||||
</spring:url>
|
||||
|
@ -85,8 +85,9 @@
|
|||
Desactivar oferta</button>
|
||||
</c:if>
|
||||
</div>
|
||||
</sec:authorize>
|
||||
</div>
|
||||
</sec:authorize>
|
||||
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
|
|
|
@ -4,21 +4,35 @@
|
|||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<petclinic:layout pageName="timeOffer">
|
||||
<cheapy:layout pageName="timeOffer">
|
||||
|
||||
<jsp:body>
|
||||
<h2> <20>Est<73> seguro de que quiere eliminar su oferta? </h2>
|
||||
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
|
||||
|
||||
<form:form modelAttribute="timeOffer" class="form-horizontal">
|
||||
<input type="hidden" name="init" value="${timeOffer.init}" />
|
||||
<input type="hidden" name="finish" value="${timeOffer.finish}" />
|
||||
<input type="hidden" name="discount" value="${timeOffer.discount}" />
|
||||
|
||||
<button class="btn btn-default" type="submit">Eliminar Oferta</button>
|
||||
<div class="btns-edit">
|
||||
<button type="submit" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Dar de baja</button>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
<a class="btn btn-default" href='<spring:url value="/offers" htmlEscape="true"/>'>Volver</a>
|
||||
<div class="btn-return">
|
||||
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
|
||||
<fmt:message key="return"/> </button>
|
||||
</div>
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
}
|
||||
</script>
|
||||
|
||||
</jsp:body>
|
||||
</cheapy:layout>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Editar oferta</button>
|
||||
|
||||
<c:if test="${timeOffer.status eq 'inactive' }">
|
||||
<c:if test="${timeOffer.status eq 'hidden' }">
|
||||
<spring:url value="{timeOfferId}/activate" var="activateUrl">
|
||||
<spring:param name="timeOfferId" value="${timeOffer.id}"/>
|
||||
</spring:url>
|
||||
|
@ -75,8 +75,9 @@
|
|||
</c:if>
|
||||
|
||||
</div>
|
||||
</sec:authorize>
|
||||
</div>
|
||||
</sec:authorize>
|
||||
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
|
||||
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
|
||||
|
||||
<cheapy:layout pageName="review">
|
||||
|
@ -24,15 +25,27 @@
|
|||
</table>
|
||||
|
||||
<div class="btn-return">
|
||||
<button type="button" role="link" onclick="window.location='/reviews'" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
|
||||
<fmt:message key="return"/> </button>
|
||||
</div>
|
||||
|
||||
<spring:url value="{reviewId}/edit" var="editUrl">
|
||||
<spring:param name="reviewId" value="${review.id}"/>
|
||||
</spring:url>
|
||||
<a href="${fn:escapeXml(editUrl)}" class="btn btn-default">Editar opinión</a>
|
||||
|
||||
<sec:authentication var="principal" property="principal" />
|
||||
<div class="btns-edit">
|
||||
<c:if test="${ principal.username eq review.escritor.username }">
|
||||
<spring:url value="{reviewId}/edit" var="editUrl">
|
||||
<spring:param name="reviewId" value="${review.id}"/>
|
||||
</spring:url>
|
||||
|
||||
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
|
||||
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
|
||||
Editar opinión</button>
|
||||
</c:if>
|
||||
</div>
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back()
|
||||
}
|
||||
</script>
|
||||
|
||||
</cheapy:layout>
|
||||
|
|
Loading…
Reference in a new issue