Merge pull request #49 from cheapy-ispp/009-cambiarVistas

Arreglos del merge más cambios a las nuevas vistas
This commit is contained in:
davsotpon 2021-04-02 16:28:38 +02:00 committed by GitHub
commit 76c7577429
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 160 additions and 97 deletions

View file

@ -44,12 +44,12 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.antMatchers("/owners/**").hasAnyAuthority("owner", "admin") .antMatchers("/owners/**").hasAnyAuthority("owner", "admin")
.antMatchers("/offers/**/edit").hasAnyAuthority("admin", "client")
.antMatchers("/offers/**/new").hasAnyAuthority("admin", "client") .antMatchers("/offers/**/new").hasAnyAuthority("admin", "client")
.antMatchers("/offers/**/activate").hasAnyAuthority("admin","client") .antMatchers("/offers/**/activate").hasAnyAuthority("admin","client")
.antMatchers("/clients/new").permitAll() .antMatchers("/clients/new").permitAll()
.antMatchers("/offers/**").permitAll() .antMatchers("/offers").permitAll()
.antMatchers("/offersCreate").hasAuthority("client") .antMatchers("/offersCreate").hasAuthority("client")

View file

@ -109,7 +109,7 @@ public class FoodOfferController {
FoodOffer foodOffer = this.foodOfferService.findFoodOfferById(foodOfferId); FoodOffer foodOffer = this.foodOfferService.findFoodOfferById(foodOfferId);
model.put("foodOffer", foodOffer); model.put("foodOffer", foodOffer);
return "foodOffers/foodOffersDisable"; return "offers/food/foodOffersDisable";
} }
@PostMapping(value = "/offers/food/{foodOfferId}/disable") @PostMapping(value = "/offers/food/{foodOfferId}/disable")

View file

@ -110,7 +110,7 @@ public class NuOfferController {
NuOffer nuOffer = this.nuOfferService.findNuOfferById(nuOfferId); NuOffer nuOffer = this.nuOfferService.findNuOfferById(nuOfferId);
model.put("nuOffer", nuOffer); model.put("nuOffer", nuOffer);
return "nuOffers/nuOffersDisable"; return "offers/nu/nuOffersDisable";
} }
@PostMapping(value = "/offers/nu/{nuOfferId}/disable") @PostMapping(value = "/offers/nu/{nuOfferId}/disable")

View file

@ -104,7 +104,7 @@ public class SpeedOfferController {
SpeedOffer speedOffer = this.speedOfferService.findSpeedOfferById(speedOfferId); SpeedOffer speedOffer = this.speedOfferService.findSpeedOfferById(speedOfferId);
model.put("speedOffer", speedOffer); model.put("speedOffer", speedOffer);
return "speedOffers/speedOffersDisable"; return "offers/speed/speedOffersDisable";
} }
@PostMapping(value = "/offers/speed/{speedOfferId}/disable") @PostMapping(value = "/offers/speed/{speedOfferId}/disable")

View file

@ -115,7 +115,7 @@ public class TimeOfferController {
TimeOffer timeOffer = this.timeOfferService.findTimeOfferById(timeOfferId); TimeOffer timeOffer = this.timeOfferService.findTimeOfferById(timeOfferId);
model.put("timeOffer", timeOffer); model.put("timeOffer", timeOffer);
return "timeOffers/timeOffersDisable"; return "offers/time/timeOffersDisable";
} }
@PostMapping(value = "/offers/time/{timeOfferId}/disable") @PostMapping(value = "/offers/time/{timeOfferId}/disable")

View file

@ -488,6 +488,13 @@ text-align: center;
background-color: rgb(204, 128, 51); background-color: rgb(204, 128, 51);
} }
#vacio {
text-align:center;
font-size: 120%;
padding:10px;
color: rgb(29, 142, 226);
}
.alert-success { .alert-success {
.alert-variant(fade(@alert-success-bg, 70%); @alert-success-border; @alert-success-text); .alert-variant(fade(@alert-success-bg, 70%); @alert-success-border; @alert-success-text);
} }

View file

