diff --git a/src/main/java/org/springframework/cheapy/web/FoodOfferController.java b/src/main/java/org/springframework/cheapy/web/FoodOfferController.java index af191c66d..c9d966408 100644 --- a/src/main/java/org/springframework/cheapy/web/FoodOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/FoodOfferController.java @@ -1,6 +1,7 @@ package org.springframework.cheapy.web; +import java.time.format.DateTimeFormatter; import java.util.Map; import javax.validation.Valid; import org.springframework.cheapy.model.Client; @@ -77,6 +78,9 @@ public class FoodOfferController { model.put("foodOffer", foodOffer); + //Se añade formateador de fecha al modelo + model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); + return "foodOffers/foodOffersShow"; } diff --git a/src/main/java/org/springframework/cheapy/web/NuOfferController.java b/src/main/java/org/springframework/cheapy/web/NuOfferController.java index c6ad3c47f..2315ff4ad 100644 --- a/src/main/java/org/springframework/cheapy/web/NuOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/NuOfferController.java @@ -1,5 +1,6 @@ package org.springframework.cheapy.web; +import java.time.format.DateTimeFormatter; import java.util.Map; import javax.validation.Valid; @@ -89,6 +90,9 @@ public class NuOfferController { model.put("nuOffer", nuOffer); + //Se añade formateador de fecha al modelo + model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); + return "nuOffers/nuOffersShow"; } diff --git a/src/main/java/org/springframework/cheapy/web/OfertaController.java b/src/main/java/org/springframework/cheapy/web/OfertaController.java index ffb11b46f..c7cb3de71 100644 --- a/src/main/java/org/springframework/cheapy/web/OfertaController.java +++ b/src/main/java/org/springframework/cheapy/web/OfertaController.java @@ -1,5 +1,6 @@ package org.springframework.cheapy.web; +import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; @@ -43,6 +44,9 @@ public class OfertaController { model.put("speedOfferLs", speedOfferLs); model.put("timeOfferLs", timeOfferLs); + //Se añade formateador de fecha al modelo + model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); + return "offers/offersList"; } diff --git a/src/main/java/org/springframework/cheapy/web/SpeedOfferController.java b/src/main/java/org/springframework/cheapy/web/SpeedOfferController.java index f9678e4bc..ab440b40d 100644 --- a/src/main/java/org/springframework/cheapy/web/SpeedOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/SpeedOfferController.java @@ -16,6 +16,7 @@ package org.springframework.cheapy.web; +import java.time.format.DateTimeFormatter; import java.util.Map; import javax.validation.Valid; @@ -92,6 +93,9 @@ public class SpeedOfferController { SpeedOffer speedOffer=this.speedOfferService.findSpeedOfferById(speedOfferId); model.put("speedOffer", speedOffer); + + //Se añade formateador de fecha al modelo + model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); return "speedOffers/speedOffersShow"; } } diff --git a/src/main/java/org/springframework/cheapy/web/TimeOfferController.java b/src/main/java/org/springframework/cheapy/web/TimeOfferController.java index b1bc2e528..86864aaf1 100644 --- a/src/main/java/org/springframework/cheapy/web/TimeOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/TimeOfferController.java @@ -1,5 +1,6 @@ package org.springframework.cheapy.web; +import java.time.format.DateTimeFormatter; import java.util.Map; import javax.validation.Valid; @@ -88,6 +89,9 @@ public class TimeOfferController { model.put("timeOffer", timeOffer); + //Se añade formateador de fecha al modelo + model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); + return "timeOffers/timeOffersShow"; } diff --git a/src/main/less/cheapy.less b/src/main/less/cheapy.less index 0f326f7ed..2ad446686 100644 --- a/src/main/less/cheapy.less +++ b/src/main/less/cheapy.less @@ -47,10 +47,10 @@ @pagination-active-bg: @spring-brown; @pagination-active-border: @spring-blue; -@table-border-color: @spring-brown; +@table-border-color: rgb(0, 64, 128); -.table > thead > tr > th { - background-color: lighten(@spring-brown, 3%); + .table > thead > tr > th { + background-color: rgb(40, 140, 215); color: @spring-light-grey; } @@ -237,7 +237,131 @@ img.img-responsive{ .btn-home button:hover { - background-color: rgb(0, 64, 128); + background-color: rgb(40, 140, 215); +} + +#foodOfferTable th { + width: 25%; +} + +#nuOfferTable th { + width: 33%; +} + +#speedOfferTable th { + width: 33%; +} + +#timeOfferTable th { + width: 33%; +} + +.btn-detalles button { + background-color: rgb(0, 64, 128); + border: 1px solid rgb(0, 0, 160); + color: white; + padding: 10px 24px; + cursor: pointer; + display: block; + float: right; +} + +.btn-detalles button:not(:last-child) { + border-bottom: none; +} + + +.btn-detalles button:hover { + background-color: rgb(40, 140, 215); +} + +.btn-return{ + display: table; + margin: 0 auto; + width: 100%; +} + +.btn-return button { + background-color: rgb(0, 64, 128); + border: 1px solid rgb(0, 0, 160); + color: white; + padding: 10px 24px; + cursor: pointer; + display: block; + left: 0%; +} + +.btn-return button:not(:last-child) { + border-bottom: none; +} + + +.btn-return button:hover { + background-color: rgb(40, 140, 215); +} + +#foodOfferTable td{ + vertical-align:middle; +} + +#nuOfferTable td{ + vertical-align:middle; +} + +#speedOfferTable td{ + vertical-align:middle; +} + +#timeOfferTable td{ + vertical-align:middle; +} + +#nuOffer-table tr:nth-child(3){ + background-color: rgb(255, 215, 0); +} + +#nuOffer-table tr:nth-child(4){ + background-color: rgb(255, 215, 0); +} + +#nuOffer-table tr:nth-child(5){ + background-color: rgb(192, 192, 192); +} + +#nuOffer-table tr:nth-child(6){ + background-color: rgb(192, 192, 192); +} + +#nuOffer-table tr:nth-child(7){ + background-color: rgb(204, 128, 51); +} + +#nuOffer-table tr:nth-child(8){ + background-color: rgb(204, 128, 51); +} + +#speedOffer-table tr:nth-child(3){ + background-color: rgb(255, 215, 0); +} + +#speedOffer-table tr:nth-child(4){ + background-color: rgb(255, 215, 0); +} + +#speedOffer-table tr:nth-child(5){ + background-color: rgb(192, 192, 192); +} + +#speedOffer-table tr:nth-child(6){ + background-color: rgb(192, 192, 192); +} + +#speedOffer-table tr:nth-child(7){ + background-color: rgb(204, 128, 51); +} + +#speedOffer-table tr:nth-child(8){ + background-color: rgb(204, 128, 51); } .alert-success { diff --git a/src/main/resources/messages/messages.properties b/src/main/resources/messages/messages.properties index 173417a10..1947d786c 100644 --- a/src/main/resources/messages/messages.properties +++ b/src/main/resources/messages/messages.properties @@ -1,4 +1,6 @@ -welcome=Welcome +welcome=Welcome to +listOffers=List Offers + required=is required notFound=has not been found duplicate=is already in use diff --git a/src/main/resources/messages/messages_es.properties b/src/main/resources/messages/messages_es.properties index bdf81dae7..81b71314d 100644 --- a/src/main/resources/messages/messages_es.properties +++ b/src/main/resources/messages/messages_es.properties @@ -1,8 +1,34 @@ welcome=Bienvenido a -required=Es requerido +listOffers=Ver Ofertas +foodOffers=Ofertas por plato especifico +foodOffer=Oferta por plato especifico +nuOffers=Ofertas por numero de comensales +nuOffer=Oferta por numero de comensales +speedOffers=Ofertas rapidez comiendo +speedOffer=Oferta por comer veloz +timeOffers=Ofertas por franja horaria +timeOffer=Oferta por franja horaria +food=Plato +foodInOffer=Plato en oferta +cuantity=Cantidad +discount=Descuento +goldGoal=Meta oro +goldDiscount=Descuento oro +silverGoal=Meta plata +silverDiscount=Descuento plata +bronzeGoal=Meta bronce +bronzeDiscount=Descuento bronce +startDate=Fecha inicio +offerBeginning=Inicio de la oferta +endDate=Fecha fin +offerEnding=Fin de la oferta +details=Detalles +offerCode=Codigo de la oferta +return=Volver +required=Es requeridOfertas por franja horariao notFound=No ha sido encontrado duplicate=Ya se encuentra en uso nonNumeric=Sólo debe contener numeros duplicateFormSubmission=No se permite el envío de formularios duplicados typeMismatch.date=Fecha invalida -typeMismatch.birthDate=Fecha invalida +typeMismatch.birthDate=Fecha invalida \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/foodOffers/foodOffersShow.jsp b/src/main/webapp/WEB-INF/jsp/foodOffers/foodOffersShow.jsp index 0b7c8785a..f307756d5 100644 --- a/src/main/webapp/WEB-INF/jsp/foodOffers/foodOffersShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/foodOffers/foodOffersShow.jsp @@ -3,38 +3,46 @@ <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ 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" %> + -

Oferta por plato específico

+

- - + + - - + + - + - + - + - +
Inicio de la oferta
Fin de la oferta
Plato en oferta
Descuento
Cantidad
Codigo de la oferta
+ +
+ +
<%-- diff --git a/src/main/webapp/WEB-INF/jsp/nuOffers/nuOffersShow.jsp b/src/main/webapp/WEB-INF/jsp/nuOffers/nuOffersShow.jsp index 431d2a4d6..301184bb3 100644 --- a/src/main/webapp/WEB-INF/jsp/nuOffers/nuOffersShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/nuOffers/nuOffersShow.jsp @@ -3,35 +3,37 @@ <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ 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" %> + -

Oferta por número de comensales

+

- +
- - + + - - + + - + - + - + - + @@ -39,14 +41,20 @@ - + - +
Inicio de la oferta
Fin de la oferta
Meta oro
Descuento oro
Meta plata
Descuento plata
Descuento bronce
Codigo de la oferta
+ +
+ +
<%-- diff --git a/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp b/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp index d65c50967..d326a6b8a 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp @@ -4,17 +4,18 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> + -

Ofertas por plato específico

+

- - - + + + @@ -25,16 +26,20 @@ @@ -42,14 +47,14 @@
PlatoFecha inicioFecha fin
- + - + - - - - Enlace + + + +
+ +
-

Ofertas por número de comensales

+

- - + + @@ -59,29 +64,33 @@
Fecha inicioFecha fin
- + - + - - - - Enlace + + + +
+ +
-

Ofertas rapidez comiendo

+

- - + + @@ -91,30 +100,34 @@
Fecha inicioFecha fin
- + - + - Enlace +
+ +
-

Ofertas por franja horaria

+

- - + + @@ -123,16 +136,20 @@ diff --git a/src/main/webapp/WEB-INF/jsp/speedOffers/speedOffersShow.jsp b/src/main/webapp/WEB-INF/jsp/speedOffers/speedOffersShow.jsp index 4a85df28b..d479bb213 100644 --- a/src/main/webapp/WEB-INF/jsp/speedOffers/speedOffersShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/speedOffers/speedOffersShow.jsp @@ -3,50 +3,58 @@ <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ 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" %> + -

Oferta por comer veloz

+

-
Fecha inicioFecha fin
- + - + - + - Enlace +
+ +
+
- - + + - - + + - + - + - + - + - + - + - +
Inicio de la oferta
Fin de la oferta
Meta oro
Descuento oro
Meta plata
Descuento plata
Meta bronce
Descuento bronce
Codigo de la oferta
+ +
+ +
<%-- diff --git a/src/main/webapp/WEB-INF/jsp/timeOffers/timeOffersShow.jsp b/src/main/webapp/WEB-INF/jsp/timeOffers/timeOffersShow.jsp index a344a6221..da696276d 100644 --- a/src/main/webapp/WEB-INF/jsp/timeOffers/timeOffersShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/timeOffers/timeOffersShow.jsp @@ -3,29 +3,37 @@ <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ 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" %> + -

Oferta por franja horária

+

- - + + - - + + - + - +
Inicio de la oferta
Fin de la oferta
Descuento
Codigo de la oferta
+ +
+ +
diff --git a/src/main/webapp/WEB-INF/jsp/welcome.jsp b/src/main/webapp/WEB-INF/jsp/welcome.jsp index 5d48bc8d5..95c506f42 100644 --- a/src/main/webapp/WEB-INF/jsp/welcome.jsp +++ b/src/main/webapp/WEB-INF/jsp/welcome.jsp @@ -14,8 +14,9 @@ diff --git a/src/main/webapp/WEB-INF/tags/pivotal.tag b/src/main/webapp/WEB-INF/tags/pivotal.tag index 23991e12a..3824905bf 100644 --- a/src/main/webapp/WEB-INF/tags/pivotal.tag +++ b/src/main/webapp/WEB-INF/tags/pivotal.tag @@ -5,6 +5,6 @@
" - alt="Sponsored by Pivotal"/>
+ alt="Eat fast, eat cheapy"/>