Merge branch 'develop' into 036-fixAdminShow-issue#111

This commit is contained in:
Antonio Vidal 2021-04-17 15:37:57 +02:00 committed by GitHub
commit 008c25bd33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 1377 additions and 377 deletions

View file

@ -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

View file

@ -1,3 +1,4 @@
package org.springframework.cheapy.model;
import java.time.LocalTime;
@ -21,131 +22,129 @@ import org.springframework.format.annotation.DateTimeFormat;
@Table(name = "clients")
public class Client extends BaseEntity {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
// (id, name, email, address, init, finish, telephone, description, code, food,
// usuar)
@NotEmpty
private String name;
@NotEmpty(message="No debe estar vacío")
private String name;
@NotEmpty
private String email;
@NotEmpty(message="No debe estar vacío")
private String email;
@NotEmpty(message="No debe estar vacío")
private String address;
@NotEmpty
private String address;
@Enumerated(value = EnumType.STRING)
@NotNull
private Municipio municipio;
@Enumerated(value = EnumType.STRING)
private Municipio municipio;
// Hora de apertura del local
@DateTimeFormat(pattern = "HH:mm")
@NotNull(message = "Debe introducir una hora de apertura")
private LocalTime init;
private LocalTime init;
// Hora de cierre del local
@DateTimeFormat(pattern = "HH:mm")
@NotNull(message = "Debe introducir una hora de cierre")
private LocalTime finish;
private LocalTime finish;
@NotEmpty
@Digits(fraction = 0, integer = 10)
private String telephone;
private String telephone;
@NotEmpty
private String description;
// Codigo de activacion de cuenta
// @NotEmpty
// private String code;
private String description;
@NotEmpty
private String food;
private String food;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "username", referencedColumnName = "username")
private User usuar;
private User usuar;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "code", referencedColumnName = "code")
private Code cod;
@OneToMany
private List<FoodOffer> foodOffers;
private List<FoodOffer> foodOffers;
@OneToMany
private List<NuOffer> nuOffers;
private List<NuOffer> nuOffers;
@OneToMany
private List<SpeedOffer> speedOffers;
private List<SpeedOffer> speedOffers;
@OneToMany
private List<TimeOffer> timeOffers;
private List<TimeOffer> timeOffers;
public String getName() {
return name;
return this.name;
}
public void setName(String name) {
public void setName(final String name) {
this.name = name;
}
public String getEmail() {
return email;
return this.email;
}
public void setEmail(String email) {
public void setEmail(final String email) {
this.email = email;
}
public String getAddress() {
return address;
return this.address;
}
public void setAddress(String address) {
public void setAddress(final String address) {
this.address = address;
}
public LocalTime getInit() {
return init;
public Municipio getMunicipio() {
return this.municipio;
}
public void setInit(LocalTime init) {
public void setMunicipio(final Municipio municipio) {
this.municipio = municipio;
}
public LocalTime getInit() {
return this.init;
}
public void setInit(final LocalTime init) {
this.init = init;
}
public LocalTime getFinish() {
return finish;
return this.finish;
}
public void setFinish(LocalTime finish) {
public void setFinish(final LocalTime finish) {
this.finish = finish;
}
public String getTelephone() {
return telephone;
return this.telephone;
}
public void setTelephone(String telephone) {
public void setTelephone(final String telephone) {
this.telephone = telephone;
}
public String getDescription() {
return description;
return this.description;
}
public void setDescription(String description) {
public void setDescription(final String description) {
this.description = description;
}
public Municipio getMunicipio() {
return municipio;
}
public void setMunicipio(Municipio municipio) {
this.municipio = municipio;
}
public Code getCode() {
return cod;
@ -156,51 +155,51 @@ public class Client extends BaseEntity {
}
public String getFood() {
return food;
return this.food;
}
public void setFood(String food) {
public void setFood(final String food) {
this.food = food;
}
public User getUsuar() {
return usuar;
return this.usuar;
}
public void setUsuar(User usuar) {
public void setUsuar(final User usuar) {
this.usuar = usuar;
}
public List<FoodOffer> getFoodOffers() {
return foodOffers;
return this.foodOffers;
}
public void setFoodOffers(List<FoodOffer> foodOffers) {
public void setFoodOffers(final List<FoodOffer> foodOffers) {
this.foodOffers = foodOffers;
}
public List<NuOffer> getNuOffers() {
return nuOffers;
return this.nuOffers;
}
public void setNuOffers(List<NuOffer> nuOffers) {
public void setNuOffers(final List<NuOffer> nuOffers) {
this.nuOffers = nuOffers;
}
public List<SpeedOffer> getSpeedOffers() {
return speedOffers;
return this.speedOffers;
}
public void setSpeedOffers(List<SpeedOffer> speedOffers) {
public void setSpeedOffers(final List<SpeedOffer> speedOffers) {
this.speedOffers = speedOffers;
}
public List<TimeOffer> getTimeOffers() {
return timeOffers;
return this.timeOffers;
}
public void setTimeOffers(List<TimeOffer> timeOffers) {
public void setTimeOffers(final List<TimeOffer> timeOffers) {
this.timeOffers = timeOffers;
}
}
}

View file

@ -1,5 +1,31 @@
package org.springframework.cheapy.model;
public enum Municipio {
sevilla,dos_hermanas,carmona,bollullos,pilas,montellano,mairena_aljarafe,mairena_alcor
Dos_Hermanas{
@Override
public String toString() {
return "Dos Hermanas";
}
}
, Sevilla{
@Override
public String toString() {
return "Sevilla";
}
}
, Carmona{
@Override
public String toString() {
return "Carmona";
}
}
}

View file

@ -0,0 +1,67 @@
package org.springframework.cheapy.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Range;
@Entity
@Table(name = "review_client")
public class ReviewClient extends BaseEntity{
private static final long serialVersionUID = 1L;
@NotBlank(message = "Debe rellenar la valoración sobre el bar")
@Column(length=16777215)
private String opinion;
@NotNull(message= "Por favor rellene este campo")
@Range(min = 1, max = 5,message="Las estrellas deben ir entre 1 y 5")
private Integer stars;
@ManyToOne
@JoinColumn(name = "username", referencedColumnName = "username")
private User escritor;
@ManyToOne
@JoinColumn(name = "client", referencedColumnName = "id")
private Client bar;
public User getEscritor() {
return escritor;
}
public Client getBar() {
return bar;
}
public void setBar(Client bar) {
this.bar = bar;
}
public void setEscritor(User escritor) {
this.escritor = escritor;
}
public String getOpinion() {
return opinion;
}
public void setOpinion(String opinion) {
this.opinion = opinion;
}
public Integer getStars() {
return stars;
}
public void setStars(Integer stars) {
this.stars = stars;
}
}

View file

@ -1,5 +1,31 @@
package org.springframework.cheapy.model;
public enum StatusOffer {
active, inactive, hidden
active{
@Override
public String toString() {
return "Activa";
}
}
, inactive{
@Override
public String toString() {
return "Inactiva";
}
}
, hidden{
@Override
public String toString() {
return "Oculta";
}
}
}

View file

@ -19,20 +19,20 @@ public class Usuario extends BaseEntity{
private static final long serialVersionUID = 1L;
@NotBlank
@NotBlank(message="No debe estar vacío")
private String nombre;
@NotBlank
@NotBlank(message="No debe estar vacío")
private String apellidos;
@NotBlank
@NotBlank(message="No debe estar vacío")
private String direccion;
@Enumerated(value = EnumType.STRING)
private Municipio municipio;
@Email
@NotBlank
@NotBlank(message="No debe estar vacío")
private String email;
@OneToOne(cascade = CascadeType.ALL)

View file

@ -4,6 +4,7 @@ package org.springframework.cheapy.repository;
import java.util.List;
import org.springframework.cheapy.model.FoodOffer;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.StatusOffer;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
@ -34,13 +35,17 @@ public interface FoodOfferRepository extends PagingAndSortingRepository<FoodOffe
@Query("SELECT foodOffer FROM FoodOffer foodOffer WHERE foodOffer.client.id =:id AND foodOffer.status!= 'inactive'")
@Transactional(readOnly = true)
List<FoodOffer> findFoodOfferActOclByUserId(@Param("id") Integer id);
@Query("SELECT foodOffer FROM FoodOffer foodOffer WHERE foodOffer.client.name LIKE :name AND foodOffer.status= 'active'")
@Transactional(readOnly = true)
List<FoodOffer> findFoodOfferByClientName(String name);
@Query("SELECT foodOffer FROM FoodOffer foodOffer WHERE foodOffer.client.food LIKE :name AND foodOffer.status= 'active'")
@Transactional(readOnly = true)
List<FoodOffer> findFoodOfferByClientFood(String name);
@Query("SELECT foodOffer FROM FoodOffer foodOffer WHERE foodOffer.client.municipio =:municipio AND foodOffer.status= 'active'")
@Transactional(readOnly = true)
List<FoodOffer> findFoodOfferByClientPlace(Municipio municipio);
}

View file

@ -2,6 +2,8 @@
package org.springframework.cheapy.repository;
import java.util.List;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.NuOffer;
import org.springframework.cheapy.model.StatusOffer;
import org.springframework.data.domain.Pageable;
@ -31,12 +33,16 @@ public interface NuOfferRepository extends PagingAndSortingRepository<NuOffer, I
@Query("SELECT nuOffer FROM NuOffer nuOffer WHERE nuOffer.client.id =:id AND nuOffer.status!= 'inactive'")
@Transactional(readOnly = true)
List<NuOffer> findNuOfferActOclByUserId(@Param("id") Integer id);
@Query("SELECT nuOffer FROM NuOffer nuOffer WHERE nuOffer.client.name LIKE :name AND nuOffer.status= 'active'")
@Transactional(readOnly = true)
List<NuOffer> findNuOfferByClientName(String name);
@Query("SELECT nuOffer FROM NuOffer nuOffer WHERE nuOffer.client.food LIKE :name AND nuOffer.status= 'active'")
@Transactional(readOnly = true)
List<NuOffer> findNuOfferByClientFood(String name);
@Query("SELECT nuOffer FROM NuOffer nuOffer WHERE nuOffer.client.municipio =:municipio AND nuOffer.status= 'active'")
@Transactional(readOnly = true)
List<NuOffer> findNuOfferByClientPlace(Municipio municipio);
}

View file

@ -0,0 +1,19 @@
package org.springframework.cheapy.repository;
import java.util.List;
import org.springframework.cheapy.model.Client;
import org.springframework.cheapy.model.ReviewClient;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface ReviewClientRepository extends PagingAndSortingRepository<ReviewClient, Integer> {
List<ReviewClient> findByBar(String bar);
List<ReviewClient> findAllReviewClientByBar(Pageable p, Client client);
List<ReviewClient> findAllReviewClientByBar(Client client);
ReviewClient findReviewClientById(int id);
}

View file

@ -3,6 +3,7 @@ package org.springframework.cheapy.repository;
import java.util.List;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.SpeedOffer;
import org.springframework.cheapy.model.StatusOffer;
import org.springframework.data.domain.Pageable;
@ -34,12 +35,16 @@ public interface SpeedOfferRepository extends PagingAndSortingRepository<SpeedOf
@Query("SELECT speedOffer FROM SpeedOffer speedOffer WHERE speedOffer.client.id =:id AND speedOffer.status!= 'inactive'")
@Transactional(readOnly = true)
List<SpeedOffer> findSpeedOfferActOclByUserId(@Param("id") Integer id);
@Query("SELECT speedOffer FROM SpeedOffer speedOffer WHERE speedOffer.client.name LIKE :name AND speedOffer.status= 'active'")
@Transactional(readOnly = true)
List<SpeedOffer> findSpeedOfferByClientName(String name);
@Query("SELECT speedOffer FROM SpeedOffer speedOffer WHERE speedOffer.client.food LIKE :name AND speedOffer.status= 'active'")
@Transactional(readOnly = true)
List<SpeedOffer> findSpeedOfferByClientFood(String name);
@Query("SELECT speedOffer FROM SpeedOffer speedOffer WHERE speedOffer.client.municipio =:municipio AND speedOffer.status= 'active'")
@Transactional(readOnly = true)
List<SpeedOffer> findSpeedOfferByClientPlace(Municipio municipio);
}

View file

@ -3,6 +3,9 @@ package org.springframework.cheapy.repository;
import java.util.List;
import org.springframework.cheapy.model.FoodOffer;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.StatusOffer;
import org.springframework.cheapy.model.TimeOffer;
import org.springframework.data.domain.Pageable;
@ -12,11 +15,12 @@ import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
public interface TimeOfferRepository extends PagingAndSortingRepository<TimeOffer, Integer> {
@Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.id =:id")
@Transactional(readOnly = true)
TimeOffer findTimeOfferById(int id);
@Query("SELECT timeOffer FROM TimeOffer timeOffer")
@Transactional(readOnly = true)
List<TimeOffer> findAllTimeOffer(Pageable p);
@ -34,12 +38,16 @@ public interface TimeOfferRepository extends PagingAndSortingRepository<TimeOffe
@Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.client.id =:id AND timeOffer.status!= 'inactive'")
@Transactional(readOnly = true)
List<TimeOffer> findTimeOfferActOclByUserId(@Param("id") Integer id);
@Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.client.name LIKE :name AND timeOffer.status= 'active'")
@Transactional(readOnly = true)
List<TimeOffer> findTimeOfferByClientName(String name);
@Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.client.food LIKE :name AND timeOffer.status= 'active'")
@Transactional(readOnly = true)
List<TimeOffer> findTimeOfferByClientFood(String name);
@Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.client.municipio =:municipio AND timeOffer.status= 'active'")
@Transactional(readOnly = true)
List<TimeOffer> findTimeOfferByClientPlace(Municipio municipio);
}

View file

@ -7,9 +7,11 @@ 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.ReviewClient;
import org.springframework.cheapy.model.Usuario;
import org.springframework.cheapy.repository.ClientRepository;
import org.springframework.cheapy.repository.CodeRepository;
import org.springframework.cheapy.repository.ReviewClientRepository;
import org.springframework.dao.DataAccessException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
@ -21,11 +23,13 @@ public class ClientService {
private ClientRepository clientRepository;
private CodeRepository codeRepository;
private ReviewClientRepository reviewRepositoy;
@Autowired
public ClientService(final ClientRepository clientRepository, CodeRepository codeRepository) {
public ClientService(final ClientRepository clientRepository, CodeRepository codeRepository, ReviewClientRepository reviewRepositoy) {
this.clientRepository = clientRepository;
this.codeRepository = codeRepository;
this.reviewRepositoy = reviewRepositoy;
}
@Transactional
@ -57,4 +61,13 @@ public class ClientService {
public List<Client> findAllClient() throws DataAccessException {
return this.clientRepository.findAllClient();
}
public Integer mediaValoraciones(Client client) {
List<ReviewClient> valoraciones =this.reviewRepositoy.findAllReviewClientByBar(client);
if(valoraciones.size()!=0) {
return Integer.valueOf( (int) valoraciones.stream().mapToInt(x->x.getStars()).average().getAsDouble());
}else {
return 0;
}
}
}

View file

@ -5,6 +5,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.FoodOffer;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.StatusOffer;
import org.springframework.cheapy.repository.FoodOfferRepository;
import org.springframework.dao.DataAccessException;
@ -45,14 +46,18 @@ public class FoodOfferService {
public List<FoodOffer> findFoodOfferActOclByUserId(final int id) {
return this.foodOfferRepository.findFoodOfferActOclByUserId(id);
}
public List<FoodOffer> findFoodOfferByClientName(String name) {
String nameEdit = "%"+name+"%";
public List<FoodOffer> findFoodOfferByClientName(final String name) {
String nameEdit = "%" + name + "%";
return this.foodOfferRepository.findFoodOfferByClientName(nameEdit);
}
public List<FoodOffer> findFoodOfferByClientFood(String name) {
String nameEdit = "%"+name+"%";
public List<FoodOffer> findFoodOfferByClientFood(final String name) {
String nameEdit = "%" + name + "%";
return this.foodOfferRepository.findFoodOfferByClientFood(nameEdit);
}
public List<FoodOffer> findFoodOfferByClientPlace(final Municipio municip) {
return this.foodOfferRepository.findFoodOfferByClientPlace(municip);
}
}

View file

@ -4,6 +4,7 @@ package org.springframework.cheapy.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.NuOffer;
import org.springframework.cheapy.model.StatusOffer;
import org.springframework.cheapy.repository.NuOfferRepository;
@ -54,14 +55,18 @@ public class NuOfferService {
public List<NuOffer> findNuOfferActOclByUserId(final int id) {
return this.nuOfferRepository.findNuOfferActOclByUserId(id);
}
public List<NuOffer> findNuOfferByClientName(String name) {
String nameEdit = "%"+name+"%";
public List<NuOffer> findNuOfferByClientName(final String name) {
String nameEdit = "%" + name + "%";
return this.nuOfferRepository.findNuOfferByClientName(nameEdit);
}
public List<NuOffer> findNuOfferByClientFood(String name) {
String nameEdit = "%"+name+"%";
public List<NuOffer> findNuOfferByClientFood(final String name) {
String nameEdit = "%" + name + "%";
return this.nuOfferRepository.findNuOfferByClientFood(nameEdit);
}
public List<NuOffer> findNuOfferByClientPlace(final Municipio mun) {
return this.nuOfferRepository.findNuOfferByClientPlace(mun);
}
}

View file

@ -0,0 +1,41 @@
package org.springframework.cheapy.service;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.Client;
import org.springframework.cheapy.model.Review;
import org.springframework.cheapy.model.ReviewClient;
import org.springframework.cheapy.repository.ReviewClientRepository;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@Service
public class ReviewClientService {
private ReviewClientRepository repo;
@Autowired
public ReviewClientService(ReviewClientRepository repo) {
super();
this.repo = repo;
}
@Transactional
public void saveReview(final ReviewClient entity) {
this.repo.save(entity);
}
@Transactional
public List<ReviewClient> findByClient(String idClient){
return this.repo.findByBar(idClient);
}
public ReviewClient findReviewById(int reviewId) {
return this.repo.findReviewClientById(reviewId);
}
public List<ReviewClient> findAllReviewsByBar(Pageable p, Client client) {
return this.repo.findAllReviewClientByBar(p, client);
}
}

View file

@ -4,6 +4,7 @@ package org.springframework.cheapy.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.SpeedOffer;
import org.springframework.cheapy.model.StatusOffer;
import org.springframework.cheapy.repository.SpeedOfferRepository;
@ -49,14 +50,18 @@ public class SpeedOfferService {
public List<SpeedOffer> findSpeedOfferActOclByUserId(final int id) {
return this.speedOfferRepository.findSpeedOfferActOclByUserId(id);
}
public List<SpeedOffer> findSpeedOfferByClientName(String name) {
String nameEdit = "%"+name+"%";
public List<SpeedOffer> findSpeedOfferByClientName(final String name) {
String nameEdit = "%" + name + "%";
return this.speedOfferRepository.findSpeedOfferByClientName(nameEdit);
}
public List<SpeedOffer> findSpeedOfferByClientFood(String name) {
String nameEdit = "%"+name+"%";
public List<SpeedOffer> findSpeedOfferByClientFood(final String name) {
String nameEdit = "%" + name + "%";
return this.speedOfferRepository.findSpeedOfferByClientFood(nameEdit);
}
public List<SpeedOffer> findSpeedOfferByClientPlace(final Municipio mun) {
return this.speedOfferRepository.findSpeedOfferByClientPlace(mun);
}
}

View file

@ -4,6 +4,7 @@ package org.springframework.cheapy.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cheapy.model.Municipio;
import org.springframework.cheapy.model.StatusOffer;
import org.springframework.cheapy.model.TimeOffer;
import org.springframework.cheapy.repository.TimeOfferRepository;
@ -45,14 +46,18 @@ public class TimeOfferService {
public List<TimeOffer> findTimeOfferActOclByUserId(final int id) {
return this.timeOfferRepository.findTimeOfferActOclByUserId(id);
}
public List<TimeOffer> findTimeOfferByClientName(String name) {
String nameEdit = "%"+name+"%";
public List<TimeOffer> findTimeOfferByClientName(final String name) {
String nameEdit = "%" + name + "%";
return this.timeOfferRepository.findTimeOfferByClientName(nameEdit);
}
public List<TimeOffer> findTimeOfferByClientFood(String name) {
String nameEdit = "%"+name+"%";
public List<TimeOffer> findTimeOfferByClientFood(final String name) {
String nameEdit = "%" + name + "%";
return this.timeOfferRepository.findTimeOfferByClientFood(nameEdit);
}
public List<TimeOffer> findTimeOfferByClientPlace(final Municipio mun) {
return this.timeOfferRepository.findTimeOfferByClientPlace(mun);
}
}

View file

@ -161,9 +161,11 @@ public class ClientController {
}
@GetMapping(value = "/restaurant/{clientId}")
public String showRestaurant(final ModelMap model, @PathVariable("clientId") Integer id) {
Client client = this.clientRepo.findById(id).get();
Integer valoraciones=this.clientService.mediaValoraciones(client);
model.put("client", client);
model.put("reviews", valoraciones);
return "clients/restaurantShow";
}
}

View file

@ -2,12 +2,14 @@
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;
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;
@ -55,15 +57,18 @@ public class OfertaController {
model.put("speedOfferLs", speedOfferLs);
model.put("timeOfferLs", timeOfferLs);
// Añade la lista de municipios al desplegable
model.put("municipios", Municipio.values());
//Se añade formateador de fecha al modelo
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
return "offers/offersList";
}
@GetMapping("/offersByName")
public String processFindFormByName(final Map<String, Object> model, String name) {
public String processFindFormByName(final Map<String, Object> model, final String name) {
List<FoodOffer> foodOfferLs = this.foodOfferService.findFoodOfferByClientName(name);
List<NuOffer> nuOfferLs = this.nuOfferService.findNuOfferByClientName(name);
@ -74,15 +79,18 @@ public class OfertaController {
model.put("speedOfferLs", speedOfferLs);
model.put("timeOfferLs", timeOfferLs);
// Añade la lista de municipios al desplegable
model.put("municipios", Municipio.values());
//Se añade formateador de fecha al modelo
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
return "offers/offersListSearch";
}
@GetMapping("/offersByFood")
public String processFindFormByFood(final Map<String, Object> model, String name) {
public String processFindFormByFood(final Map<String, Object> model, final String name) {
List<FoodOffer> foodOfferLs = this.foodOfferService.findFoodOfferByClientFood(name);
List<NuOffer> nuOfferLs = this.nuOfferService.findNuOfferByClientFood(name);
@ -93,6 +101,43 @@ public class OfertaController {
model.put("speedOfferLs", speedOfferLs);
model.put("timeOfferLs", timeOfferLs);
// Añade la lista de municipios al desplegable
model.put("municipios", Municipio.values());
//Se añade formateador de fecha al modelo
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
return "offers/offersListSearch";
}
@GetMapping("/offersByPlace")
public String processFindFormByPlace(final Map<String, Object> model, final HttpServletRequest request) {
if (request.getParameter("municipio").equals("") || request.getParameter("municipio").equals(null)) {
// Añade la lista de municipios al desplegable
model.put("municipios", Municipio.values());
//Se añade formateador de fecha al modelo
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
return "redirect:/offers/";
}
Municipio mun = Municipio.valueOf(request.getParameter("municipio"));
List<FoodOffer> foodOfferLs = this.foodOfferService.findFoodOfferByClientPlace(mun);
List<NuOffer> nuOfferLs = this.nuOfferService.findNuOfferByClientPlace(mun);
List<SpeedOffer> speedOfferLs = this.speedOfferService.findSpeedOfferByClientPlace(mun);
List<TimeOffer> timeOfferLs = this.timeOfferService.findTimeOfferByClientPlace(mun);
model.put("foodOfferLs", foodOfferLs);
model.put("nuOfferLs", nuOfferLs);
model.put("speedOfferLs", speedOfferLs);
model.put("timeOfferLs", timeOfferLs);
// Añade la lista de municipios al desplegable
model.put("municipios", Municipio.values());
//Se añade formateador de fecha al modelo
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
@ -126,7 +171,7 @@ public class OfertaController {
return "offers/offersCreate";
}
// @GetMapping("/owners/{ownerId}/edit")
// public String initUpdateOwnerForm(@PathVariable("ownerId") int ownerId, Model model) {
// Owner owner = this.ownerService.findOwnerById(ownerId);

View file

@ -0,0 +1,139 @@
package org.springframework.cheapy.web;
import java.util.List;
import java.util.Map;
import javax.validation.Valid;
import org.springframework.cheapy.model.Client;
import org.springframework.cheapy.model.Review;
import org.springframework.cheapy.model.ReviewClient;
import org.springframework.cheapy.model.User;
import org.springframework.cheapy.service.ClientService;
import org.springframework.cheapy.service.ReviewClientService;
import org.springframework.cheapy.service.UserService;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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 net.bytebuddy.asm.Advice.This;
@Controller
public class ReviewClientController {
private static final String VIEWS_REVIEWS_CREATE_OR_UPDATE_FORM = "reviewsClient/createOrUpdateReviewForm";
private final ReviewClientService reviewService;
private final UserService userService;
private final ClientService clientService;
public ReviewClientController(ReviewClientService reviewService, UserService userService, ClientService clientService) {
super();
this.clientService = clientService;
this.reviewService = reviewService;
this.userService = userService;
}
private boolean checkIdentity(final int reviewId) {
boolean res = false;
User user = this.userService.getCurrentUser();
ReviewClient review = this.reviewService.findReviewById(reviewId);
User reviewsAuthor = review.getEscritor();
if (user.equals(reviewsAuthor)) {
res = true;
}
return res;
}
private boolean checkClient(final String client) {
User user = this.userService.getCurrentUser();
Client bar = this.clientService.findByUsername(client);
return (bar == null||user==null)? false: true;
}
@GetMapping("/reviewsClient/new/{idClient}")
public String initCreationForm(final Map<String, Object> model, @PathVariable("idClient") final String idClient) {
if(!checkClient(idClient)) {
return "error";
}
ReviewClient review = new ReviewClient();
model.put("review", review);
return ReviewClientController.VIEWS_REVIEWS_CREATE_OR_UPDATE_FORM;
}
@PostMapping("/reviewsClient/new/{idClient}")
public String processCreationForm(@Valid final ReviewClient review, @PathVariable("idClient") final String idClient,final BindingResult result) {
if (result.hasErrors()) {
return ReviewClientController.VIEWS_REVIEWS_CREATE_OR_UPDATE_FORM;
} else {
User escritor = this.userService.getCurrentUser();
review.setEscritor(escritor);
Client bar = this.clientService.findByUsername(idClient);
review.setBar(bar);
this.reviewService.saveReview(review);
return "redirect:/reviewsClient/" + review.getId();
}
}
@GetMapping("/reviewsClient/{reviewId}")
public String processShowForm(@PathVariable("reviewId") final int reviewId, final Map<String, Object> model) {
ReviewClient review = this.reviewService.findReviewById(reviewId);
model.put("review", review);
return "reviewsClient/reviewsShow";
}
@GetMapping("/reviewsClientList/{idClient}/{page}")
public String processFindForm(@PathVariable("page") final int page, @PathVariable("idClient") final String idClient, final Map<String, Object> model) {
Pageable elements = PageRequest.of(page, 6);
Client client = this.clientService.findByUsername(idClient);
List<ReviewClient> reviewsLs = this.reviewService.findAllReviewsByBar(elements,client);
model.put("reviewsLs", reviewsLs);
model.put("client", idClient);
return "reviewsClient/reviewsList";
}
@GetMapping("/reviewsClient/{reviewId}/edit")
public String updateReviewInit(@PathVariable("reviewId") final int reviewId, final ModelMap model) {
if (!this.checkIdentity(reviewId)) {
return "error";
}
ReviewClient review = this.reviewService.findReviewById(reviewId);
model.addAttribute("review", review);
return ReviewClientController.VIEWS_REVIEWS_CREATE_OR_UPDATE_FORM;
}
@PostMapping("/reviewsClient/{reviewId}/edit")
public String updateReviewPost(@Valid final ReviewClient reviewEdit, final BindingResult result, final ModelMap model) {
if (!this.checkIdentity(reviewEdit.getId())) {
return "error";
}
if (result.hasErrors()) {
model.addAttribute("review", reviewEdit);
return ReviewClientController.VIEWS_REVIEWS_CREATE_OR_UPDATE_FORM;
} else {
Client bar = this.reviewService.findReviewById(reviewEdit.getId()).getBar();
User escritor = this.userService.getCurrentUser();
reviewEdit.setEscritor(escritor);
reviewEdit.setBar(bar);
this.reviewService.saveReview(reviewEdit);
return "redirect:/reviewsClient/" + reviewEdit.getId();
}
}
}

View file

@ -227,6 +227,7 @@ img.img-responsive{
.btn-filter{
background: rgb(40, 140, 215);
color: white;
border: none;
}
.btn-filter:hover{
@ -237,6 +238,14 @@ img.img-responsive{
.btn-filter-active{
background: rgb(0, 64, 128);
color: white;
border: none;
}
.select-municipio{
padding:10px;
border:solid;
border-color: rgb(0, 64, 128);
}
@ -246,6 +255,47 @@ img.img-responsive{
}
.btn-mas{
background: rgb(40, 140, 215);
color: white;
padding: 10px;
margin:10px;
border: none;
}
.btn-mas:hover{
background: rgb(0, 64, 128);
color: white;
}
.btn-pag{
background: rgb(40, 140, 215);
color: white;
padding: 10px;
margin:10px;
border: none;
}
.btn-pag:hover{
background: rgb(0, 64, 128);
color: white;
}
.btn-search{
background: rgb(40, 140, 215);
color: white;
padding: 5px;
margin:10px;
border: none;
border-radius: 30%;
}
.btn-search:hover{
background: rgb(0, 64, 128);
color: white;
}
.btn-home {
display: flex;
justify-content: center;
@ -339,24 +389,28 @@ img.img-responsive{
}
#foodOfferTable th {
width: 20%;
width: 15%;
text-align: center;
}
#nuOfferTable th {
width: 20%;
width: 15%;
text-align: center;
vertical-align: middle;
}
#speedOfferTable th {
width: 20%;
width: 15%;
text-align: center;
vertical-align: middle;
}
#timeOfferTable th {
width: 20%;
width: 15%;
text-align: center;
vertical-align: middle;
}
.btn-detalles button {
@ -642,3 +696,4 @@ hr {
@import "typography.less";
@import "header.less";
@import "responsive.less";
@import "starRating.less"

View file

@ -0,0 +1,40 @@
.rating {
display: flex;
flex-direction: row-reverse;
justify-content: flex-end
}
.rating>input {
display: none
}
.rating>label {
position: relative;
width: 1em;
font-size: 200%;
color: #FFD600;
cursor: pointer
}
.rating>label::before {
content: "\2605";
position: absolute;
opacity: 0
}
.rating>label:hover:before,
.rating>label:hover~label:before {
opacity: 1 !important
}
.rating>input:checked~label:before {
opacity: 1
}
.rating:hover>input:checked~label:before {
opacity: 0.4
}

View file

@ -14,18 +14,18 @@ INSERT INTO users (username,password,enabled) VALUES ('pepe','pepe', TRUE );
INSERT INTO authorities (username,authority) VALUES ('pepe','usuario');
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 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, food, username, code) VALUES (1,'bar manoli','manoli@gmail.com','C/Betis', 'sevilla','10:00','22:00','608726190', 'description 1', 'ESPAÑOLA','manoli', 'code1');
INSERT INTO clients (id, name, email, address, municipio, init, finish, telephone, description, food, username, code) VALUES (2,'bar david','david@gmail.com','C/Sevilla', 'dos_hermanas','09:30','22:00','608726190', 'description 2', 'americana','david', 'code2');
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);
@ -63,3 +63,14 @@ INSERT INTO nu_offers(start, end, code, status, client_id, gold, discount_gold,
INSERT INTO nu_offers(start, end, code, status, client_id, gold, discount_gold, silver, discount_silver, bronze, discount_bronze) VALUES ('2021-08-15 12:00:00', '2021-08-16 12:00:00', 'NU-6', 'active',2,20,30,15,10,10,5);
INSERT INTO nu_offers(start, end, code, status, client_id, gold, discount_gold, silver, discount_silver, bronze, discount_bronze) VALUES ('2021-08-15 12:00:00', '2021-08-16 12:00:00', 'NU-7', 'active',2,20,35,15,15,10,5);
INSERT INTO nu_offers(start, end, code, status, client_id, gold, discount_gold, silver, discount_silver, bronze, discount_bronze) VALUES ('2021-08-16 12:00:00', '2021-08-17 12:00:00', null, 'hidden',1,15,25,10,15,5,10);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('Es un bar muy bueno para ir a comer',5,'paco',1);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('Las ofertas eran buenas pero el servicio mejorable',2,'lolo',1);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('Nos trataron genial a mi y a mi amigo',4,'pepe',1);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('Abren a todas horas!!!',5,'paco',1);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('La comida de hoy estaba muy rica',4,'lolo',1);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('Recomiendo ir por la noche, tiene muy buenas vistas',4,'pepe',1);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('No retrasmiten futbol',1,'pepe',1);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('Un sitio perfecto para llevar a tu pareja',5,'paco',2);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('En hora punta nunca hay sitio',2,'lolo',2);
INSERT INTO review_client(opinion, stars, username, client ) VALUES ('Fui una vez por probar y ahora voy todas las tardes',4,'pepe',2);

View file

@ -1,10 +1,73 @@
welcome=Welcome to
listOffers=List Offers
required=is required
notFound=has not been found
duplicate=is already in use
nonNumeric=must be all numeric
duplicateFormSubmission=Duplicate form submission is not allowed
typeMismatch.date=invalid date
typeMismatch.birthDate=invalid date
welcome=Bienvenido a
new=Nuevo
deleteOffer=Eliminar Oferta
cancel=Cancelar
deleteOfferMessage=Confirme que quiere eliminar su oferta
listOffers=Ver Ofertas
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 por tiempo empleado en comer
speedOffer=Oferta por tiempo empleado en comer
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 de inicio
offerBeginning=Inicio de la oferta
endDate=Fecha de fin
offerEnding=Fin de la oferta
details=Detalles
offerCode=Código de la oferta
return=Volver
required=Es requerido
notFound=No ha sido encontrado
duplicate=Ya se encuentra en uso
nonNumeric=Solo debe contener números
duplicateFormSubmission=No se permite el envío de formularios duplicados
typeMismatch.date=Fecha inválida
typeMismatch.birthDate=Fecha inválida
review= Reseña
reviews= Reseñas
stars= Estrellas
opinion= Opinión
user = Nombre de usuario
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
init= Inicio del intervalo
finishOffer= Fin del intervalo
name= Nombre del bar/restaurante
status= Estado de oferta
myOffers= Ver mis Ofertas
typeMismatch=Debe ser del formato correcto
typeMismatch.java.lang.Integer=Debe ser un número
typeMismatch.java.time.LocalDateTime=Debe ser una fecha válida
typeMismatch.java.time.LocalTime=Debe ser una hora válida
clientShow= Información del bar/restaurante
client= Cliente
clients= Clientes
email=Dirección de correo electrónico
addressClient= Dirección del bar/restaurante
addressUser= Dirección del usuario
telephone= Número de teléfono
descriptionClient= Descripción del bar/restaurante
foodClient= Tipo de comida
enabled= ¿Está activo el usuario?
users=Usuarios
nameUser=Nombre
surname= Apellidos
dni= DNI
usuario=Usuario
municipio=Municipio

View file

@ -1,73 +0,0 @@
welcome=Bienvenido a
new=Nueva
deleteOffer=Eliminar Oferta
cancel=Cancelar
deleteOfferMessage=Confirme que quiere eliminar su oferta
listOffers=Ver Ofertas
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 por tiempo empleado en comer
speedOffer=Oferta por tiempo empleado en comer
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 de inicio
offerBeginning=Inicio de la oferta
endDate=Fecha de fin
offerEnding=Fin de la oferta
details=Detalles
offerCode=Código de la oferta
return=Volver
required=Es requerido
notFound=No ha sido encontrado
duplicate=Ya se encuentra en uso
nonNumeric=Solo debe contener números
duplicateFormSubmission=No se permite el envío de formularios duplicados
typeMismatch.date=Fecha inválida
typeMismatch.birthDate=Fecha inválida
review= Reseña
reviews= Reseñas
stars= Estrellas
opinion= Opinión
user = Nombre de usuario
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
init= Inicio del intervalo
finishOffer= Fin del intervalo
name= Nombre del bar/restaurante
status= Estado de oferta
myOffers= Ver mis Ofertas
typeMismatch=Debe ser del formato correcto
typeMismatch.java.lang.Integer=Debe ser un número
typeMismatch.java.time.LocalDateTime=Debe ser una fecha válida
typeMismatch.java.time.LocalTime=Debe ser una hora válida
clientShow= Información del bar/restaurante
client= Cliente
clients= Clientes
email=Dirección de correo electrónico
addressClient= Dirección del bar/restaurante
addressUser= Dirección del usuario
telephone= Número de teléfono
descriptionClient= Descripción del bar/restaurante
foodClient= Tipo de comida
enabled= ¿Está activo el usuario?
users=Usuarios
nameUser=Nombre
surname= Apellidos
dni= DNI
usuario=Usuario
municipio=Municipio

View file

@ -5,11 +5,13 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="client">
<jsp:body>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere activar esta cuenta?</em></h2>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere activar esta cuenta?</em></h2>
<form:form modelAttribute="client" class="form-horizontal">

View file

@ -5,11 +5,13 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="client">
<jsp:body>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su cuenta?</em></h2>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su cuenta?</em></h2>
<form:form modelAttribute="client" class="form-horizontal">

View file

@ -5,11 +5,12 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="client">
<h2 style="text-align:center;padding:5px"><fmt:message key="client"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="client"/></h2>

View file

@ -5,10 +5,11 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="clients">
<h2 style="text-align:center;padding:5px"><fmt:message key="clients"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="clients"/></h2>
<c:if test="${empty clientLs }">
<p id="vacio" >No hay ningun Cliente.</p>

View file

@ -5,33 +5,36 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="clients">
<h2 style="text-align:center;padding:5px">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<fmt:message key="client"/>
</h2>
<form:form modelAttribute="client" class="form-horizontal" id="add-client-form">
<div class="form-group has-feedback">
<cheapy:passwordField label="Contraseña" placeholder="Restaurante pepito" name="usuar.password"/>
<cheapy:passwordField label="Contrase<EFBFBD>a" placeholder="Restaurante pepito" name="usuar.password"/>
<cheapy:inputField label="Hora de inicio" placeholder="HH:mm" name="init"/>
<cheapy:inputField label="Hora de fin" placeholder="HH:mm" name="finish"/>
<cheapy:inputField label="Nombre" placeholder="Restaurante pepito" name="name"/>
<cheapy:inputField label="Email" placeholder="" name="email"/>
<cheapy:inputField label="Dirección" placeholder="" name="address"/>
<div class="form-group">
<label>Municipio: </label>
<select name="municipio">
<c:forEach items="${municipio}" var="entry">
<option value="${entry}">${entry}</option>
</c:forEach>
</select>
</div>
<cheapy:inputField label="Teléfono" placeholder="" name="telephone"/>
<cheapy:inputField label="descripción" placeholder="" name="description"/>
<cheapy:inputField label="Direcci<63>n" placeholder="" name="address"/>
<cheapy:inputField label="Tel<65>fono" placeholder="" name="telephone"/>
<cheapy:inputField label="descripci<63>n" placeholder="" name="description"/>
<cheapy:inputField label="Comida" placeholder="food" name="food"/>
<div class="form-group">
<label class="col-sm-2 control-label">Municipio: </label>
<div class="col-sm-10">
<select name="municipio" class="select-municipio" style="width:80%;text-align-last:center;">
<c:forEach items="${municipio}" var="entry">
<option value="${entry}">${entry.toString()}</option>
</c:forEach>
</select>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">

View file

@ -5,11 +5,12 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="client">
<h2 style="text-align:center;padding:5px"><fmt:message key="client"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="client"/></h2>
@ -44,15 +45,36 @@
</tr><tr>
<th><fmt:message key="foodClient"/></th>
<td><c:out value="${client.food}%"/> </td>
</tr>
</thead>
</table>
<div style="font-size: 150%" >
<fmt:message key="reviews"/>
<cheapy:showStars value="${reviews}"></cheapy:showStars>
</div>
<div class="btn-menu">
</div>
<div class="text-left">
<spring:url value="/reviewsClientList/{client}/0" var="reviewsListUrl">
<spring:param name="client" value="${client.usuar.username}"/>
</spring:url>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(reviewsListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
Valoraciones</button>
<sec:authorize access="hasAnyAuthority('usuario')">
<spring:url value="/reviewsClient/new/{client}/" var="reviewsCreateUrl">
<spring:param name="client" value="${client.usuar.username}"/>
</spring:url>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(reviewsCreateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
Valorar</button>
</sec:authorize>
</div>
</div>
</cheapy:layout>

View file

@ -1,7 +1,7 @@
<%@ page session="false" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<cheapy:layout pageName="error">
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>Algo malo ha pasado...</em></h2>

View file

@ -5,6 +5,7 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
@ -284,7 +285,7 @@
<div class="fadeIn first">
<img src="/resources/images/Logo Cheapy.png" id="icon" />
<c:if test= "${not empty param}" >
<p class="text-danger"> El usuario y/o la contraseña son incorrectos </p>
<p class="text-danger"> El usuario y/o la contraseña son incorrectos </p>
</c:if>
</div>
@ -292,16 +293,16 @@
<!-- Login Form -->
<form class='form-signin' action="/login" method='POST'>
<input type="text" id="username" class="fadeIn second" name="username" placeholder="Usuario" required autofocus>
<input type="password" id="password" class="fadeIn third" name="password" placeholder="Contraseña" required>
<input type="password" id="password" class="fadeIn third" name="password" placeholder="Contraseña" required>
<sec:csrfInput />
<div style="text-align: center;">
<input type="submit" class="fadeIn fourth" value="Iniciar sesión">
<input type="submit" class="fadeIn fourth" value="Iniciar sesión">
</div>
</form>
<!-- Remind Passowrd
<div id="formFooter">
<a class="underlineHover" href="#">¿Olvidó su contraseña?</a>
<a class="underlineHover" href="#">¿Olvidó su contraseña?</a>
</div>
-->
</div>

View file

@ -5,10 +5,11 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="foodOffers">
<h2 style="text-align:center;padding:5px">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<c:if test="${foodOffer['new']}"><fmt:message key="new"/> </c:if> <fmt:message key="foodOffer"/>
</h2>

View file

@ -5,11 +5,13 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="foodOffer">
<jsp:body>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
<form:form modelAttribute="foodOffer" class="form-horizontal">

View file

@ -5,6 +5,7 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertas de plato especifico">
@ -42,10 +43,10 @@
</div>
</div>
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="foodOffers"/>:</h2>
<c:if test="${empty foodOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato espec<EFBFBD>fico activa.</p>
<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">
@ -57,6 +58,7 @@
<th><fmt:message key="discount"/></th>
<th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="municipio"/></th>
<th> </th>
</tr>
@ -79,6 +81,9 @@
<td>
<c:out value="${localDateTimeFormat.format(foodOffer.end)}"/>
</td>
<td>
<c:out value="${foodOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/food/{foodOfferId}" var="foodOfferUrl">
@ -95,23 +100,33 @@
</c:forEach>
</tbody>
</table>
<div class="text-center">
<c:out value='Página ${page}'></c:out>
</div>
<div>
<c:if test='${page!=0}'>
<div class="text-left">
<spring:url value="/offers/foodOfferList/{page}" var="foodOfferListUrl">
<spring:param name="page" value="${page-1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
P<>g. anterior</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
Pág. anterior</button>
</div>
</c:if>
<c:out value='${page}'></c:out>
<c:if test="${fn:length(foodOfferLs) == 5}">
<div class="text-right">
<spring:url value="/offers/foodOfferList/{page}" var="foodOfferListUrl">
<spring:param name="page" value="${page+1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
P<>g. siguiente</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-right" aria-hidden="true" style="padding: 5px"> </span>
Pág. siguiente</button>
</div>
</c:if>
</div>
</c:if>
</cheapy:layout>

View file

@ -5,16 +5,22 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="foodOffer">
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffer"/></h2>
<h2 style="font-family: 'Lobster'; text-align:left; font-size:200%; color: rgb(0, 64, 128); padding:10px; margin-bottom:20px;"><fmt:message key="foodOffer"/>:</h2>
<table class="table table-striped" id="foodOfferTable">
<thead>
<tr>
<th><fmt:message key="client"/></th>
<td><c:out value="${foodOffer.client.name}"/> </td>
</tr>
<tr>
<th><fmt:message key="offerBeginning"/></th>
<td><c:out value="${localDateTimeFormat.format(foodOffer.start)}"/></td>
@ -31,6 +37,10 @@
<th><fmt:message key="discount"/></th>
<td><c:out value="${foodOffer.discount}%"/> </td>
</tr>
<tr>
<th><fmt:message key="municipio"/></th>
<td><c:out value="${foodOffer.client.municipio}"/> </td>
</tr>
<tr>
<th><fmt:message key="offerCode"/></th>

View file

@ -4,12 +4,16 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertasM">
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="foodOffers"/>:</h2>
<c:if test="${empty foodOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico creada.</p>
<p id="vacio" >No hay ninguna oferta por plato específico creada.</p>
</c:if>
<c:if test="${not empty foodOfferLs }">
<div class="table-responsive">
@ -21,6 +25,7 @@
<th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="status"/></th>
<th><fmt:message key="municipio"/></th>
<th> <spring:url value="/offers/food/new" var="newFoodUrl">
</spring:url>
<!-- <a href="${fn:escapeXml(newFoodUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
@ -41,6 +46,9 @@
<td>
<c:out value="${foodOffer.status}"/>
</td>
<td>
<c:out value="${foodOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/food/{foodOfferId}" var="foodOfferUrl">
<spring:param name="foodOfferId" value="${foodOffer.id}"/>
@ -58,9 +66,9 @@
</table>
</div>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="nuOffers"/>:</h2>
<c:if test="${empty nuOfferLs }">
<p id="vacio" >No hay ninguna oferta por número de comensales creada.</p>
<p id="vacio" >No hay ninguna oferta por número de comensales creada.</p>
</c:if>
<c:if test="${not empty nuOfferLs }">
<div class="table-responsive">
@ -71,6 +79,7 @@
<th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="status"/></th>
<th><fmt:message key="municipio"/></th>
<th> <spring:url value="/offers/nu/new" var="newNuUrl">
</spring:url>
<!-- <a href="${fn:escapeXml(newNuUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
@ -90,6 +99,9 @@
<td>
<c:out value="${nuOffer.status}"/>
</td>
<td>
<c:out value="${nuOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/nu/{nuOfferId}" var="nuOfferUrl">
<spring:param name="nuOfferId" value="${nuOffer.id}"/>
@ -107,7 +119,7 @@
</div>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="speedOffers"/>:</h2>
<c:if test="${empty speedOfferLs }">
<p id="vacio" >No hay ninguna oferta por tiempo empleado en comer creada.</p>
</c:if>
@ -120,6 +132,7 @@
<th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="status"/></th>
<th><fmt:message key="municipio"/></th>
<th> <spring:url value="/offers/speed/new" var="newSpeedUrl">
</spring:url>
<!-- <a href="${fn:escapeXml(newSpeedUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
@ -139,6 +152,9 @@
<td>
<c:out value="${speedOffer.status}"/>
</td>
<td>
<c:out value="${speedOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/speed/{speedOfferId}" var="speedOfferUrl">
<spring:param name="speedOfferId" value="${speedOffer.id}"/>
@ -157,7 +173,7 @@
</div>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="timeOffers"/>:</h2>
<c:if test="${empty timeOfferLs }">
<p id="vacio" >No hay ninguna oferta por franja horaria creada.</p>
</c:if>
@ -170,6 +186,7 @@
<th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="status"/></th>
<th><fmt:message key="municipio"/></th>
<th><spring:url value="/offers/time/new" var="newTimeUrl">
</spring:url>
<!--<a href="${fn:escapeXml(newTimeUrl)}" class="btn btn-default">Nueva oferta</a> </th>-->
@ -188,6 +205,9 @@
<td>
<c:out value="${timeOffer.status}"/>
</td>
<td>
<c:out value="${timeOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/time/{timeOfferId}" var="timeOfferUrl">
<spring:param name="timeOfferId" value="${timeOffer.id}"/>

View file

@ -5,6 +5,7 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
@ -32,7 +33,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/2.4.4/js/bootstrap-datetimepicker.min.js"></script>
<cheapy:layout pageName="NumOffers">
<h2 style="text-align:center;padding:5px">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<c:if test="${nuOffer['new']}"><fmt:message key="new"/> </c:if> <fmt:message key="nuOffer"/>
</h2>
@ -66,11 +67,11 @@
<cheapy:inputField label="Fecha de Inicio" placeholder="dd/MM/yyyy HH:mm" name="start"/>
<cheapy:inputField label="Fecha de Fin" placeholder="dd/MM/yyyy HH:mm" name="end"/>
<cheapy:inputField label="Número de comensales (nivel Oro)" placeholder="XX (Ej. 6)" name="gold"/>
<cheapy:inputField label="Número de comensales (nivel Oro)" placeholder="XX (Ej. 6)" name="gold"/>
<cheapy:inputField label="Descuento de nivel oro" placeholder="XX% (Ej. 30)" name="discountGold"/>
<cheapy:inputField label="Número de comensales (nivel Plata)" placeholder="XX (Ej. 4)" name="silver"/>
<cheapy:inputField label="Número de comensales (nivel Plata)" placeholder="XX (Ej. 4)" name="silver"/>
<cheapy:inputField label="Descuento de plata" placeholder="XX% (Ej. 15)" name="discountSilver"/>
<cheapy:inputField label="Número de comensales (nivel Bronce)" placeholder="XX (Ej. 2)" name="bronze"/>
<cheapy:inputField label="Número de comensales (nivel Bronce)" placeholder="XX (Ej. 2)" name="bronze"/>
<cheapy:inputField label="Descuento de bronce" placeholder="XX% (Ej. 5)" name="discountBronze"/>
</div>

View file

@ -5,11 +5,14 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="nuOfferDisable">
<jsp:body>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
<form:form modelAttribute="nuOffer" class="form-horizontal">

View file

@ -5,6 +5,7 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertas por numero de comensales">
@ -15,7 +16,7 @@
</spring:url>
<button type="button" role="link" class="btn-filter" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
Ofertas de plato especifico</button>
Ofertas de plato específico</button>
<spring:url value="/offers/nuOfferList/{page}" var="nuOfferListUrl">
<spring:param name="page" value="0"/>
@ -40,9 +41,9 @@
</div>
</div>
<h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="nuOffers"/>:</h2>
<c:if test="${empty nuOfferLs }">
<p id="vacio" >No hay ninguna oferta por n<EFBFBD>mero de comensales activa.</p>
<p id="vacio" >No hay ninguna oferta por número de comensales activa.</p>
</c:if>
<c:if test="${not empty nuOfferLs }">
<table id="nuOfferTable" class="table table-striped">
@ -90,22 +91,31 @@
</c:forEach>
</tbody>
</table>
<c:if test='${page!=0}'>
<div class="text-center">
<c:out value='Página ${page}'></c:out>
</div>
<c:if test='${page!=0}'>
<div class="text-left">
<spring:url value="/offers/nuOfferList/{page}" var="nuOfferListUrl">
<spring:param name="page" value="${page-1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(nuOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
P<>g. anterior</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(nuOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
Pág. anterior</button>
</div>
</c:if>
<c:out value='${page}'></c:out>
<c:if test="${fn:length(nuOfferLs) == 5}">
<div class="text-right">
<spring:url value="/offers/nuOfferList/{page}" var="nuOfferListUrl">
<spring:param name="page" value="${page+1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(nuOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
P<>g. siguiente</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(nuOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-right" aria-hidden="true" style="padding: 5px"> </span>
Pág. siguiente</button>
</div>
</c:if>
</c:if>

View file

@ -5,15 +5,20 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="nuOffer">
<h2 style="text-align: center; padding: 5px">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<fmt:message key="nuOffer" />
</h2>
<table class="table table-striped" id="nuOffer-table">
<tr>
<th><fmt:message key="client"/></th>
<td><c:out value="${nuOffer.client.name}"/> </td>
</tr>
<tr>
<th><fmt:message key="offerBeginning"/></th>
<td><c:out value="${localDateTimeFormat.format(nuOffer.start)}"/></td>
@ -50,6 +55,12 @@
<th><fmt:message key="offerCode"/></th>
<td><c:out value="${nuOffer.code}"/></td>
</tr>
<tr>
<th><fmt:message key="municipio"/></th>
<td><c:out value="${nuOffer.client.municipio}"/></td>
</tr>
</table>
<div class="btn-menu">

View file

@ -4,6 +4,7 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="crearOfertas">

View file

@ -6,6 +6,7 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertas">
@ -46,27 +47,38 @@
</div>
<form class="example" action="/offersByName">
<h2 class="text-center" style="font-size: 100%" >Búsqueda por nombre del bar/restaurante: </h2>
<h2 class="text-center" style="font-family: 'Lobster'; text-align:center; font-size:150%; color: rgb(0, 64, 128); padding:10px;" >Búsqueda por nombre del bar/restaurante: </h2>
<div class="text-center">
<input type="text" placeholder="Búsqueda por nombre" name="name">
<button type="submit"><i class="fa fa-search"></i>
<input type="text" placeholder="Búsqueda por nombre" name="name" style="border:solid; border-color: rgb(0, 64, 128);">
<button type="submit" class="btn-search"><i class="fa fa-search"></i>
<span class="glyphicon glyphicon glyphicon-search" aria-hidden="true" style="padding: 5px"> </span>
</button>
</div>
</form>
<form class="example" action="/offersByFood">
<h2 class="text-center" style="font-size: 100%" >Búsqueda por comida: </h2>
<h2 class="text-center" style="font-family: 'Lobster'; text-align:center; font-size:150%; color: rgb(0, 64, 128); padding:10px;" >Búsqueda por tipo de comida: </h2>
<div class="text-center">
<input type="text" placeholder="Búsqueda por comida (Ej: Macarrones)" name="name">
<button type="submit"><i class="fa fa-search"></i>
<input type="text" placeholder="Búsqueda por tipo comida (Ej: americana)" name="name" style="border:solid; border-color: rgb(0, 64, 128);">
<button type="submit" class="btn-search"><i class="fa fa-search"></i>
<span class="glyphicon glyphicon glyphicon-search" aria-hidden="true" style="padding: 5px"> </span>
</button>
</div>
</form>
<form class="example" action="/offersByPlace">
<div class="text-center">
<select name="municipio" class="select-municipio" >
<c:forEach items="${municipios}" var="entry">
<option value="${entry}">${entry.toString()}</option>
</c:forEach>
</select>
<button type="submit" class="btn-mas">Buscar por municipio</button>
</div>
</form>
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="foodOffers"/>:</h2>
<c:if test="${empty foodOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
@ -83,6 +95,7 @@
<th><fmt:message key="discount"/></th>
<th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="municipio"/></th>
<th> </th>
</tr>
@ -105,6 +118,9 @@
<td>
<c:out value="${localDateTimeFormat.format(foodOffer.end)}"/>
</td>
<td>
<c:out value="${foodOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/food/{foodOfferId}" var="foodOfferUrl">
@ -121,19 +137,21 @@
</c:forEach>
</tbody>
</table>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Ver más</button>
<div class="text-center">
<button type="button" class="btn-mas" role="link" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-plus" aria-hidden="true" style="padding: 5px"> </span>
Ver más</button>
</div>
</div>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="nuOffers"/>:</h2>
<c:if test="${empty nuOfferLs }">
<p id="vacio" >No hay ninguna oferta por n<EFBFBD>mero de comensales activa.</p>
<p id="vacio" >No hay ninguna oferta por número de comensales activa.</p>
</c:if>
<c:if test="${not empty nuOfferLs }">
<div class="table-responsive">
<div class="table-responsive">
<table id="nuOfferTable" class="table table-striped">
<thead>
<tr>
@ -143,6 +161,7 @@
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="goldGoal"/></th>
<th><fmt:message key="goldDiscount"/></th>
<th><fmt:message key="municipio"/></th>
<th> </th>
</tr>
@ -165,6 +184,9 @@
<td>
<c:out value="${nuOffer.discountGold}%"/>
</td>
<td>
<c:out value="${nuOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/nu/{nuOfferId}" var="nuOfferUrl">
<spring:param name="nuOfferId" value="${nuOffer.id}"/>
@ -179,14 +201,16 @@
</c:forEach>
</tbody>
</table>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(nuOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Ver más</button>
<div class="text-center">
<button type="button" class="btn-mas" role="link" onclick="window.location='${fn:escapeXml(nuOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-plus" aria-hidden="true" style="padding: 5px"> </span>
Ver más</button>
</div>
</div>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="speedOffers"/>:</h2>
<c:if test="${empty speedOfferLs }">
<p id="vacio" >No hay ninguna oferta por tiempo empleado en comer activa.</p>
</c:if>
@ -202,6 +226,7 @@
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="goldGoal"/></th>
<th><fmt:message key="goldDiscount"/></th>
<th><fmt:message key="municipio"/></th>
<th> </th>
</tr>
@ -224,6 +249,9 @@
<td>
<c:out value="${speedOffer.discountGold}%"/>
</td>
<td>
<c:out value="${speedOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/speed/{speedOfferId}" var="speedOfferUrl">
<spring:param name="speedOfferId" value="${speedOffer.id}"/>
@ -239,15 +267,17 @@
</c:forEach>
</tbody>
</table>
<spring:url value="/offers/speedOfferList" var="speedOfferUrl"></spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(speedOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Ver más</button>
<div class="text-center">
<spring:url value="/offers/speedOfferList" var="speedOfferUrl"></spring:url>
<button type="button" class="btn-mas" role="link" onclick="window.location='${fn:escapeXml(speedOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-plus" aria-hidden="true" style="padding: 5px"> </span>
Ver más</button>
</div>
</div>
</c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="timeOffers"/>:</h2>
<c:if test="${empty timeOfferLs }">
<p id="vacio" >No hay ninguna oferta por franja horaria activa.</p>
</c:if>
@ -263,6 +293,7 @@
<th><fmt:message key="endDate"/></th>
<th><fmt:message key="init"/></th>
<th><fmt:message key="finishOffer"/></th>
<th><fmt:message key="municipio"/></th>
<th> </th>
</tr>
</thead>
@ -284,6 +315,9 @@
<td>
<c:out value="${timeOffer.finish}h"/>
</td>
<td>
<c:out value="${timeOffer.client.municipio}"/>
</td>
<td>
<spring:url value="/offers/time/{timeOfferId}" var="timeOfferUrl">
@ -298,10 +332,12 @@
</tr>
</c:forEach>
</table>
<spring:url value="/offers/timeOfferList" var="timeOfferUrl"></spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(timeOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Ver más</button>
<div class="text-center">
<spring:url value="/offers/timeOfferList" var="timeOfferUrl"></spring:url>
<button type="button" class="btn-mas" role="link" onclick="window.location='${fn:escapeXml(timeOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-plus" aria-hidden="true" style="padding: 5px"> </span>
Ver más</button>
</div>
</div>
</c:if>

View file

@ -6,6 +6,7 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertas">
@ -13,7 +14,7 @@
<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>
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p>
</c:if>
<c:if test="${not empty foodOfferLs }">

View file

@ -4,10 +4,11 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertasM">
<h2 style="text-align:center;padding:5px">Registro de Ofertas</h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">Historial de Ofertas</h2>
<c:if test="${empty datos }">
<p id="vacio" >No hay ninguna oferta creada.</p>
</c:if>

View file

@ -5,10 +5,12 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="speedOffers">
<h2 style="text-align:center;padding:5px">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<c:if test="${speedOffer['new']}"><fmt:message key="new"/> </c:if> <fmt:message key="speedOffer"/>
</h2>
<form:form modelAttribute="speedOffer" class="form-horizontal" id="add-speedOffer-form">

View file

@ -5,11 +5,14 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="speedOffer">
<jsp:body>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
<form:form modelAttribute="speedOffer" class="form-horizontal">

View file

@ -5,6 +5,8 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertas por rapidez">
@ -15,7 +17,7 @@
</spring:url>
<button type="button" role="link" class="btn-filter" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
Ofertas de plato especifico</button>
Ofertas de plato específico</button>
<spring:url value="/offers/nuOfferList/{page}" var="nuOfferListUrl">
<spring:param name="page" value="0"/>
@ -39,7 +41,7 @@
Ofertas de franja horaria</button>
</div>
</div>
<h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="speedOffers"/>:</h2>
<c:if test="${empty speedOfferLs }">
<p id="vacio" >No hay ninguna oferta por tiempo empleado en comer activa.</p>
</c:if>
@ -90,22 +92,29 @@
</c:forEach>
</tbody>
</table>
<c:if test='${page!=0}'>
<div class="text-center">
<c:out value='Página ${page}'></c:out>
</div>
<c:if test='${page!=0}'>
<div class="text-right">
<spring:url value="/offers/speedOfferList/{page}" var="speedOfferListUrl">
<spring:param name="page" value="${page-1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(speedOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
P<>g. anterior</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(speedOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
Pág. anterior</button>
</div>
</c:if>
<c:out value='${page}'></c:out>
<c:if test="${fn:length(speedOfferLs) == 5}">
<div class="text-right">
<spring:url value="/offers/speedOfferList/{page}" var="speedOfferListUrl">
<spring:param name="page" value="${page+1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(speedOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
P<>g. siguiente</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(speedOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-right" aria-hidden="true" style="padding: 5px"> </span>
Pág. siguiente</button>
</div>
</c:if>
</c:if>
</cheapy:layout>

View file

@ -5,15 +5,21 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="speedOffer">
<h2 style="text-align: center; padding: 5px">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<fmt:message key="speedOffer" />
</h2>
<table class="table table-striped" id="speedOffer-table">
<tr>
<th><fmt:message key="client"/></th>
<td><c:out value="${speedOffer.client.name}"/> </td>
</tr>
<tr>
<th><fmt:message key="offerBeginning"/></th>
<td><c:out value="${localDateTimeFormat.format(speedOffer.start)}"/></td>
@ -50,6 +56,10 @@
<th><fmt:message key="offerCode"/></th>
<td><c:out value="${speedOffer.code}"/></td>
</tr>
<tr>
<th><fmt:message key="municipio"/></th>
<td><c:out value="${speedOffer.client.municipio}"/></td>
</tr>
</table>
<div class="btn-menu">

View file

@ -5,10 +5,11 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="TimeOffers">
<h2 style="text-align:center;padding:5px">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<c:if test="${timeOffer['new']}"><fmt:message key="new"/> </c:if> <fmt:message key="timeOffer"/>
</h2>
<form:form modelAttribute="timeOffer" class="form-horizontal" id="add-timeOffer-form">

View file

@ -5,11 +5,13 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="timeOffer">
<jsp:body>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su oferta?</em></h2>
<form:form modelAttribute="timeOffer" class="form-horizontal">

View file

@ -5,6 +5,7 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertas por intervalo de tiempo">
@ -15,7 +16,7 @@
</spring:url>
<button type="button" role="link" class="btn-filter" onclick="window.location='${fn:escapeXml(foodOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-cutlery" aria-hidden="true" style="padding: 5px"> </span>
Ofertas de plato especifico</button>
Ofertas de plato específico</button>
<spring:url value="/offers/nuOfferList/{page}" var="nuOfferListUrl">
<spring:param name="page" value="0"/>
@ -40,7 +41,7 @@
</div>
</div>
<h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="timeOffers"/>:</h2>
<c:if test="${empty timeOfferLs }">
<p id="vacio" >No hay ninguna oferta por franja horaria activa.</p>
</c:if>
@ -90,22 +91,29 @@
</c:forEach>
</tbody>
</table>
<c:if test='${page!=0}'>
<div class="text-center">
<c:out value='Página ${page}'></c:out>
</div>
<c:if test='${page!=0}'>
<div class="text-left">
<spring:url value="/offers/timeOfferList/{page}" var="timeOfferListUrl">
<spring:param name="page" value="${page-1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(timeOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
P<>g. anterior</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(timeOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
Pág. anterior</button>
</div>
</c:if>
<c:out value='${page}'></c:out>
<c:if test="${fn:length(timeOfferLs) == 5}">
<spring:url value="/offers/foodOfferList/{page}" var="timeOfferListUrl">
<div class="text-right">
<spring:url value="/offers/timeOfferList/{page}" var="timeOfferListUrl">
<spring:param name="page" value="${page+1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(timeOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
P<>g. siguiente</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(timeOfferListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-right" aria-hidden="true" style="padding: 5px"> </span>
Pág. siguiente</button>
</div>
</c:if>
</c:if>

View file

@ -5,15 +5,21 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="timeOffer">
<h2 style="text-align:center;padding:5px"><fmt:message key="timeOffer"/></h2>
<h2 style="font-family: 'Lobster'; text-align:left; font-size:200%; color: rgb(0, 64, 128); padding:10px; margin-bottom:20px;"><fmt:message key="timeOffer"/>:</h2>
<table id="timeOfferTable" class="table table-striped">
<thead>
<tr>
<th><fmt:message key="client"/></th>
<td><c:out value="${timeOffer.client.name}"/> </td>
</tr>
<tr>
<th><fmt:message key="offerBeginning"/></th>
<td><c:out value="${localDateTimeFormat.format(timeOffer.start)}"/></td>
@ -38,6 +44,10 @@
<th><fmt:message key="offerCode"/></th>
<td><c:out value="${timeOffer.code}"/></td>
</tr>
<tr>
<th><fmt:message key="municipio"/></th>
<td><c:out value="${timeOffer.client.municipio}"/> </td>
</tr>
</thead>
</table>

View file

@ -5,16 +5,19 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="reviewsN">
<h2>
<c:if test="${review['new']}">Nueva </c:if> Reseña
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<c:if test="${review['new']}">Nueva </c:if> Reseña
</h2>
<form:form modelAttribute="review" class="form-horizontal" id="add-review-form">
<div class="form-group has-feedback">
<form:hidden path="id"/>
<cheapy:textAreaField label="Opinión" name="opinion"/>
<cheapy:inputField label="Estrellas" name="stars"/>
<cheapy:textAreaField label="Opinión" name="opinion"/>
<!-- <cheapy:inputField label="Estrellas" name="stars"/> -->
<cheapy:ratingStar label="Valoración" name="stars" disabled="false"></cheapy:ratingStar>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
@ -23,10 +26,10 @@
<c:when test="${review['new']}">
<button class="btn btn-default" type="submit" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-floppy-save" aria-hidden="true" style="padding: 5px"> </span>
Crear reseña</button>
Crear reseña</button>
</c:when>
<c:otherwise>
<button class="btn btn-default" type="submit">Modificar Reseña</button>
<button class="btn btn-default" type="submit">Modificar Reseña</button>
</c:otherwise>
</c:choose>
</div>

View file

@ -4,10 +4,13 @@
<%@ 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="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="reviews">
<h2 style="text-align:center;padding:5px"><fmt:message key="reviews"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="reviews"/></h2>
<table id="reviewTable" class="table table-striped">
<thead>
@ -22,10 +25,11 @@
<tbody>
<c:choose>
<c:when test="${empty reviewsLs}">
<tr><td colspan="4"><em><c:out value="No se ha realizado ninguna valoración por el momento."/></em></td></tr>
<tr><td colspan="4"><em><c:out value="No se ha realizado ninguna valoración por el momento."/></em></td></tr>
</c:when>
<c:otherwise>
<c:forEach items="${reviewsLs}" var="review">
<tr>
<!-- <td> -->
<%-- <c:out value="nombre por definir"/> <!-- ${review.usuario.nombre},${review.usuario.apellidos} --> --%>
@ -34,7 +38,10 @@
<c:out value="${review.escritor.username}"/>
</td>
<td>
<c:out value="${review.stars}"/>
<!--<c:out value="${review.stars}"/> -->
<cheapy:showStars value='${review.stars}'></cheapy:showStars>
</td>
<td>
<c:out value="${review.opinion}"/>
@ -51,26 +58,34 @@
</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</tbody>
</table>
<c:if test='${page!=0}'>
<div class="text-center">
<c:out value='Página ${page}'></c:out>
</div>
<c:if test='${page!=0}'>
<div class="text-left">
<spring:url value="/reviewsList/{page}" var="reviewsListUrl">
<spring:param name="page" value="${page-1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(reviewsListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Pág. anterior</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(reviewsListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
Pág. anterior</button>
</div>
</c:if>
<c:out value='${page}'></c:out>
<c:if test="${fn:length(reviewsLs) == 6}">
<div class="text-right">
<spring:url value="/reviewsList/{page}" var="reviewsListUrl">
<spring:param name="page" value="${page+1}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(reviewsListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Pág. siguiente</button>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(reviewsListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-right" aria-hidden="true" style="padding: 5px"> </span>
Pág. siguiente</button>
</div>
</c:if>
</cheapy:layout>

View file

@ -5,26 +5,33 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<cheapy:layout pageName="review">
<h2 style="text-align:center;padding:5px"><fmt:message key="review"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="review"/></h2>
<form:form modelAttribute="review" class="form-horizontal" id="add-review-form">
<table class="table table-striped" id="review-table">
<tr>
<th><fmt:message key="stars"/></th>
<td><c:out value="${review.stars}"/></td>
<!-- <td><c:out value="${review.stars}"/></td>-->
<td><cheapy:ratingStar label="" name="stars" disabled="true"></cheapy:ratingStar></td>
</tr>
<tr>
<th><fmt:message key="opinion"/></th>
<td><c:out value="${review.opinion}"/></td>
</tr>
</table>
</form:form>
<sec:authentication var="principal" property="principal" />
<div class="btns-edit">
@ -35,7 +42,7 @@
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Editar opinión</button>
Editar opinión</button>
</c:if>
</div>

View file

@ -0,0 +1,42 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="reviewsN">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<c:if test="${review['new']}">Nueva </c:if> Reseña
</h2>
<form:form modelAttribute="review" class="form-horizontal" id="add-review-form">
<div class="form-group has-feedback">
<form:hidden path="id"/>
<cheapy:textAreaField label="Opinión" name="opinion"/>
<!-- <cheapy:inputField label="Estrellas" name="stars"/> -->
<cheapy:ratingStar label="Valoración" name="stars" disabled="false"></cheapy:ratingStar>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="btn-mod">
<c:choose>
<c:when test="${review['new']}">
<button class="btn btn-default" type="submit" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-floppy-save" aria-hidden="true" style="padding: 5px"> </span>
Crear reseña</button>
</c:when>
<c:otherwise>
<button class="btn btn-default" type="submit">Modificar Reseña</button>
</c:otherwise>
</c:choose>
</div>
</div>
</div>
</form:form>
</cheapy:layout>

View file

@ -0,0 +1,93 @@
<%@ 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="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="reviews">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="reviews"/></h2>
<table id="reviewTable" class="table table-striped">
<thead>
<tr>
<!-- <th style="width: 150px;">Restaurante</th> -->
<th><fmt:message key="user"/></th>
<th><fmt:message key="stars"/></th>
<th><fmt:message key="opinion"/></th>
<th> </th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${empty reviewsLs}">
<tr><td colspan="4"><em><c:out value="No se ha realizado ninguna valoración por el momento."/></em></td></tr>
</c:when>
<c:otherwise>
<c:forEach items="${reviewsLs}" var="review">
<tr>
<!-- <td> -->
<%-- <c:out value="nombre por definir"/> <!-- ${review.usuario.nombre},${review.usuario.apellidos} --> --%>
<!-- </td> -->
<td>
<c:out value="${review.escritor.username}"/>
</td>
<td>
<!--<c:out value="${review.stars}"/> -->
<cheapy:showStars value='${review.stars}'></cheapy:showStars>
</td>
<td>
<c:out value="${review.opinion}"/>
</td>
<td>
<spring:url value="/reviewsClient/{reviewId}" var="reviewUrl">
<spring:param name="reviewId" value="${review.id}"/>
</spring:url>
<div class="btn-detalles">
<button type="button" role="link" onclick="window.location='${fn:escapeXml(reviewUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="details"/></button>
</div>
</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</tbody>
</table>
<div class="text-center">
<c:out value='Página ${page}'></c:out>
</div>
<c:if test='${page!=0}'>
<div class="text-left">
<spring:url value="/reviewsClientList/{client}/{page}" var="reviewsListUrl">
<spring:param name="page" value="${page-1}"/>
<spring:param name="client" value="${client}"/>
</spring:url>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(reviewsListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
Pág. anterior</button>
</div>
</c:if>
<c:if test="${fn:length(reviewsLs) == 6}">
<div class="text-right">
<spring:url value="/reviewsClientList/{client}/{page}" var="reviewsListUrl">
<spring:param name="page" value="${page+1}"/>
<spring:param name="client" value="${client}"/>
</spring:url>
<button type="button" class="btn-pag" role="link" onclick="window.location='${fn:escapeXml(reviewsListUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-arrow-right" aria-hidden="true" style="padding: 5px"> </span>
Pág. siguiente</button>
</div>
</c:if>
</cheapy:layout>

View file

@ -0,0 +1,52 @@
<%@ page session="false" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ 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" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<cheapy:layout pageName="review">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="review"/></h2>
<form:form modelAttribute="review" class="form-horizontal" id="add-review-form">
<table class="table table-striped" id="review-table">
<tr>
<th><fmt:message key="stars"/></th>
<!-- <td><c:out value="${review.stars}"/></td>-->
<td><cheapy:ratingStar label="" name="stars" disabled="true"></cheapy:ratingStar></td>
</tr>
<tr>
<th><fmt:message key="opinion"/></th>
<td><c:out value="${review.opinion}"/></td>
</tr>
</table>
</form:form>
<sec:authorize access="isAuthenticated()">
<sec:authentication var="principal" property="principal" />
<div class="btns-edit">
<c:if test="${principal.username eq review.escritor.username}">
<spring:url value="{reviewId}/edit" var="editUrl">
<spring:param name="reviewId" value="${review.id}"/>
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Editar opinión</button>
</c:if>
</div>
</sec:authorize>
</cheapy:layout>

View file

@ -6,6 +6,7 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
@ -273,31 +274,25 @@
</style>
<cheapy:layout pageName="singUp">
<h2 style="text-align:center;padding:5px">
<div class="text-center">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<fmt:message key="new"/><fmt:message key="client"/>
</h2>
</div>
<form:form modelAttribute="cliente" class="form-horizontal"
id="add-client-form">
<div class="form-group has-feedback">
<cheapy:inputField label="Nombre" placeholder="Ponga aqui su nombre"
name="name" />
<cheapy:inputField label="Direccion" placeholder="Ponga aqui su dirección"
name="address" />
<div class="form-group">
<label>Municipio: </label>
<select name="municipio">
<c:forEach items="${municipio}" var="entry">
<option value="${entry}">${entry}</option>
</c:forEach>
</select>
</div>
<cheapy:inputField label="Direccion" placeholder="Ponga aqui su dirección"
name="address" />
<cheapy:inputField label="Hora de apertura" placeholder="Ponga aqui su hora de apertura (formato HH:mm)"
name="init" />
<cheapy:inputField label="Hora de cierre" placeholder="Ponga aqui su hora de cierre (formato HH:mm)"
name="finish" />
<cheapy:inputField label="Teléfono" placeholder="Ponga aqui el teléfono del local"
<cheapy:inputField label="Teléfono" placeholder="Ponga aqui el teléfono del local"
name="telephone" />
<cheapy:inputField label="Descripción" placeholder="Ponga aqui su descripción"
<cheapy:inputField label="Descripción" placeholder="Ponga aqui su descripción"
name="description" />
<cheapy:inputField label="Email" placeholder="Ponga aqui su email"
name="email" />
@ -305,11 +300,23 @@
name="food" />
<cheapy:inputField label="Nombre de usuario" placeholder="Ponga aqui su nombre de usuario"
name="usuar.username" />
<cheapy:inputField label="Contraseña" placeholder="Ponga aqui su contraseña"
<cheapy:passwordField label="Contraseña" placeholder="Ponga aqui su contraseña"
name="usuar.password" />
<cheapy:inputField label="Código de activación" placeholder="Ponga aqui el código que se le suministro al firmar el contrato"
<cheapy:inputField label="Código de activación" placeholder="Ponga aqui el código que se le suministro al firmar el contrato"
name="code.code" />
<input type="submit" class="fadeIn fourth" value="Registrarse">
<div class="form-group">
<label class="col-sm-2 control-label">Municipio: </label>
<div class="col-sm-10">
<select name="municipio" class="select-municipio" style="width:80%;text-align-last:center;">
<c:forEach items="${municipio}" var="entry">
<option value="${entry}">${entry.toString()}</option>
</c:forEach>
</select>
</div>
</div>
<div class="text-center">
<input type="submit" class="fadeIn fourth" value="Registrarse">
</div>
</div>
</form:form>

View file

@ -6,6 +6,7 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
@ -273,33 +274,41 @@
</style>
<cheapy:layout pageName="singUp">
<h2 style="text-align:center;padding:5px">
<fmt:message key="new"/><fmt:message key="user"/>
<div class="text-center">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<fmt:message key="new"/><fmt:message key="usuario"/>
</h2>
</div>
<form:form modelAttribute="usuario" class="form-horizontal"
id="add-foodOffer-form">
id="add-user-form">
<div class="form-group has-feedback">
<cheapy:inputField label="Nombre" placeholder="Ponga aqui su nombre"
name="nombre" />
<cheapy:inputField label="Apellidos" placeholder="Ponga aqui sus apellidos"
name="apellidos" />
<cheapy:inputField label="Direccion" placeholder="Ponga aqui su dirección"
<cheapy:inputField label="Direccion" placeholder="Ponga aqui su dirección"
name="direccion" />
<div class="form-group">
<label>Municipio: </label>
<select name="municipio">
<c:forEach items="${municipio}" var="entry">
<option value="${entry}">${entry}</option>
</c:forEach>
</select>
</div>
<cheapy:inputField label="Email" placeholder="Ponga aqui su email"
name="email" />
<cheapy:inputField label="Nombre de usuario" placeholder="Ponga aqui su nombre de usuario"
name="usuar.username" />
<cheapy:inputField label="Contraseña" placeholder="Ponga aqui su contraseña"
<cheapy:passwordField label="Contraseña" placeholder="Ponga aqui su contraseña"
name="usuar.password" />
<input type="submit" class="fadeIn fourth" value="Registrarse">
<div class="form-group">
<label class="col-sm-2 control-label">Municipio </label>
<div class="col-sm-10">
<select name="municipio" class="select-municipio" style="width:80%;text-align-last:center;" >
<c:forEach items="${municipio}" var="entry">
<option value="${entry}">${entry.toString()}</option>
</c:forEach>
</select>
</div>
</div>
<div class="text-center">
<input type="submit" class="fadeIn fourth" value="Registrarse">
</div>
</div>
</form:form>

View file

@ -5,10 +5,11 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="usuarios">
<h2 style="text-align:center;padding:5px">
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px">
<c:if test="${usuario['new']}"><fmt:message key="new"/> </c:if> <fmt:message key="usuario"/>
</h2>

View file

@ -5,11 +5,14 @@
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="usuario">
<jsp:body>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su cuenta?</em></h2>
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 30px; color: rgb(0, 64, 128); padding:30px"><em>¿Está seguro de que quiere eliminar su cuenta?</em></h2>
<form:form modelAttribute="usuario" class="form-horizontal">

View file

@ -5,13 +5,15 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="usuarios">
<h2 style="text-align:center;padding:5px"><fmt:message key="users"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="users"/></h2>
<c:if test="${empty usuarioLs }">
<p id="vacio" >No hay ningún usuario.</p>
<p id="vacio" >No hay ningún usuario.</p>
</c:if>
<c:if test="${not empty usuarioLs }">
<table id="usuarioTable" class="table table-striped">

View file

@ -5,11 +5,13 @@
<%@ 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" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="usuario">
<h2 style="text-align:center;padding:5px"><fmt:message key="usuario"/></h2>
<h2 style="font-family: 'Lobster'; text-align:center; font-size:200%; color: rgb(0, 64, 128); padding:10px"><fmt:message key="usuario"/></h2>
<table class="table table-striped" id="usuarioTable">
<thead>

View file

@ -7,6 +7,7 @@
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<!-- %@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %-->
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<cheapy:layout pageName="home">
<h2 class="text-center" style="font-family: 'Lobster'; font-size: 300%; color: rgb(0, 64, 128); padding:30px"><fmt:message key="welcome"/></h2>

View file

@ -57,7 +57,7 @@
<sec:authorize access="hasAnyAuthority('admin')">
<cheapy:menuItem active="${name eq 'registro'}" url="/administrators/offersRecord" title="offersRecord">
<span class="glyphicon " aria-hidden="true"></span>
<span>Registro de ofertas</span>
<span>Historial de ofertas</span>
</cheapy:menuItem>
</sec:authorize>
<!--

View file

@ -15,7 +15,7 @@
<label class="col-sm-2 control-label">${label}</label>
<div class="col-sm-10">
<form:input type="password" class="form-control" placeholder="${placeholder }" path="${name}"/>
<form:input type="password" class="form-control" style="width:80%;" placeholder="${placeholder }" path="${name}"/>
<c:if test="${valid}">
<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
</c:if>

View file

@ -0,0 +1,37 @@
<%@ 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" %>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %>
<%@ attribute name="name" required="true" rtexprvalue="true"
description="Name of corresponding property in bean object" %>
<%@ attribute name="disabled" required="false" rtexprvalue="true"
description="Disable the input" %>
<%@ 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="Example for input field" %>
<spring:bind path="${name}">
<c:set var="cssGroup" value="form-group ${status.error ? 'has-error' : '' }"/>
<c:set var="valid" value="${not status.error and not empty status.actualValue}"/>
<div class="${cssGroup}">
<c:if test="${fn:length(label)!=0}">
<label class="col-sm-2 control-label">${label}</label>
</c:if>
<div class="col-sm-10">
<div class="rating">
<form:radiobutton class="form-control" disabled="${disabled}" name="rating" value="5" id="5" path="${name}"/><label for="5"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
<form:radiobutton class="form-control" disabled="${disabled}" name="rating" value="4" id="4" path="${name}"/><label for="4"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
<form:radiobutton class="form-control" disabled="${disabled}" name="rating" value="3" id="3" path="${name}"/><label for="3"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
<form:radiobutton class="form-control" disabled="${disabled}" name="rating" value="2" id="2" path="${name}"/><label for="2"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
<form:radiobutton class="form-control" disabled="${disabled}" name="rating" value="1" id="1" path="${name}"/><label for="1"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
</div>
<c:if test="${status.error}">
<span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
<span class="help-inline">${status.errorMessage}</span>
</c:if>
</div>
</div>
</spring:bind>

View file

@ -0,0 +1,21 @@
<%@tag import="com.sun.org.apache.xalan.internal.xsltc.compiler.sym"%>
<%@ tag language="java" pageEncoding="ISO-8859-1"%>
<%@ attribute name="value" required="true" rtexprvalue="true" type="Integer"
description="Number of starts" %>
<%@ attribute name="label" required="false" rtexprvalue="true"
description="Label appears in red color if input is considered as invalid after submission" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<form>
<c:if test="${label}">
<label class="col-sm-2 control-label">${label}</label>
</c:if>
<div class="rating">
<input type="radio" class="form-control" disabled name="rating" value="5" id="5" <%= value.equals(5) ?"checked='checked'" : ""%> /><label for="5"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
<input type="radio" class="form-control" disabled name="rating" value="4" id="4" <%= value.equals(4) ? "checked='checked'" : "" %> /><label for="4"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
<input type="radio" class="form-control" disabled name="rating" value="3" id="3" <%= value.equals(3) ? "checked='checked'" : "" %>/><label for="3"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
<input type="radio" class="form-control" disabled name="rating" value="2" id="2" <%= value.equals(2) ? "checked='checked'" : "" %>/><label for="2"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
<input type="radio" class="form-control" disabled name="rating" value="1" id="1" <%= value.equals(1) ? "checked='checked'" : "" %>/><label for="1"><span style="font-size: 100%" class="estrella_vacia">&#9734;</span></label>
</div>
</form>