From d5ded1d809dcc83abfd3c9bf4afb909c44e498e7 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 1 Apr 2021 16:53:19 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adido=20placeholders=20a=20los=20formula?= =?UTF-8?q?rios,=20arreglo=20del=20login=20y=20m=C3=A1s=20cambios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/SecurityConfiguration.java | 4 +-- .../cheapy/web/OfertaController.java | 9 +++++ src/main/less/cheapy.less | 32 +++++++++++++++++ .../resources/messages/messages_es.properties | 25 +++++++------ .../createOrUpdateFoodOfferForm.jsp | 8 ++--- src/main/webapp/WEB-INF/jsp/login.jsp | 19 ++++++---- .../nuOffers/createOrUpdateNuOfferForm.jsp | 16 ++++----- .../WEB-INF/jsp/offers/offersCreate.jsp | 36 +++++++++++++++++++ .../createOrUpdateSpeedOfferForm.jsp | 16 ++++----- .../createOrUpdateTimeOfferForm.jsp | 10 +++--- src/main/webapp/WEB-INF/jsp/welcome.jsp | 16 +++++++-- src/main/webapp/WEB-INF/tags/inputField.tag | 6 ++-- src/main/webapp/WEB-INF/tags/menu.tag | 2 +- 13 files changed, 150 insertions(+), 49 deletions(-) create mode 100644 src/main/webapp/WEB-INF/jsp/offers/offersCreate.jsp diff --git a/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java b/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java index 9435b1b30..747947a5a 100644 --- a/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java +++ b/src/main/java/org/springframework/cheapy/configuration/SecurityConfiguration.java @@ -47,10 +47,10 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { .antMatchers("/offers/speed/**").hasAnyAuthority("admin", "cliente") .antMatchers("/offers/food/**").hasAnyAuthority("admin", "cliente") .antMatchers("/owners/**").hasAnyAuthority("owner", "admin") - + .antMatchers("/clients/new").permitAll() .antMatchers("/offers").permitAll() - + .antMatchers("/offersCreate").hasAuthority("cliente") .and().formLogin() diff --git a/src/main/java/org/springframework/cheapy/web/OfertaController.java b/src/main/java/org/springframework/cheapy/web/OfertaController.java index c7cb3de71..d1fc6a407 100644 --- a/src/main/java/org/springframework/cheapy/web/OfertaController.java +++ b/src/main/java/org/springframework/cheapy/web/OfertaController.java @@ -12,6 +12,9 @@ import org.springframework.cheapy.service.FoodOfferService; import org.springframework.cheapy.service.NuOfferService; import org.springframework.cheapy.service.SpeedOfferService; import org.springframework.cheapy.service.TimeOfferService; +import org.springframework.security.authentication.AnonymousAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @@ -50,6 +53,12 @@ public class OfertaController { return "offers/offersList"; } + + @GetMapping("/offersCreate") + public String createOffers() { + + return "offers/offersCreate"; + } // @GetMapping("/owners/{ownerId}/edit") // public String initUpdateOwnerForm(@PathVariable("ownerId") int ownerId, Model model) { diff --git a/src/main/less/cheapy.less b/src/main/less/cheapy.less index 17d012e1f..52ebdf6ab 100644 --- a/src/main/less/cheapy.less +++ b/src/main/less/cheapy.less @@ -240,6 +240,38 @@ img.img-responsive{ background-color: rgb(40, 140, 215); } +.btn-home{ + display: table; + margin: 0 auto; +} + +.btn-create button { + background-color: rgb(40, 140, 215); + border: 1px solid rgb(0, 0, 160); + color: white; + padding: 10px 24px; + cursor: pointer; + width: 70%; + display: block; + +} + +.btn-create button:not(:last-child) { + border-bottom: none; +} + + +.btn-create button:hover { + background-color: rgb(0, 64, 128) +} + +.btn-create-max button { + padding: 20px; + margin-left:auto; + margin-right: auto; + margin-bottom: 20px; +} + .btn-mod{ display: table; margin: 0 auto; diff --git a/src/main/resources/messages/messages_es.properties b/src/main/resources/messages/messages_es.properties index f17c6626b..52ca403e5 100644 --- a/src/main/resources/messages/messages_es.properties +++ b/src/main/resources/messages/messages_es.properties @@ -4,10 +4,11 @@ deleteOffer=Eliminar Oferta cancel=Cancelar deleteOfferMessage=Confirme que quiere eliminar su oferta 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 +createOffers=Crear Ofertas +foodOffers=Ofertas por plato específico +foodOffer=Oferta por plato específico +nuOffers=Ofertas por número de comensales +nuOffer=Oferta por número de comensales speedOffers=Ofertas rapidez comiendo speedOffer=Oferta por comer veloz timeOffers=Ofertas por franja horaria @@ -27,12 +28,16 @@ offerBeginning=Inicio de la oferta endDate=Fecha fin offerEnding=Fin de la oferta details=Detalles -offerCode=Codigo de la oferta +offerCode=Código de la oferta return=Volver -required=Es requeridOfertas por franja horariao +required=Es requerido Ofertas por franja horaria 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 \ No newline at end of file +nonNumeric=Sólo debe contener números +duplicateFormSubmission=No se permite el envío de formularios duplicados +typeMismatch.date=Fecha inválida +typeMismatch.birthDate=Fecha inválida +createFoodOffers= Crear ofertas por plato específico +createNuOffers= Crear ofertas por número de comensales +createSpeedOffers= Crear ofertas por rapidez comiendo +createTimeOffers= Crear ofertas por franja horaria \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/foodOffers/createOrUpdateFoodOfferForm.jsp b/src/main/webapp/WEB-INF/jsp/foodOffers/createOrUpdateFoodOfferForm.jsp index 5c636d761..b5e5dcfaa 100644 --- a/src/main/webapp/WEB-INF/jsp/foodOffers/createOrUpdateFoodOfferForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/foodOffers/createOrUpdateFoodOfferForm.jsp @@ -16,10 +16,10 @@ - - - - + + + +
diff --git a/src/main/webapp/WEB-INF/jsp/login.jsp b/src/main/webapp/WEB-INF/jsp/login.jsp index 796cdceeb..89f886557 100644 --- a/src/main/webapp/WEB-INF/jsp/login.jsp +++ b/src/main/webapp/WEB-INF/jsp/login.jsp @@ -1,6 +1,8 @@ <%@ page session="false" trimDirectiveWhitespaces="true" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ 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" %> <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> @@ -275,20 +277,23 @@
- +
+ +

El usuario y/o la contraseña son incorrectos

+ +
-
-

Invalid username or password

-
+ +
diff --git a/src/main/webapp/WEB-INF/jsp/offers/offersCreate.jsp b/src/main/webapp/WEB-INF/jsp/offers/offersCreate.jsp new file mode 100644 index 000000000..51fc8d8b1 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/offers/offersCreate.jsp @@ -0,0 +1,36 @@ +<%@ page session="false" trimDirectiveWhitespaces="true" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ 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" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
diff --git a/src/main/webapp/WEB-INF/jsp/speedOffers/createOrUpdateSpeedOfferForm.jsp b/src/main/webapp/WEB-INF/jsp/speedOffers/createOrUpdateSpeedOfferForm.jsp index 2011952d6..8f76164d5 100644 --- a/src/main/webapp/WEB-INF/jsp/speedOffers/createOrUpdateSpeedOfferForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/speedOffers/createOrUpdateSpeedOfferForm.jsp @@ -16,14 +16,14 @@ - - - - - - - - + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/jsp/timeOffers/createOrUpdateTimeOfferForm.jsp b/src/main/webapp/WEB-INF/jsp/timeOffers/createOrUpdateTimeOfferForm.jsp index 770fb5428..82d748b3a 100644 --- a/src/main/webapp/WEB-INF/jsp/timeOffers/createOrUpdateTimeOfferForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/timeOffers/createOrUpdateTimeOfferForm.jsp @@ -16,12 +16,12 @@ - - + + - - - + + +
diff --git a/src/main/webapp/WEB-INF/jsp/welcome.jsp b/src/main/webapp/WEB-INF/jsp/welcome.jsp index 95c506f42..7f7ac42a2 100644 --- a/src/main/webapp/WEB-INF/jsp/welcome.jsp +++ b/src/main/webapp/WEB-INF/jsp/welcome.jsp @@ -1,11 +1,14 @@ <%@ page session="false" trimDirectiveWhitespaces="true" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ 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" %> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> - +

@@ -14,10 +17,19 @@
-
+ + +
+ +
+
+
diff --git a/src/main/webapp/WEB-INF/tags/inputField.tag b/src/main/webapp/WEB-INF/tags/inputField.tag index 0db10f39d..72de53f0b 100644 --- a/src/main/webapp/WEB-INF/tags/inputField.tag +++ b/src/main/webapp/WEB-INF/tags/inputField.tag @@ -5,15 +5,17 @@ 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" %>
- +
- + diff --git a/src/main/webapp/WEB-INF/tags/menu.tag b/src/main/webapp/WEB-INF/tags/menu.tag index daa63faa2..08772d137 100644 --- a/src/main/webapp/WEB-INF/tags/menu.tag +++ b/src/main/webapp/WEB-INF/tags/menu.tag @@ -25,7 +25,7 @@ - Home + Inicio