diff --git a/.travis.yml b/.travis.yml index 4957b38a3..3698c8809 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ before_install: - wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url) - chmod +x mvnw - mysql -e 'CREATE DATABASE cheapy;' - - sudo apt-get update after_success: - ls - ls target diff --git a/src/main/java/org/springframework/cheapy/model/Authorities.java b/src/main/java/org/springframework/cheapy/model/Authorities.java index 3bcfbbb35..f12de11e0 100644 --- a/src/main/java/org/springframework/cheapy/model/Authorities.java +++ b/src/main/java/org/springframework/cheapy/model/Authorities.java @@ -6,8 +6,10 @@ import javax.persistence.Table; @Entity @Table(name = "authorities") -public class Authorities{ +public class Authorities { + + //@NotNull @Id String username; @@ -25,34 +27,41 @@ public class Authorities{ public void setAuthority(String authority) { this.authority = authority; } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((authority == null) ? 0 : authority.hashCode()); + result = prime * result + ((username == null) ? 0 : username.hashCode()); + return result; + } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Authorities other = (Authorities) obj; + if (authority == null) { + if (other.authority != null) + return false; + } else if (!authority.equals(other.authority)) + return false; + if (username == null) { + if (other.username != null) + return false; + } else if (!username.equals(other.username)) + return false; + return true; + } + @Override + public String toString() { + return "Authorities [username=" + username + ", authority=" + authority + "]"; + } -// @ManyToOne -// @JoinColumn(name = "username") -// private Usuario user; -// -// @Size(min = 3, max = 50) -// private String authority; -// -// public Usuario getUser() { -// return user; -// } -// -// public void setUser(Usuario usern) { -// this.user = usern; -// } -// -// public String getAuthority() { -// return authority; -// } -// -// public void setAuthority(String authority) { -// this.authority = authority; -// } -// -// public static long getSerialversionuid() { -// return serialVersionUID; -// } } diff --git a/src/main/java/org/springframework/cheapy/model/Client.java b/src/main/java/org/springframework/cheapy/model/Client.java index e968f4a10..e9f56687d 100644 --- a/src/main/java/org/springframework/cheapy/model/Client.java +++ b/src/main/java/org/springframework/cheapy/model/Client.java @@ -57,16 +57,16 @@ public class Client extends BaseEntity { @NotEmpty private String description; - // Codigo de activacion de cuenta - @NotEmpty - private String code; - @NotEmpty private String food; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "username", referencedColumnName = "username") private User usuar; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "code", referencedColumnName = "code") + private Code cod; @OneToMany private List foodOffers; @@ -145,12 +145,20 @@ public class Client extends BaseEntity { this.description = description; } - public String getCode() { - return this.code; + public Municipio getMunicipio() { + return municipio; } - public void setCode(final String code) { - this.code = code; + public void setMunicipio(Municipio municipio) { + this.municipio = municipio; + } + + public Code getCode() { + return cod; + } + + public void setCode(Code code) { + this.cod = code; } public String getFood() { diff --git a/src/main/java/org/springframework/cheapy/model/Code.java b/src/main/java/org/springframework/cheapy/model/Code.java new file mode 100644 index 000000000..e441d4e31 --- /dev/null +++ b/src/main/java/org/springframework/cheapy/model/Code.java @@ -0,0 +1,38 @@ +package org.springframework.cheapy.model; + +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; + +@Entity +@Table(name = "codes") +public class Code extends BaseEntity{ + + + /** + * + */ + private static final long serialVersionUID = 1L; + + @NotNull + String code; + + Boolean activo; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + +} diff --git a/src/main/java/org/springframework/cheapy/model/Municipio.java b/src/main/java/org/springframework/cheapy/model/Municipio.java index d643f29ed..dd4beecd9 100644 --- a/src/main/java/org/springframework/cheapy/model/Municipio.java +++ b/src/main/java/org/springframework/cheapy/model/Municipio.java @@ -3,5 +3,4 @@ package org.springframework.cheapy.model; public enum Municipio { Dos_Hermanas, Sevilla - } diff --git a/src/main/java/org/springframework/cheapy/model/Offer.java b/src/main/java/org/springframework/cheapy/model/Offer.java index fd72e2989..0635ed8c3 100644 --- a/src/main/java/org/springframework/cheapy/model/Offer.java +++ b/src/main/java/org/springframework/cheapy/model/Offer.java @@ -36,12 +36,10 @@ public class Offer extends BaseEntity { @DateTimeFormat(pattern = "dd/MM/yyyy HH:mm") @NotNull(message = "Debe introducir una fecha de inicio") - @Future(message = "La fecha debe debe ser futura") private LocalDateTime start; @DateTimeFormat(pattern = "dd/MM/yyyy HH:mm") @NotNull(message = "Debe introducir una fecha de fin") - @Future(message = "La fecha debe debe ser futura") private LocalDateTime end; private String code; diff --git a/src/main/java/org/springframework/cheapy/model/User.java b/src/main/java/org/springframework/cheapy/model/User.java index 81b834002..7891d4c8e 100644 --- a/src/main/java/org/springframework/cheapy/model/User.java +++ b/src/main/java/org/springframework/cheapy/model/User.java @@ -7,18 +7,27 @@ import javax.validation.constraints.NotBlank; @Entity @Table(name = "users") -public class User{ +public class User { + + @Id + @NotBlank private String username; @NotBlank private String password; - boolean enabled; - - private static final long serialVersionUID = 1L; + private Boolean enabled; + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } public String getUsername() { return username; @@ -36,11 +45,48 @@ public class User{ this.password = password; } - public boolean getEnabled() { - return enabled; + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((enabled == null) ? 0 : enabled.hashCode()); + result = prime * result + ((password == null) ? 0 : password.hashCode()); + result = prime * result + ((username == null) ? 0 : username.hashCode()); + return result; } - public void setEnabled(boolean enabled) { - this.enabled = enabled; + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + User other = (User) obj; + if (enabled == null) { + if (other.enabled != null) + return false; + } else if (!enabled.equals(other.enabled)) + return false; + if (password == null) { + if (other.password != null) + return false; + } else if (!password.equals(other.password)) + return false; + if (username == null) { + if (other.username != null) + return false; + } else if (!username.equals(other.username)) + return false; + return true; } + + @Override + public String toString() { + return "User [username=" + username + ", password=" + password + ", enabled=" + enabled + "]"; + } + + } diff --git a/src/main/java/org/springframework/cheapy/model/Usuario.java b/src/main/java/org/springframework/cheapy/model/Usuario.java index 6299ca2b5..9adf0a9ec 100644 --- a/src/main/java/org/springframework/cheapy/model/Usuario.java +++ b/src/main/java/org/springframework/cheapy/model/Usuario.java @@ -2,6 +2,8 @@ package org.springframework.cheapy.model; import javax.persistence.CascadeType; import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; @@ -23,16 +25,12 @@ public class Usuario extends BaseEntity{ @NotBlank private String apellidos; - @NotBlank - private String dni; - @NotBlank private String direccion; - @NotBlank - //@Pattern(regexp = "([+][^0][\\d]{0,2})?[ ]?([(][\\d]{0,4}[)])?[ ]?([\\d]{6,10})$") - private String telefono; - + @Enumerated(value = EnumType.STRING) + private Municipio municipio; + @Email @NotBlank private String email; @@ -57,13 +55,6 @@ public class Usuario extends BaseEntity{ this.apellidos = apellidos; } - public String getDni() { - return dni; - } - - public void setDni(String dni) { - this.dni = dni; - } public String getDireccion() { return direccion; @@ -73,12 +64,20 @@ public class Usuario extends BaseEntity{ this.direccion = direccion; } - public String getTelefono() { - return telefono; + public Municipio getMunicipio() { + return municipio; } - public void setTelefono(String telefono) { - this.telefono = telefono; + public void setMunicipio(Municipio municipio) { + this.municipio = municipio; + } + + public User getUsuar() { + return usuar; + } + + public void setUsuar(User usuar) { + this.usuar = usuar; } public String getEmail() { @@ -89,13 +88,7 @@ public class Usuario extends BaseEntity{ this.email = email; } - public User getUsuar() { - return usuar; - } - public void setUsuar(User username) { - this.usuar = username; - } } diff --git a/src/main/java/org/springframework/cheapy/repository/AuthoritiesRepository.java b/src/main/java/org/springframework/cheapy/repository/AuthoritiesRepository.java index 8d5f6317c..d4de73ec5 100644 --- a/src/main/java/org/springframework/cheapy/repository/AuthoritiesRepository.java +++ b/src/main/java/org/springframework/cheapy/repository/AuthoritiesRepository.java @@ -1,8 +1,16 @@ package org.springframework.cheapy.repository; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.Repository; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cheapy.model.Authorities; +import org.springframework.dao.DataAccessException; -public interface AuthoritiesRepository extends CrudRepository{ +public interface AuthoritiesRepository extends CrudRepository{ + +// @Autowired +// void save(Authorities authorities); + } diff --git a/src/main/java/org/springframework/cheapy/repository/ClientRepository.java b/src/main/java/org/springframework/cheapy/repository/ClientRepository.java index a796b3e0a..7b6775c45 100644 --- a/src/main/java/org/springframework/cheapy/repository/ClientRepository.java +++ b/src/main/java/org/springframework/cheapy/repository/ClientRepository.java @@ -6,12 +6,14 @@ import java.util.List; import org.springframework.cheapy.model.Client; +import org.springframework.cheapy.model.Code; +import org.springframework.cheapy.model.Usuario; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.Repository; import org.springframework.transaction.annotation.Transactional; -public interface ClientRepository extends CrudRepository { +public interface ClientRepository extends Repository { @Query("SELECT client FROM Client client WHERE username =:username") @Transactional(readOnly = true) @@ -26,5 +28,7 @@ public interface ClientRepository extends CrudRepository { @Transactional(readOnly = true) List findAllClient(); - -} \ No newline at end of file + void save(Client client); + +} + diff --git a/src/main/java/org/springframework/cheapy/repository/CodeRepository.java b/src/main/java/org/springframework/cheapy/repository/CodeRepository.java new file mode 100644 index 000000000..324b9f63a --- /dev/null +++ b/src/main/java/org/springframework/cheapy/repository/CodeRepository.java @@ -0,0 +1,19 @@ +package org.springframework.cheapy.repository; + +import org.springframework.cheapy.model.Client; +import org.springframework.cheapy.model.Code; +import org.springframework.cheapy.model.Usuario; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.Repository; +import org.springframework.transaction.annotation.Transactional; + +public interface CodeRepository extends Repository { + + void save(Code code); + + @Query("SELECT code FROM Code code WHERE code.code =:code") + @Transactional(readOnly = true) + Code findCodeByCode(String code); + +} diff --git a/src/main/java/org/springframework/cheapy/repository/UserRepository.java b/src/main/java/org/springframework/cheapy/repository/UserRepository.java index 0c29a7bf6..eee4fa621 100644 --- a/src/main/java/org/springframework/cheapy/repository/UserRepository.java +++ b/src/main/java/org/springframework/cheapy/repository/UserRepository.java @@ -3,13 +3,18 @@ package org.springframework.cheapy.repository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.Repository; import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cheapy.model.User; import org.springframework.cheapy.model.Usuario; -public interface UserRepository extends CrudRepository { +public interface UserRepository extends Repository { @Query("SELECT u FROM User u WHERE username =:username") @Transactional(readOnly = true) User findByUsername(String username); + + + void save(User user); } diff --git a/src/main/java/org/springframework/cheapy/repository/UsuarioRepository.java b/src/main/java/org/springframework/cheapy/repository/UsuarioRepository.java index 54402bb9b..e7c979217 100644 --- a/src/main/java/org/springframework/cheapy/repository/UsuarioRepository.java +++ b/src/main/java/org/springframework/cheapy/repository/UsuarioRepository.java @@ -1,3 +1,4 @@ + package org.springframework.cheapy.repository; import java.util.List; @@ -23,4 +24,5 @@ public interface UsuarioRepository extends Repository { void save(Usuario usuario); + } diff --git a/src/main/java/org/springframework/cheapy/service/AuthoritiesService.java b/src/main/java/org/springframework/cheapy/service/AuthoritiesService.java index 9e91ce3b2..5ec186de2 100644 --- a/src/main/java/org/springframework/cheapy/service/AuthoritiesService.java +++ b/src/main/java/org/springframework/cheapy/service/AuthoritiesService.java @@ -15,14 +15,20 @@ */ package org.springframework.cheapy.service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cheapy.model.Authorities; +import org.springframework.cheapy.repository.AuthoritiesRepository; +import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; @Service public class AuthoritiesService { -/* - private AuthoritiesRepository authoritiesRepository; - private UserService userService; + @Autowired + private AuthoritiesRepository authoritiesRepository; +// private UserService userService; +/* @Autowired public AuthoritiesService(AuthoritiesRepository authoritiesRepository,UserService userService) { this.authoritiesRepository = authoritiesRepository; @@ -33,12 +39,20 @@ public class AuthoritiesService { public Authorities findAuthoritiyByUser(User user) { return this.authoritiesRepository.findByUser(user.getUsername()); } - +*/ @Transactional public void saveAuthorities(Authorities authorities) throws DataAccessException { authoritiesRepository.save(authorities); } + @Transactional + public void saveAuthorities(String username, String role) throws DataAccessException { + Authorities authority = new Authorities(); + authority.setUsername(username); + authority.setAuthority(role); + authoritiesRepository.save(authority); + } +/* @Transactional public void saveAuthorities(String username, String role) throws DataAccessException { Authorities authority = new Authorities(); diff --git a/src/main/java/org/springframework/cheapy/service/ClientService.java b/src/main/java/org/springframework/cheapy/service/ClientService.java index a92d25a75..e65eec3a7 100644 --- a/src/main/java/org/springframework/cheapy/service/ClientService.java +++ b/src/main/java/org/springframework/cheapy/service/ClientService.java @@ -1,10 +1,15 @@ package org.springframework.cheapy.service; import java.util.List; +import javax.validation.Valid; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cheapy.model.Client; +import org.springframework.cheapy.model.Code; +import org.springframework.cheapy.model.Usuario; import org.springframework.cheapy.repository.ClientRepository; +import org.springframework.cheapy.repository.CodeRepository; import org.springframework.dao.DataAccessException; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; @@ -15,10 +20,12 @@ import org.springframework.transaction.annotation.Transactional; public class ClientService { private ClientRepository clientRepository; + private CodeRepository codeRepository; @Autowired - public ClientService(final ClientRepository clientRepository) { + public ClientService(final ClientRepository clientRepository, CodeRepository codeRepository) { this.clientRepository = clientRepository; + this.codeRepository = codeRepository; } @Transactional @@ -27,15 +34,25 @@ public class ClientService { String username = authentication.getName(); return this.clientRepository.findByUsername(username); } + + public void saveClient(final Client client) throws DataAccessException { + this.clientRepository.save(client); + } + + public void saveCode(Code code) throws DataAccessException{ + this.codeRepository.save(code); + + } + + public Code findCodeByCode(String code) { + return this.codeRepository.findCodeByCode(code); + } @Transactional public Client findByUsername(String username) throws DataAccessException { return this.clientRepository.findByUsername(username); } - public void saveClient(final Client client) throws DataAccessException { - this.clientRepository.save(client); - } @Transactional public List findAllClient() throws DataAccessException { return this.clientRepository.findAllClient(); diff --git a/src/main/java/org/springframework/cheapy/service/UserService.java b/src/main/java/org/springframework/cheapy/service/UserService.java index 92b896e7f..93f69adf4 100644 --- a/src/main/java/org/springframework/cheapy/service/UserService.java +++ b/src/main/java/org/springframework/cheapy/service/UserService.java @@ -1,6 +1,7 @@ package org.springframework.cheapy.service; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cheapy.model.FoodOffer; import org.springframework.cheapy.model.User; import org.springframework.cheapy.repository.UserRepository; import org.springframework.dao.DataAccessException; @@ -25,5 +26,8 @@ public class UserService { String username = authentication.getName(); return this.userRepository.findByUsername(username); } - + + public void saveUser(final User user) throws DataAccessException { + this.userRepository.save(user); + } } diff --git a/src/main/java/org/springframework/cheapy/service/UsuarioService.java b/src/main/java/org/springframework/cheapy/service/UsuarioService.java index b1b69236e..efd60a87e 100644 --- a/src/main/java/org/springframework/cheapy/service/UsuarioService.java +++ b/src/main/java/org/springframework/cheapy/service/UsuarioService.java @@ -17,11 +17,11 @@ public class UsuarioService { private UsuarioRepository usuarioRepository; - @Autowired public UsuarioService(final UsuarioRepository usuarioRepository) { this.usuarioRepository = usuarioRepository; } + @Transactional public Usuario getCurrentUsuario() throws DataAccessException { diff --git a/src/main/java/org/springframework/cheapy/system/SingUpController.java b/src/main/java/org/springframework/cheapy/system/SingUpController.java new file mode 100644 index 000000000..6459ec357 --- /dev/null +++ b/src/main/java/org/springframework/cheapy/system/SingUpController.java @@ -0,0 +1,147 @@ +package org.springframework.cheapy.system; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cheapy.model.Authorities; +import org.springframework.cheapy.model.Client; +import org.springframework.cheapy.model.Code; +import org.springframework.cheapy.model.Municipio; +import org.springframework.cheapy.model.User; +import org.springframework.cheapy.model.Usuario; +import org.springframework.cheapy.service.AuthoritiesService; +import org.springframework.cheapy.service.ClientService; +import org.springframework.cheapy.service.UserService; +import org.springframework.cheapy.service.UsuarioService; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.InitBinder; +import org.springframework.web.bind.annotation.PostMapping; + +@Controller +public class SingUpController { + + //private static final String VIEWS_OWNER_CREATE_OR_UPDATE_FORM = "owners/createOrUpdateOwnerForm"; + + @Autowired + private final ClientService clientService; + @Autowired + private final UserService userService; + @Autowired + private final UsuarioService usuarioService; + @Autowired + private final AuthoritiesService authoritiesService; + + + public SingUpController(final ClientService clientService, UserService userService, AuthoritiesService authoritiesService, + UsuarioService usuarioService) { + this.clientService = clientService; + this.userService = userService; + this.authoritiesService = authoritiesService; + this.usuarioService = usuarioService; + + } + + + + @InitBinder + public void setAllowedFields(WebDataBinder dataBinder) { + dataBinder.setDisallowedFields("id"); + } + + private boolean checkTimes(final Client client) { + boolean res = false; + if(client.getFinish()==null || client.getInit()==null || client.getFinish().isAfter(client.getInit())) { + res = true; + } + return res; + } + + @GetMapping("/users/new") + public String singUpUserForm(Map model) { + Usuario usuario = new Usuario(); + + User user=new User(); + + usuario.setUsuar(user); + model.put("municipio", Municipio.values()); + model.put("usuario", usuario); + //model.put("user", user); + return "singup/singUpUser"; + } + + @PostMapping("/users/new") + public String singUpUserForm(/*@Valid User user,*/ @Valid Usuario usuario, BindingResult result) { + Authorities auth=new Authorities(); + User user= usuario.getUsuar(); + user.setEnabled(true); + usuario.setUsuar(user); + auth.setUsername(user.getUsername()); + auth.setAuthority("usuario"); + if (result.hasErrors()) { + return "singup/singUpUser"; + } + else { + //auth.setId(1); + //this.authoritiesService.saveAuthorities(auth); + this.usuarioService.saveUsuario(usuario); + this.userService.saveUser(user); + this.authoritiesService.saveAuthorities(usuario.getUsuar().getUsername(), "usuario"); + + return "redirect:/"; + } + } + + @GetMapping("/clients/new") + public String singUpClientForm(Map model) { + Client cliente = new Client(); + + User user=new User(); + + cliente.setUsuar(user); + model.put("municipio", Municipio.values()); + model.put("cliente", cliente); + //model.put("user", user); + return "singup/singUpClient"; + } + + @PostMapping("/clients/new") + public String singUpClientForm(/*@Valid User user,*/ @Valid Client cliente, final BindingResult result, final ModelMap model, + HttpServletRequest request) { + Authorities auth=new Authorities(); + String cod=cliente.getCode().getCode(); + Code code=this.clientService.findCodeByCode(cod); + User user= cliente.getUsuar(); + user.setEnabled(true); + cliente.setUsuar(user); + auth.setUsername(user.getUsername()); + auth.setAuthority("client"); + if(!this.checkTimes(cliente)) { + result.rejectValue("finish","" ,"La hora de cierre debe ser posterior a la hora de apertura"); + + } + if (result.hasErrors()) { + model.put("municipio", Municipio.values()); + model.put("cliente", cliente); + return "singup/singUpClient"; + }else if(code.getActivo().equals(false)) { + return "error"; + }else { + code.setActivo(false); + this.clientService.saveCode(code); + cliente.setCode(code); + this.clientService.saveClient(cliente); + this.userService.saveUser(user); + this.authoritiesService.saveAuthorities(cliente.getUsuar().getUsername(), "client"); + + + return "redirect:/"; + } + } +} diff --git a/src/main/java/org/springframework/cheapy/web/ClientController.java b/src/main/java/org/springframework/cheapy/web/ClientController.java index f17923b36..7bc63dbc7 100644 --- a/src/main/java/org/springframework/cheapy/web/ClientController.java +++ b/src/main/java/org/springframework/cheapy/web/ClientController.java @@ -12,6 +12,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cheapy.model.Client; import org.springframework.cheapy.model.FoodOffer; +import org.springframework.cheapy.model.Municipio; import org.springframework.cheapy.model.NuOffer; import org.springframework.cheapy.model.SpeedOffer; import org.springframework.cheapy.model.StatusOffer; @@ -84,7 +85,8 @@ public class ClientController { public String updateClient( final ModelMap model, HttpServletRequest request) { Client client = this.clientService.getCurrentClient(); - + + model.put("municipio", Municipio.values()); model.addAttribute("client", client); return ClientController.VIEWS_CREATE_OR_UPDATE_CLIENT; @@ -96,7 +98,6 @@ public class ClientController { Client clienteSesion = this.clientService.getCurrentClient(); - if(!this.checkTimes(clientEdit)) { result.rejectValue("finish","" ,"La hora de cierre debe ser posterior a la hora de apertura"); @@ -105,10 +106,11 @@ public class ClientController { if (result.hasErrors()) { model.addAttribute("client", clientEdit); + model.put("municipio", Municipio.values()); return ClientController.VIEWS_CREATE_OR_UPDATE_CLIENT; } - BeanUtils.copyProperties(clienteSesion, clientEdit, "name", "email", "address","init", "finish","telephone", "description","food","usuar"); + BeanUtils.copyProperties(clienteSesion, clientEdit, "name", "email", "address","init","municipio", "finish","telephone", "description","food","usuar"); clientEdit.getUsuar().setUsername(clienteSesion.getUsuar().getUsername()); clientEdit.getUsuar().setEnabled(true); this.clientService.saveClient(clientEdit); @@ -161,7 +163,6 @@ public class ClientController { public String showRestaurant(final ModelMap model, @PathVariable("clientId") Integer id) { Client client = this.clientRepo.findById(id).get(); - System.out.println(client.getDescription()); model.put("client", client); return "clients/restaurantShow"; } diff --git a/src/main/java/org/springframework/cheapy/web/NuOfferController.java b/src/main/java/org/springframework/cheapy/web/NuOfferController.java index 87d3eb549..9dfc68062 100644 --- a/src/main/java/org/springframework/cheapy/web/NuOfferController.java +++ b/src/main/java/org/springframework/cheapy/web/NuOfferController.java @@ -2,6 +2,7 @@ package org.springframework.cheapy.web; import java.security.Principal; +import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; @@ -23,6 +24,7 @@ import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; @Controller public class NuOfferController { diff --git a/src/main/java/org/springframework/cheapy/web/OfertaController.java b/src/main/java/org/springframework/cheapy/web/OfertaController.java index 7a069f3ef..81fdae55e 100644 --- a/src/main/java/org/springframework/cheapy/web/OfertaController.java +++ b/src/main/java/org/springframework/cheapy/web/OfertaController.java @@ -2,6 +2,8 @@ package org.springframework.cheapy.web; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -10,6 +12,7 @@ import javax.servlet.http.HttpServletRequest; import org.springframework.cheapy.model.FoodOffer; import org.springframework.cheapy.model.Municipio; import org.springframework.cheapy.model.NuOffer; +import org.springframework.cheapy.model.Offer; import org.springframework.cheapy.model.SpeedOffer; import org.springframework.cheapy.model.TimeOffer; import org.springframework.cheapy.service.ClientService; @@ -158,7 +161,38 @@ public class OfertaController { return "offers/offersCreate"; } + + @GetMapping("/offersRecord") + public String processOffersRecordForm(final Map model) { + + Pageable p = PageRequest.of(0, 3); + + Map datos = new HashMap(); + + for(Offer of:this.foodOfferService.findAllFoodOffer(p)) { + datos.put(of, "food"); + } + + for(Offer of:this.nuOfferService.findAllNuOffer(p)) { + datos.put(of, "nu"); + } + + for(Offer of:this.speedOfferService.findAllSpeedOffer(p)) { + datos.put(of, "speed"); + } + + for(Offer of:this.timeOfferService.findAllTimeOffer(p)) { + datos.put(of, "time"); + } + + model.put("datos", datos); + //Se añade formateador de fecha al modelo + model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); + + return "offers/offersRecordList"; + } + // @GetMapping("/owners/{ownerId}/edit") // public String initUpdateOwnerForm(@PathVariable("ownerId") int ownerId, Model model) { // Owner owner = this.ownerService.findOwnerById(ownerId); diff --git a/src/main/java/org/springframework/cheapy/web/UsuarioController.java b/src/main/java/org/springframework/cheapy/web/UsuarioController.java index 8e6d965cc..593443a76 100644 --- a/src/main/java/org/springframework/cheapy/web/UsuarioController.java +++ b/src/main/java/org/springframework/cheapy/web/UsuarioController.java @@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import org.springframework.beans.BeanUtils; +import org.springframework.cheapy.model.Municipio; import org.springframework.cheapy.model.Usuario; import org.springframework.cheapy.service.UsuarioService; import org.springframework.stereotype.Controller; @@ -37,15 +38,21 @@ public class UsuarioController { public String updateUsuario(final ModelMap model, HttpServletRequest request) { Usuario usuario = this.usuarioService.getCurrentUsuario(); model.addAttribute("usuario", usuario); + model.put("municipio", Municipio.values()); return UsuarioController.VIEWS_USUARIO_CREATE_OR_UPDATE_FORM; } @PostMapping(value = "/usuarios/edit") public String updateUsuario(@Valid final Usuario usuarioEdit, final BindingResult result, final ModelMap model, HttpServletRequest request) { - + + if (result.hasErrors()) { + model.addAttribute("usuario", usuarioEdit); + model.put("municipio", Municipio.values()); + return UsuarioController.VIEWS_USUARIO_CREATE_OR_UPDATE_FORM; + } Usuario usuario = this.usuarioService.getCurrentUsuario(); - BeanUtils.copyProperties(usuario, usuarioEdit, "nombre", "apellidos", "dni", "direccion", "telefono", "usuar"); + BeanUtils.copyProperties(usuario, usuarioEdit, "nombre", "apellidos", "municipio", "direccion","email", "usuar"); usuarioEdit.getUsuar().setUsername(usuario.getNombre()); usuarioEdit.getUsuar().setEnabled(true); this.usuarioService.saveUsuario(usuarioEdit); diff --git a/src/main/less/cheapy.less b/src/main/less/cheapy.less index b62ff8533..a6a211767 100644 --- a/src/main/less/cheapy.less +++ b/src/main/less/cheapy.less @@ -81,6 +81,9 @@ } } +.container { + width: 85%; +} .container .text-muted { margin: 20px 0; @@ -221,6 +224,28 @@ img.img-responsive{ width: 25%; } +.btn-filter{ + background: rgb(40, 140, 215); + color: white; +} + +.btn-filter:hover{ + background: rgb(0, 64, 128); + color: white; +} + +.btn-filter-active{ + background: rgb(0, 64, 128); + color: white; + +} + +.btn-filter-max button { + padding:10px; + margin-bottom: 20px; + +} + .btn-home { display: flex; justify-content: center; @@ -304,6 +329,15 @@ img.img-responsive{ background-color: rgb(40, 140, 215); } +#offerTable th{ + text-align: center; +} + +#offerTable td{ + vertical-align:middle; + text-align: center; +} + #foodOfferTable th { width: 20%; text-align: center; @@ -561,6 +595,12 @@ text-align: center; color: rgb(29, 142, 226); } +input[type=text] { + width:80%; + +} + + .row-full{ width: 100vw; position: relative; diff --git a/src/main/resources/db/mysql/data.sql b/src/main/resources/db/mysql/data.sql index cfc9f4978..22b93de26 100644 --- a/src/main/resources/db/mysql/data.sql +++ b/src/main/resources/db/mysql/data.sql @@ -1,27 +1,33 @@ INSERT INTO users (username,password,enabled) VALUES ('admin','admin', TRUE ); -INSERT INTO authorities VALUES ('admin','admin'); +INSERT INTO authorities (username,authority) VALUES ('admin','admin'); INSERT INTO users (username,password,enabled) VALUES ('manoli','manoli', TRUE ); -INSERT INTO authorities VALUES ('manoli','client'); +INSERT INTO authorities (username,authority) VALUES ('manoli','client'); INSERT INTO users (username,password,enabled) VALUES ('david','david', TRUE ); -INSERT INTO authorities VALUES ('david','client'); +INSERT INTO authorities (username,authority) VALUES ('david','client'); INSERT INTO users (username,password,enabled) VALUES ('paco','paco', TRUE ); -INSERT INTO authorities VALUES ('paco','usuario'); +INSERT INTO authorities (username,authority) VALUES ('paco','usuario'); INSERT INTO users (username,password,enabled) VALUES ('lolo','lolo', TRUE ); -INSERT INTO authorities VALUES ('lolo','usuario'); +INSERT INTO authorities (username,authority) VALUES ('lolo','usuario'); INSERT INTO users (username,password,enabled) VALUES ('pepe','pepe', TRUE ); -INSERT INTO authorities VALUES ('pepe','usuario'); +INSERT INTO authorities (username,authority) VALUES ('pepe','usuario'); -INSERT INTO administrators (id, username) VALUES (1, 'admin'); -INSERT INTO usuarios (id, nombre, apellidos, dni, direccion, telefono, email, username) VALUES (2, 'Paco', 'Naranjo', '21154416G', 'C/Esperanza', '666973647', 'Paco@gmail.com','paco'); -INSERT INTO usuarios (id, nombre, apellidos, dni, direccion, telefono, email, username) VALUES (3, 'Lolo', 'Lopez', '25486596L', 'C/Macarena', '690670547' ,'Lolo@gmail.com','lolo'); -INSERT INTO usuarios (id, nombre, apellidos, dni, direccion, telefono, email, username) VALUES (4, 'Pepe', 'Lopez', '12456776V', 'C/Macarena', '690670547', 'Pepe@gmail.com','pepe'); +INSERT INTO usuarios (id, nombre, apellidos, direccion, municipio, email, username) VALUES (1, 'admin', 'admin', 'C/admin', 'carmona', 'admin@gmail.com','admin'); +INSERT INTO usuarios (id, nombre, apellidos, direccion, municipio, email, username) VALUES (2, 'Paco', 'Naranjo', 'C/Esperanza', 'sevilla', 'Paco@gmail.com','paco'); +INSERT INTO usuarios (id, nombre, apellidos, direccion, municipio, email, username) VALUES (3, 'Lolo', 'Lopez', 'C/Macarena', 'dos_hermanas', 'Lolo@gmail.com','lolo'); +INSERT INTO usuarios (id, nombre, apellidos, direccion, municipio, email, username) VALUES (4, 'Pepe', 'Lopez', 'C/Macarena', 'carmona', 'Pepe@gmail.com','pepe'); + +INSERT INTO codes (id,code,activo) VALUES (1,'code1',FALSE); +INSERT INTO codes (id,code,activo) VALUES (2,'code2',FALSE); +INSERT INTO codes (id,code,activo) VALUES (3,'code3',TRUE); +INSERT INTO codes (id,code,activo) VALUES (4,'code4',TRUE); INSERT INTO clients (id, name, email, address, municipio, init, finish, telephone, description, code, food, username) VALUES (1,'bar manoli','manoli@gmail.com','C/Betis', 'Sevilla','10:00:00','22:00:00','608726190', 'description 1', 'code1', 'ESPAÑOLA','manoli'); INSERT INTO clients (id, name, email, address, municipio, init, finish, telephone, description, code, food, username) VALUES (2,'bar david','david@gmail.com', 'C/Sevilla', 'Dos_Hermanas','09:30:00','22:00:00','608726190', 'description 2', 'code2', 'americana','david'); + INSERT INTO food_offers(start, end, code, status, client_id, food, discount) VALUES ('2021-08-14 12:00:00', '2021-08-15 12:00:00', 'FO-1', 'inactive', 1, 'macarrones', 15); INSERT INTO food_offers(start, end, code, status, client_id, food, discount) VALUES ('2021-08-15 12:00:00', '2021-08-16 12:00:00', 'FO-2', 'active', 1, 'macarrones con tomate', 10); INSERT INTO food_offers(start, end, code, status, client_id, food, discount) VALUES ('2021-08-15 12:00:00', '2021-08-16 12:00:00', 'FO-3', 'active', 1, 'Estofado', 10); diff --git a/src/main/resources/messages/messages_es.properties b/src/main/resources/messages/messages_es.properties index d1e5854d1..d93fb4800 100644 --- a/src/main/resources/messages/messages_es.properties +++ b/src/main/resources/messages/messages_es.properties @@ -69,4 +69,5 @@ users=Usuarios nameUser=Nombre surname= Apellidos dni= DNI -usuario=Usuario \ No newline at end of file +usuario=Usuario +municipio=Municipio \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/clients/clientShow.jsp b/src/main/webapp/WEB-INF/jsp/clients/clientShow.jsp index 8b865dd99..9ccf3f800 100644 --- a/src/main/webapp/WEB-INF/jsp/clients/clientShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/clients/clientShow.jsp @@ -35,6 +35,10 @@ + + + + diff --git a/src/main/webapp/WEB-INF/jsp/clients/createOrUpdateClientForm.jsp b/src/main/webapp/WEB-INF/jsp/clients/createOrUpdateClientForm.jsp index 163807396..a42dd67c5 100644 --- a/src/main/webapp/WEB-INF/jsp/clients/createOrUpdateClientForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/clients/createOrUpdateClientForm.jsp @@ -14,35 +14,32 @@
- - - - - + + - + - - - +
+ + +
+ + +
- - - - - + - -
diff --git a/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersList.jsp b/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersList.jsp index 06c8cc2f3..1a6a725e8 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersList.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/food/foodOffersList.jsp @@ -9,39 +9,43 @@ - - - - - - - - - - - - - - - - - - - - +
+
+ + + + + + + + + + + + + + + + + + + + +
+

-

No hay ninguna oferta por plato específico activa.

+

No hay ninguna oferta por plato espec�fico activa.

@@ -97,7 +101,7 @@ + P�g. anterior @@ -106,7 +110,7 @@ + P�g. siguiente diff --git a/src/main/webapp/WEB-INF/jsp/offers/nu/createOrUpdateNuOfferForm.jsp b/src/main/webapp/WEB-INF/jsp/offers/nu/createOrUpdateNuOfferForm.jsp index 1dcc0f41d..0200bdc9a 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/nu/createOrUpdateNuOfferForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/nu/createOrUpdateNuOfferForm.jsp @@ -5,27 +5,74 @@ <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> + + + + + + + + + + + + + + + + + + + + +

-

+ +
- - + + + + + - +
@@ -45,7 +92,8 @@
+
- +
diff --git a/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersList.jsp b/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersList.jsp index 87e79f081..1ea94e7c6 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersList.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/nu/nuOffersList.jsp @@ -7,40 +7,42 @@ <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> - - - - - - - - - - - - - - - - - - - - - - + +
+
+ + + + + + + + + + + + + + + + + + + +
+

-

No hay ninguna oferta por número de comensales activa.

+

No hay ninguna oferta por n�mero de comensales activa.

@@ -94,7 +96,7 @@ + P�g. anterior @@ -103,7 +105,7 @@ + P�g. siguiente diff --git a/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp b/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp index 56e7fcc83..3f421f8ff 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/offersList.jsp @@ -9,44 +9,60 @@ - - - - - - - - - - - - - - - - - - - - - +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
- - +

Búsqueda por nombre del bar/restaurante:

+
+ + +
- - +

Búsqueda por comida:

+
+ + +
@@ -62,7 +78,7 @@

-

No hay ninguna oferta por plato específico activa.

+

No hay ninguna oferta por plato específico activa.

@@ -120,13 +136,13 @@
+ Ver más

-

No hay ninguna oferta por número de comensales activa.

+

No hay ninguna oferta por n�mero de comensales activa.

@@ -178,7 +194,7 @@ + Ver más @@ -239,7 +255,7 @@ + Ver más @@ -298,7 +314,7 @@ + Ver más diff --git a/src/main/webapp/WEB-INF/jsp/offers/offersRecordList.jsp b/src/main/webapp/WEB-INF/jsp/offers/offersRecordList.jsp new file mode 100644 index 000000000..7598a1ddc --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/offers/offersRecordList.jsp @@ -0,0 +1,82 @@ +<%@ 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" %> + + + +

Registro de Ofertas

+ +

No hay ninguna oferta creada.

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
RestauranteTipo de oferta
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersList.jsp b/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersList.jsp index ce01ceef1..76661379a 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersList.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/speed/speedOffersList.jsp @@ -7,37 +7,38 @@ <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> - - - - - - - - - - - - - - - - - - - - - - - + +
+
+ + + + + + + + + + + + + + + + + + + +
+

No hay ninguna oferta por tiempo empleado en comer activa.

@@ -95,7 +96,7 @@ + P�g. anterior
@@ -104,7 +105,7 @@ + P�g. siguiente
diff --git a/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersList.jsp b/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersList.jsp index 8ec8da295..984ad9ecd 100644 --- a/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersList.jsp +++ b/src/main/webapp/WEB-INF/jsp/offers/time/timeOffersList.jsp @@ -7,36 +7,38 @@ <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> - - - - - - - - - - - - - - - - - - - - - - + +
+
+ + + + + + + + + + + + + + + + + + + +
+

@@ -94,7 +96,7 @@ + P�g. anterior @@ -103,7 +105,7 @@ + P�g. siguiente diff --git a/src/main/webapp/WEB-INF/jsp/singup/singUpClient.jsp b/src/main/webapp/WEB-INF/jsp/singup/singUpClient.jsp new file mode 100644 index 000000000..124ed5701 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/singup/singUpClient.jsp @@ -0,0 +1,317 @@ +<%@ 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="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> + + + + + + + + +

+ +

+ +
+ + +
+ + +
+ + + + + + + + + + +
+
+ +
+ diff --git a/src/main/webapp/WEB-INF/jsp/singup/singUpUser.jsp b/src/main/webapp/WEB-INF/jsp/singup/singUpUser.jsp new file mode 100644 index 000000000..a2127d97f --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/singup/singUpUser.jsp @@ -0,0 +1,307 @@ +<%@ 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="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> + + + + + + + + +

+ +

+ +
+ + + +
+ + +
+ + + + +
+
+ +
+ diff --git a/src/main/webapp/WEB-INF/jsp/usuarios/createOrUpdateUsuarioForm.jsp b/src/main/webapp/WEB-INF/jsp/usuarios/createOrUpdateUsuarioForm.jsp index e63363513..ecfc2e070 100644 --- a/src/main/webapp/WEB-INF/jsp/usuarios/createOrUpdateUsuarioForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/usuarios/createOrUpdateUsuarioForm.jsp @@ -16,27 +16,24 @@
- +
+ + +
- - +
- - - - - - -
diff --git a/src/main/webapp/WEB-INF/jsp/usuarios/usuariosShow.jsp b/src/main/webapp/WEB-INF/jsp/usuarios/usuariosShow.jsp index c9201d00c..ae1cb8d4c 100644 --- a/src/main/webapp/WEB-INF/jsp/usuarios/usuariosShow.jsp +++ b/src/main/webapp/WEB-INF/jsp/usuarios/usuariosShow.jsp @@ -22,17 +22,14 @@ - - + + - - - - + diff --git a/src/main/webapp/WEB-INF/jsp/welcome.jsp b/src/main/webapp/WEB-INF/jsp/welcome.jsp index 0ebaa7377..18a6e579c 100644 --- a/src/main/webapp/WEB-INF/jsp/welcome.jsp +++ b/src/main/webapp/WEB-INF/jsp/welcome.jsp @@ -34,23 +34,11 @@ -
- -
+ - -
-
- -
-
-
+ diff --git a/src/main/webapp/WEB-INF/tags/dateField.tag b/src/main/webapp/WEB-INF/tags/dateField.tag new file mode 100644 index 000000000..859cdec5e --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/dateField.tag @@ -0,0 +1,29 @@ +<%@ 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" %> + + + + +
+ + +
+ + + + + + + + ${status.errorMessage} + +
+
+
diff --git a/src/main/webapp/WEB-INF/tags/menu.tag b/src/main/webapp/WEB-INF/tags/menu.tag index a56f8cf35..4ed9e3984 100644 --- a/src/main/webapp/WEB-INF/tags/menu.tag +++ b/src/main/webapp/WEB-INF/tags/menu.tag @@ -53,6 +53,13 @@ Usuarios + + + + + Registro de ofertas + + + +
  • ">Registrarse Usuario
  • + +
    + +
  • ">Registrarse Cliente
  • + +