@ -8,11 +8,11 @@
<petclinic:layout pageName="foodOffer"> <petclinic:layout pageName="foodOffer">
<jsp:body> <jsp:body>
<h2> ¿Esta seguro de que quiere eliminar su oferta? </h2> <h2> ¿Está seguro de que quiere eliminar su oferta? </h2>
<form:form modelAttribute="foodOffer" class="form-horizontal"> <form:form modelAttribute="foodOffer" class="form-horizontal">
<input type="hidden" name="food" value="${food_offer.food}" /> <input type="hidden" name="food" value="${foodOffer.food}" />
<input type="hidden" name="discount" value="${food_offer.discount}" /> <input type="hidden" name="discount" value="${foodOffer.discount}" />
<button class="btn btn-default" type="submit">Eliminar Oferta</button> <button class="btn btn-default" type="submit">Eliminar Oferta</button>
</form:form> </form:form>

View file

@ -4,6 +4,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> <%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'> <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="foodOffer"> <cheapy:layout pageName="foodOffer">
@ -45,7 +46,7 @@
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button> <fmt:message key="return"/> </button>
</div> </div>
<sec:authorize access="hasAnyAuthority('client')">
<div class="btns-edit"> <div class="btns-edit">
<spring:url value="{foodOfferId}/edit" var="editUrl"> <spring:url value="{foodOfferId}/edit" var="editUrl">
<spring:param name="foodOfferId" value="${foodOffer.id}"/> <spring:param name="foodOfferId" value="${foodOffer.id}"/>
@ -53,23 +54,28 @@
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <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> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Editar oferta</button> Editar oferta</button>
<c:if test="${foodOffer.status eq 'inactive' }">
<spring:url value="{foodOfferId}/activate" var="activateUrl"> <spring:url value="{foodOfferId}/activate" var="activateUrl">
<spring:param name="foodOfferId" value="${foodOffer.id}"/> <spring:param name="foodOfferId" value="${foodOffer.id}"/>
</spring:url> </spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Activar oferta</button> Activar oferta</button>
</c:if>
<c:if test="${foodOffer.status eq 'active' }">
<spring:url value="{foodOfferId}/disable" var="deactivateUrl"> <spring:url value="{foodOfferId}/disable" var="deactivateUrl">
<spring:param name="foodOfferId" value="${foodOffer.id}"/> <spring:param name="foodOfferId" value="${foodOffer.id}"/>
</spring:url> </spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Desactivar oferta</button> Desactivar oferta</button>
</c:if>
</div> </div>
</div> </div>
</sec:authorize>
<script> <script>
function goBack() { function goBack() {
window.history.back() window.history.back()

View file

@ -8,7 +8,10 @@
<cheapy:layout pageName="myOffers"> <cheapy:layout pageName="myOffers">
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2>
<c:if test="${empty foodOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty foodOfferLs }">
<table id="foodOfferTable" class="table table-striped"> <table id="foodOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -18,7 +21,7 @@
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th> <spring:url value="/offers/food/new" var="newFoodUrl"> <th> <spring:url value="/offers/food/new" var="newFoodUrl">
</spring:url> </spring:url>
<a href="${fn:escapeXml(newFoodUrl)}" class="btn btn-default">Nueva oferta</a></th> <!-- <a href="${fn:escapeXml(newFoodUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -48,9 +51,12 @@
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2>
<c:if test="${empty nuOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty nuOfferLs }">
<table id="nuOfferTable" class="table table-striped"> <table id="nuOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -59,7 +65,7 @@
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th> <spring:url value="/offers/nu/new" var="newNuUrl"> <th> <spring:url value="/offers/nu/new" var="newNuUrl">
</spring:url> </spring:url>
<a href="${fn:escapeXml(newNuUrl)}" class="btn btn-default">Nueva oferta</a></th> <!-- <a href="${fn:escapeXml(newNuUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
</tr> </tr>
</thead> </thead>
@ -87,8 +93,13 @@
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2>
<c:if test="${empty foodOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty speedOfferLs }">
<table id="speedOfferTable" class="table table-striped"> <table id="speedOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -97,7 +108,7 @@
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th> <spring:url value="/offers/speed/new" var="newSpeedUrl"> <th> <spring:url value="/offers/speed/new" var="newSpeedUrl">
</spring:url> </spring:url>
<a href="${fn:escapeXml(newSpeedUrl)}" class="btn btn-default">Nueva oferta</a></th> <!-- <a href="${fn:escapeXml(newSpeedUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
</tr> </tr>
</thead> </thead>
@ -126,8 +137,13 @@
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2>
<c:if test="${empty timeOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty timeOfferLs }">
<table id="timeOfferTable" class="table table-striped"> <table id="timeOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -136,7 +152,7 @@
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th><spring:url value="/offers/time/new" var="newTimeUrl"> <th><spring:url value="/offers/time/new" var="newTimeUrl">
</spring:url> </spring:url>
<a href="${fn:escapeXml(newTimeUrl)}" class="btn btn-default">Nueva oferta</a> </th> <!--<a href="${fn:escapeXml(newTimeUrl)}" class="btn btn-default">Nueva oferta</a> </th>-->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -163,4 +179,5 @@
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
</c:if>
</cheapy:layout> </cheapy:layout>

View file

@ -5,18 +5,18 @@
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags"%> <%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<petclinic:layout pageName="nuOffer"> <petclinic:layout pageName="nuOfferDisable">
<jsp:body> <jsp:body>
<h2> ¿Esta seguro de que quiere dar de baja su offer? </h2> <h2> ¿Está seguro de que quiere dar de baja su offer? </h2>
<form:form modelAttribute="nuOffer" class="form-horizontal"> <form:form modelAttribute="nuOffer" class="form-horizontal">
<input type="hidden" name="gold" value="${nu_offer.gold}" /> <input type="hidden" name="gold" value="${nuOffer.gold}" />
<input type="hidden" name="discountGold" value="${nu_offer.discount_gold}" /> <input type="hidden" name="discountGold" value="${nuOffer.discountGold}" />
<input type="hidden" name="silver" value="${nu_offer.silver}" /> <input type="hidden" name="silver" value="${nuOffer.silver}" />
<input type="hidden" name="discountSilver" value="${nu_offer.discount_silver}" /> <input type="hidden" name="discountSilver" value="${nuOffer.discountSilver}" />
<input type="hidden" name="bronze" value="${nu_offer.bronze}" /> <input type="hidden" name="bronze" value="${nuOffer.bronze}" />
<input type="hidden" name="discountBronze" value="${nu_offer.discount_bronze}" /> <input type="hidden" name="discountBronze" value="${nuOffer.discountBronze}" />
<button class="btn btn-default" type="submit">Dar de baja</button> <button class="btn btn-default" type="submit">Dar de baja</button>
</form:form> </form:form>

View file

@ -4,6 +4,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> <%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ 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'> <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="nuOffer"> <cheapy:layout pageName="nuOffer">
@ -56,7 +57,7 @@
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button> <fmt:message key="return"/> </button>
</div> </div>
<sec:authorize access="hasAnyAuthority('client')">
<div class="btns-edit"> <div class="btns-edit">
<spring:url value="{nuOfferId}/edit" var="editUrl"> <spring:url value="{nuOfferId}/edit" var="editUrl">
<spring:param name="nuOfferId" value="${nuOffer.id}"/> <spring:param name="nuOfferId" value="${nuOffer.id}"/>
@ -64,23 +65,26 @@
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <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> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Editar oferta</button> Editar oferta</button>
<c:if test="${nuOffer.status eq 'inactive' }">
<spring:url value="{nuOfferId}/activate" var="activateUrl"> <spring:url value="{nuOfferId}/activate" var="activateUrl">
<spring:param name="nuOfferId" value="${nuOffer.id}"/> <spring:param name="nuOfferId" value="${nuOffer.id}"/>
</spring:url> </spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Activar oferta</button> Activar oferta</button>
</c:if>
<spring:url value="{nuOfferId}/disable" var="deactivateUrl">
<spring:param name="nuOfferId" value="${nuOffer.id}"/> <c:if test="${nuOffer.status eq 'active' }">
</spring:url> <spring:url value="{nuOfferId}/disable" var="deactivateUrl">
<button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <spring:param name="nuOfferId" value="${nuOffer.id}"/>
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> </spring:url>
Desactivar oferta</button> <button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Desactivar oferta</button>
</c:if>
</div> </div>
</div> </div>
</sec:authorize>
<script> <script>
function goBack() { function goBack() {
window.history.back() window.history.back()

View file

@ -9,25 +9,25 @@
<cheapy:layout pageName="crearOfertas"> <cheapy:layout pageName="crearOfertas">
<div class="btn-create-max"> <div class="btn-create-max">
<div class="btn-create"> <div class="btn-create">
<button type="button" role="link" onclick="window.location='/foodOffers/new'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='/offers/food/new'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="createFoodOffers"/> </button> <fmt:message key="createFoodOffers"/> </button>
</div> </div>
<div class="btn-create"> <div class="btn-create">
<button type="button" role="link" onclick="window.location='/nuOffers/new'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='/offers/nu/new'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="createNuOffers"/> </button> <fmt:message key="createNuOffers"/> </button>
</div> </div>
<div class="btn-create"> <div class="btn-create">
<button type="button" role="link" onclick="window.location='/speedOffers/new'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='/offers/speed/new'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="createSpeedOffers"/> </button> <fmt:message key="createSpeedOffers"/> </button>
</div> </div>
<div class="btn-create"> <div class="btn-create">
<button type="button" role="link" onclick="window.location='/timeOffers/new'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='/offers/time/new'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="createTimeOffers"/> </button> <fmt:message key="createTimeOffers"/> </button>
</div> </div>

View file

@ -8,7 +8,10 @@
<cheapy:layout pageName="ofertas"> <cheapy:layout pageName="ofertas">
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2>
<c:if test="${empty foodOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty foodOfferLs }">
<table id="foodOfferTable" class="table table-striped"> <table id="foodOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -50,9 +53,12 @@
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2>
<c:if test="${empty nuOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty nuOfferLs }">
<table id="nuOfferTable" class="table table-striped"> <table id="nuOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -95,8 +101,13 @@
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2>
<c:if test="${empty speedOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty speedOfferLs }">
<table id="speedOfferTable" class="table table-striped"> <table id="speedOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -140,8 +151,13 @@
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2>
<c:if test="${empty timeOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty timeOfferLs }">
<table id="timeOfferTable" class="table table-striped"> <table id="timeOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -184,6 +200,8 @@
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
</c:if>
<div class="btn-return"> <div class="btn-return">
<button type="button" role="link" onclick="goBack()" 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> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>

View file

@ -11,12 +11,12 @@
<h2> ¿Esta seguro de que quiere dar de baja su offer? </h2> <h2> ¿Esta seguro de que quiere dar de baja su offer? </h2>
<form:form modelAttribute="speedOffer" class="form-horizontal"> <form:form modelAttribute="speedOffer" class="form-horizontal">
<input type="hidden" name="gold" value="${nu_offer.gold}" /> <input type="hidden" name="gold" value="${speedOffer.gold}" />
<input type="hidden" name="discountGold" value="${nu_offer.discount_gold}" /> <input type="hidden" name="discountGold" value="${speedOffer.discountGold}" />
<input type="hidden" name="silver" value="${nu_offer.silver}" /> <input type="hidden" name="silver" value="${speedOffer.silver}" />
<input type="hidden" name="discountSilver" value="${nu_offer.discount_silver}" /> <input type="hidden" name="discountSilver" value="${speedOffer.discountSilver}" />
<input type="hidden" name="bronze" value="${nu_offer.bronze}" /> <input type="hidden" name="bronze" value="${speedOffer.bronze}" />
<input type="hidden" name="discountBronze" value="${nu_offer.discount_bronze}" /> <input type="hidden" name="discountBronze" value="${speedOffer.discountBronze}" />
<button class="btn btn-default" type="submit">Dar de baja</button> <button class="btn btn-default" type="submit">Dar de baja</button>
</form:form> </form:form>

View file

@ -4,6 +4,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> <%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ 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'> <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="speedOffer"> <cheapy:layout pageName="speedOffer">
@ -56,7 +57,7 @@
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button> <fmt:message key="return"/> </button>
</div> </div>
<sec:authorize access="hasAnyAuthority('client')">
<div class="btns-edit"> <div class="btns-edit">
<spring:url value="{speedOfferId}/edit" var="editUrl"> <spring:url value="{speedOfferId}/edit" var="editUrl">
<spring:param name="speedOfferId" value="${speedOffer.id}"/> <spring:param name="speedOfferId" value="${speedOffer.id}"/>
@ -65,22 +66,26 @@
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Editar oferta</button> Editar oferta</button>
<spring:url value="{speedOfferId}/activate" var="activateUrl"> <c:if test="${speedOffer.status eq 'inactive' }">
<spring:param name="speedOfferId" value="${speedOffer.id}"/> <spring:url value="{speedOfferId}/activate" var="activateUrl">
</spring:url> <spring:param name="speedOfferId" value="${speedOffer.id}"/>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> </spring:url>
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> <button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
Activar oferta</button> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Activar oferta</button>
<spring:url value="{speedOfferId}/disable" var="deactivateUrl"> </c:if>
<spring:param name="speedOfferId" value="${speedOffer.id}"/>
</spring:url> <c:if test="${speedOffer.status eq 'active' }">
<button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <spring:url value="{speedOfferId}/disable" var="deactivateUrl">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <spring:param name="speedOfferId" value="${speedOffer.id}"/>
Desactivar oferta</button> </spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Desactivar oferta</button>
</c:if>
</div> </div>
</div> </div>
</sec:authorize>
<script> <script>
function goBack() { function goBack() {
window.history.back() window.history.back()

View file

@ -5,15 +5,15 @@
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags"%> <%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<petclinic:layout pageName="foodOffer"> <petclinic:layout pageName="timeOffer">
<jsp:body> <jsp:body>
<h2> ¿Esta seguro de que quiere eliminar su oferta? </h2> <h2> ¿Esta seguro de que quiere eliminar su oferta? </h2>
<form:form modelAttribute="foodOffer" class="form-horizontal"> <form:form modelAttribute="timeOffer" class="form-horizontal">
<input type="hidden" name="init" value="${time_offer.init}" /> <input type="hidden" name="init" value="${timeOffer.init}" />
<input type="hidden" name="finish" value="${time_offer.finish}" /> <input type="hidden" name="finish" value="${timeOffer.finish}" />
<input type="hidden" name="discount" value="${time_offer.discount}" /> <input type="hidden" name="discount" value="${timeOffer.discount}" />
<button class="btn btn-default" type="submit">Eliminar Oferta</button> <button class="btn btn-default" type="submit">Eliminar Oferta</button>
</form:form> </form:form>

View file

@ -4,6 +4,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> <%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ 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'> <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="timeOffer"> <cheapy:layout pageName="timeOffer">
@ -46,7 +47,7 @@
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button> <fmt:message key="return"/> </button>
</div> </div>
<sec:authorize access="hasAnyAuthority('client')">
<div class="btns-edit"> <div class="btns-edit">
<spring:url value="{timeOfferId}/edit" var="editUrl"> <spring:url value="{timeOfferId}/edit" var="editUrl">
<spring:param name="timeOfferId" value="${timeOffer.id}"/> <spring:param name="timeOfferId" value="${timeOffer.id}"/>
@ -55,22 +56,27 @@
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Editar oferta</button> Editar oferta</button>
<spring:url value="{timeOfferId}/activate" var="activateUrl"> <c:if test="${timeOffer.status eq 'inactive' }">
<spring:param name="timeOfferId" value="${timeOffer.id}"/> <spring:url value="{timeOfferId}/activate" var="activateUrl">
</spring:url> <spring:param name="timeOfferId" value="${timeOffer.id}"/>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> </spring:url>
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> <button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
Activar oferta</button> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Activar oferta</button>
<spring:url value="{timeOfferId}/disable" var="deactivateUrl"> </c:if>
<spring:param name="timeOfferId" value="${timeOffer.id}"/>
</spring:url> <c:if test="${timeOffer.status eq 'active' }">
<button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <spring:url value="{timeOfferId}/disable" var="deactivateUrl">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <spring:param name="timeOfferId" value="${timeOffer.id}"/>
Desactivar oferta</button> </spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Desactivar oferta</button>
</c:if>
</div> </div>
</div> </div>
</sec:authorize>
<script> <script>
function goBack() { function goBack() {
window.history.back() window.history.back()

View file

@ -22,7 +22,7 @@
<fmt:message key="listOffers"/> </button> <fmt:message key="listOffers"/> </button>
</div> </div>
<sec:authorize access="hasAnyAuthority('cliente')"> <sec:authorize access="hasAnyAuthority('client')">
<div class="btn-home"> <div class="btn-home">
<button type="button" role="link" onclick="window.location='/offersCreate'" style="font-family: 'Lobster'; font-size: 20px;margin:5px;"> <button type="button" role="link" onclick="window.location='/offersCreate'" style="font-family: 'Lobster'; font-size: 20px;margin:5px;">
<span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>