Merge branch 'develop' into 011-pruebas-unitarias-publicar-ofertas-abel

This commit is contained in:
abemorcardc 2021-04-03 19:06:41 +02:00 committed by GitHub
commit e6bbb7a26a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 270 additions and 235 deletions

View file

@ -3,12 +3,20 @@ language: java
jdk: oraclejdk8 jdk: oraclejdk8
services: services:
- mysql - mysql
install: cache:
- ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V directories:
- "$HOME/.m2"
before_cache:
- rm -rf $HOME/.m2/repository/com/autentia/traviscodacy
before_install: before_install:
- chmod +x mvnw - sudo apt-get install jq
- mysql -e 'CREATE DATABASE cheapy;' - 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)
- sudo apt-get update - chmod +x mvnw
script: - mysql -e 'CREATE DATABASE cheapy;'
- mvn test -Dspring.profiles.active=mysql-travis - sudo apt-get update
after_success:
- ls
- ls target
- ls target/jacoco
- java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/jacoco/jacoco.xml

27
pom.xml
View file

@ -28,6 +28,11 @@
<wro4j.version>1.8.0</wro4j.version> <wro4j.version>1.8.0</wro4j.version>
<jacoco.version>0.8.5</jacoco.version> <jacoco.version>0.8.5</jacoco.version>
<jacoco.utreportpath>${project.build.directory}/jacoco</jacoco.utreportpath>
<jacoco.utreportfile>${project.build.directory}/jacoco.exec</jacoco.utreportfile>
<jacoco.itreportpath>${project.build.directory}/jacoco</jacoco.itreportpath>
<jacoco.itreportfile>${jacoco.itreportpath}/jacoco-it.exec</jacoco.itreportfile>
<nohttp-checkstyle.version>0.0.4.RELEASE</nohttp-checkstyle.version> <nohttp-checkstyle.version>0.0.4.RELEASE</nohttp-checkstyle.version>
<spring-format.version>0.0.25</spring-format.version> <spring-format.version>0.0.25</spring-format.version>
</properties> </properties>
@ -140,7 +145,11 @@
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies> </dependencies>
@ -178,6 +187,7 @@
<goals> <goals>
<goal>prepare-agent</goal> <goal>prepare-agent</goal>
</goals> </goals>
</execution> </execution>
<execution> <execution>
<id>report</id> <id>report</id>
@ -185,6 +195,21 @@
<goals> <goals>
<goal>report</goal> <goal>report</goal>
</goals> </goals>
<configuration>
<outputDirectory>${jacoco.utreportpath}</outputDirectory>
<dataFile>${jacoco.utreportfile}</dataFile>
</configuration>
</execution>
<execution>
<id>test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>${jacoco.utreportpath}</outputDirectory>
<dataFile>${jacoco.utreportfile}</dataFile>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>

View file

@ -6,10 +6,11 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.Table; import javax.persistence.Table;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Range; import org.hibernate.validator.constraints.Range;
import com.sun.istack.NotNull;
@Entity @Entity
@Table(name = "review") @Table(name = "review")
@ -21,8 +22,8 @@ public class Review extends BaseEntity{
@Column(length=16777215) @Column(length=16777215)
private String opinion; private String opinion;
@NotNull @NotNull(message= "Por favor rellene este campo")
@Range(min = 1, max = 5) @Range(min = 1, max = 5,message="Las estrellas deben ir entre 1 y 5")
private Integer stars; private Integer stars;
@ManyToOne @ManyToOne

View file

@ -28,4 +28,8 @@ public interface FoodOfferRepository extends Repository<FoodOffer, Integer> {
@Query("SELECT foodOffer FROM FoodOffer foodOffer WHERE foodOffer.client.id =:id") @Query("SELECT foodOffer FROM FoodOffer foodOffer WHERE foodOffer.client.id =:id")
@Transactional(readOnly = true) @Transactional(readOnly = true)
List<FoodOffer> findByUserId(@Param("id") Integer id); List<FoodOffer> findByUserId(@Param("id") Integer id);
@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);
} }

View file

@ -27,4 +27,8 @@ public interface NuOfferRepository extends Repository<NuOffer, Integer> {
@Query("SELECT nuOffer FROM NuOffer nuOffer WHERE nuOffer.client.id =:id") @Query("SELECT nuOffer FROM NuOffer nuOffer WHERE nuOffer.client.id =:id")
@Transactional(readOnly = true) @Transactional(readOnly = true)
List<NuOffer> findByUserId(@Param("id") Integer id); List<NuOffer> findByUserId(@Param("id") Integer id);
@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);
} }

View file

@ -29,4 +29,8 @@ public interface SpeedOfferRepository extends Repository<SpeedOffer, Integer> {
@Query("SELECT speedOffer FROM SpeedOffer speedOffer WHERE speedOffer.client.id =:id") @Query("SELECT speedOffer FROM SpeedOffer speedOffer WHERE speedOffer.client.id =:id")
@Transactional(readOnly = true) @Transactional(readOnly = true)
List<SpeedOffer> findByUserId(@Param("id") Integer id); List<SpeedOffer> findByUserId(@Param("id") Integer id);
@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);
} }

View file

@ -26,4 +26,8 @@ public interface TimeOfferRepository extends Repository<TimeOffer, Integer> {
@Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.client.id =:id") @Query("SELECT timeOffer FROM TimeOffer timeOffer WHERE timeOffer.client.id =:id")
@Transactional(readOnly = true) @Transactional(readOnly = true)
List<TimeOffer> findByUserId(@Param("id") Integer id); List<TimeOffer> findByUserId(@Param("id") Integer id);
@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);
} }

View file

@ -37,4 +37,8 @@ public class FoodOfferService {
public List<FoodOffer> findFoodOfferByUserId(final int id) { public List<FoodOffer> findFoodOfferByUserId(final int id) {
return this.foodOfferRepository.findByUserId(id); return this.foodOfferRepository.findByUserId(id);
} }
public List<FoodOffer> findFoodOfferActOclByUserId(final int id) {
return this.foodOfferRepository.findFoodOfferActOclByUserId(id);
}
} }

View file

@ -47,4 +47,8 @@ public class NuOfferService {
public List<NuOffer> findNuOfferByUserId(final int id) { public List<NuOffer> findNuOfferByUserId(final int id) {
return this.nuOfferRepository.findByUserId(id); return this.nuOfferRepository.findByUserId(id);
} }
public List<NuOffer> findNuOfferActOclByUserId(final int id) {
return this.nuOfferRepository.findNuOfferActOclByUserId(id);
}
} }

View file

@ -44,4 +44,8 @@ public class SpeedOfferService {
public List<SpeedOffer> findSpeedOfferByUserId(final int id) { public List<SpeedOffer> findSpeedOfferByUserId(final int id) {
return this.speedOfferRepository.findByUserId(id); return this.speedOfferRepository.findByUserId(id);
} }
public List<SpeedOffer> findSpeedOfferActOclByUserId(final int id) {
return this.speedOfferRepository.findSpeedOfferActOclByUserId(id);
}
} }

View file

@ -40,4 +40,8 @@ public class TimeOfferService {
public List<TimeOffer> findTimeOfferByUserId(final int id) { public List<TimeOffer> findTimeOfferByUserId(final int id) {
return this.timeOfferRepository.findByUserId(id); return this.timeOfferRepository.findByUserId(id);
} }
public List<TimeOffer> findTimeOfferActOclByUserId(final int id) {
return this.timeOfferRepository.findTimeOfferActOclByUserId(id);
}
} }

View file

@ -105,13 +105,15 @@ public class FoodOfferController {
public String processShowForm(@PathVariable("foodOfferId") int foodOfferId, Map<String, Object> model) { public String processShowForm(@PathVariable("foodOfferId") int foodOfferId, Map<String, Object> model) {
FoodOffer foodOffer = this.foodOfferService.findFoodOfferById(foodOfferId); FoodOffer foodOffer = this.foodOfferService.findFoodOfferById(foodOfferId);
if(!foodOffer.getStatus().equals(StatusOffer.active)) {
return "error";
}else {
model.put("foodOffer", foodOffer); model.put("foodOffer", foodOffer);
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
return "offers/food/foodOffersShow"; return "offers/food/foodOffersShow";
}
} }
@GetMapping(value = "/offers/food/{foodOfferId}/edit") @GetMapping(value = "/offers/food/{foodOfferId}/edit")

View file

@ -136,10 +136,14 @@ public class NuOfferController {
@GetMapping("/offers/nu/{nuOfferId}") @GetMapping("/offers/nu/{nuOfferId}")
public String processShowForm(@PathVariable("nuOfferId") int nuOfferId, Map<String, Object> model) { public String processShowForm(@PathVariable("nuOfferId") int nuOfferId, Map<String, Object> model) {
NuOffer nuOffer = this.nuOfferService.findNuOfferById(nuOfferId); NuOffer nuOffer = this.nuOfferService.findNuOfferById(nuOfferId);
if(!nuOffer.getStatus().equals(StatusOffer.active)) {
return "error";
}else {
model.put("nuOffer", nuOffer); model.put("nuOffer", nuOffer);
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
return "offers/nu/nuOffersShow"; return "offers/nu/nuOffersShow";
}
} }

View file

@ -64,10 +64,10 @@ public class OfertaController {
int actual = this.clientService.getCurrentClient().getId(); int actual = this.clientService.getCurrentClient().getId();
List<FoodOffer> foodOfferLs = this.foodOfferService.findFoodOfferByUserId(actual); List<FoodOffer> foodOfferLs = this.foodOfferService.findFoodOfferActOclByUserId(actual);
List<NuOffer> nuOfferLs = this.nuOfferService.findNuOfferByUserId(actual); List<NuOffer> nuOfferLs = this.nuOfferService.findNuOfferActOclByUserId(actual);
List<SpeedOffer> speedOfferLs = this.speedOfferService.findSpeedOfferByUserId(actual); List<SpeedOffer> speedOfferLs = this.speedOfferService.findSpeedOfferActOclByUserId(actual);
List<TimeOffer> timeOfferLs = this.timeOfferService.findTimeOfferByUserId(actual); List<TimeOffer> timeOfferLs = this.timeOfferService.findTimeOfferActOclByUserId(actual);
model.put("foodOfferLs", foodOfferLs); model.put("foodOfferLs", foodOfferLs);
model.put("nuOfferLs", nuOfferLs); model.put("nuOfferLs", nuOfferLs);

View file

@ -130,12 +130,15 @@ public class SpeedOfferController {
@GetMapping("/offers/speed/{speedOfferId}") @GetMapping("/offers/speed/{speedOfferId}")
public String processShowForm(@PathVariable("speedOfferId") int speedOfferId, Map<String, Object> model) { public String processShowForm(@PathVariable("speedOfferId") int speedOfferId, Map<String, Object> model) {
SpeedOffer speedOffer = this.speedOfferService.findSpeedOfferById(speedOfferId); SpeedOffer speedOffer = this.speedOfferService.findSpeedOfferById(speedOfferId);
if(!speedOffer.getStatus().equals(StatusOffer.active)) {
return "error";
}else {
model.put("speedOffer", speedOffer); model.put("speedOffer", speedOffer);
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
return "offers/speed/speedOffersShow"; return "offers/speed/speedOffersShow";
}
} }
@GetMapping(value = "/offers/speed/{speedOfferId}/edit") @GetMapping(value = "/offers/speed/{speedOfferId}/edit")

View file

@ -122,12 +122,15 @@ public class TimeOfferController {
public String processShowForm(@PathVariable("timeOfferId") int timeOfferId, Map<String, Object> model) { public String processShowForm(@PathVariable("timeOfferId") int timeOfferId, Map<String, Object> model) {
TimeOffer timeOffer = this.timeOfferService.findTimeOfferById(timeOfferId); TimeOffer timeOffer = this.timeOfferService.findTimeOfferById(timeOfferId);
if(!timeOffer.getStatus().equals(StatusOffer.active)) {
return "error";
}else {
model.put("timeOffer", timeOffer); model.put("timeOffer", timeOffer);
model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")); model.put("localDateTimeFormat", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
return "offers/time/timeOffersShow"; return "offers/time/timeOffersShow";
}
} }

View file

@ -297,23 +297,23 @@ img.img-responsive{
} }
#foodOfferTable th { #foodOfferTable th {
width: 25%; width: 20%;
text-align: center; text-align: center;
} }
#nuOfferTable th { #nuOfferTable th {
width: 25%; width: 20%;
text-align: center; text-align: center;
} }
#speedOfferTable th { #speedOfferTable th {
width: 25%; width: 20%;
text-align: center; text-align: center;
} }
#timeOfferTable th { #timeOfferTable th {
width: 25%; width: 20%;
text-align: center; text-align: center;
} }
@ -365,6 +365,29 @@ text-align: center;
background-color: rgb(40, 140, 215); background-color: rgb(40, 140, 215);
} }
.btns-edit2{
display: table;
margin:auto;
}
.btns-edit2 button{
background-color: rgb(0, 64, 128);
border: 1px solid rgb(0, 0, 160);
color: white;
padding: 10px 24px;
cursor: pointer;
}
.btns-edit2 button:not(:last-child) {
border-bottom: none;
}
.btns-edit2 button:hover {
background-color: rgb(40, 140, 215);
}
.btns-delete{ .btns-delete{
display: table; display: table;
margin: 0 auto; margin: 0 auto;

View file

@ -1,12 +1,11 @@
# database init, supports mysql too # database init, supports mysql too
database=mysql database=mysql
spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} #spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC}
spring.datasource.username=${MYSQL_USER:cheapy} spring.datasource.username=${MYSQL_USER:cheapy}
spring.datasource.password=${MYSQL_PASS:cheapy} spring.datasource.password=${MYSQL_PASS:cheapy}
# SQL is written to be idempotent so this is safe # SQL is written to be idempotent so this is safe
spring.datasource.initialization-mode=always spring.datasource.initialization-mode=always
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.properties.javax.persistence.schema-generation.drop-source=metadata spring.jpa.properties.javax.persistence.schema-generation.drop-source=metadata
# Naming strategy # Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy

View file

@ -4,6 +4,8 @@ database=mysql
spring.datasource.data=classpath*:db/${database}/data.sql spring.datasource.data=classpath*:db/${database}/data.sql
spring.h2.console.enabled=true spring.h2.console.enabled=true
spring.profiles.active=mysql spring.profiles.active=mysql
spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC}
spring.datasource.driver-class-name=org.postgresql.Driver
# Web # Web
spring.thymeleaf.mode=HTML spring.thymeleaf.mode=HTML

View file

@ -48,3 +48,7 @@ createSpeedOffers= Crear ofertas por rapidez comiendo
createTimeOffers= Crear ofertas por franja horaria createTimeOffers= Crear ofertas por franja horaria
init= Inicio del intervalo init= Inicio del intervalo
finishOffer= Fin del intervalo finishOffer= Fin del intervalo
name= Nombre del restaurante
status= Estado de oferta
myOffers= Ver mis Ofertas

View file

@ -42,15 +42,4 @@
</div> </div>
</form:form> </form:form>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -9,27 +9,17 @@
<cheapy:layout pageName="foodOffer"> <cheapy:layout pageName="foodOffer">
<jsp:body> <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"> <form:form modelAttribute="foodOffer" class="form-horizontal">
<div class="btns-edit"> <div class="btns-edit2">
<button type="submit" style="font-family: 'Lobster'; font-size: 20px;"> <button type="submit" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Dar de baja</button> Dar de baja</button>
</div> </div>
</form:form> </form:form>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</jsp:body> </jsp:body>
</cheapy:layout> </cheapy:layout>

View file

@ -12,7 +12,7 @@
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffer"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="foodOffer"/></h2>
<table class="table table-striped" id="foodOfferTable"> <table class="table table-striped" id="foodOfferTable">
<thead> <thead>
<tr> <tr>
@ -40,44 +40,42 @@
</table> </table>
<div class="btn-menu"> <div class="btn-menu">
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<sec:authorize access="hasAnyAuthority('client')"> <sec:authorize access="hasAnyAuthority('client')">
<sec:authentication var="principal" property="principal" />
<div class="btns-edit"> <div class="btns-edit">
<spring:url value="{foodOfferId}/edit" var="editUrl"> <c:if test="${ principal.username eq foodOffer.client.usuar.username}">
<spring:param name="foodOfferId" value="${foodOffer.id}"/> <c:if test="${foodOffer.status eq 'active' || foodOffer.status eq 'hidden' }">
</spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <spring:url value="{foodOfferId}/edit" var="editUrl">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> <spring:param name="foodOfferId" value="${foodOffer.id}"/>
Editar oferta</button> </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 oferta</button>
</c:if>
<c:if test="${foodOffer.status eq 'hidden' }"> <c:if test="${foodOffer.status eq 'hidden' }">
<spring:url value="{foodOfferId}/activate" var="activateUrl"> <spring:url value="{foodOfferId}/activate" var="activateUrl">
<spring:param name="foodOfferId" value="${foodOffer.id}"/> <spring:param name="foodOfferId" value="${foodOffer.id}"/>
</spring:url> </spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='${fn:escapeXml(activateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span>
Activar oferta</button> Activar oferta</button>
</c:if> </c:if>
<c:if test="${foodOffer.status eq 'active' }"> <c:if test="${foodOffer.status eq 'active' }">
<spring:url value="{foodOfferId}/disable" var="deactivateUrl"> <spring:url value="{foodOfferId}/disable" var="deactivateUrl">
<spring:param name="foodOfferId" value="${foodOffer.id}"/> <spring:param name="foodOfferId" value="${foodOffer.id}"/>
</spring:url> </spring:url>
<button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <button type="button" role="link" onclick="window.location='${fn:escapeXml(deactivateUrl)}'" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Desactivar oferta</button> Desactivar oferta</button>
</c:if> </c:if>
</c:if>
</div> </div>
</sec:authorize> </sec:authorize>
</div> </div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -9,7 +9,7 @@
<cheapy:layout pageName="ofertasM"> <cheapy:layout pageName="ofertasM">
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2>
<c:if test="${empty foodOfferLs }"> <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 creada.</p>
</c:if> </c:if>
<c:if test="${not empty foodOfferLs }"> <c:if test="${not empty foodOfferLs }">
<table id="foodOfferTable" class="table table-striped"> <table id="foodOfferTable" class="table table-striped">
@ -19,6 +19,7 @@
<th><fmt:message key="food"/></th> <th><fmt:message key="food"/></th>
<th><fmt:message key="startDate"/></th> <th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th><fmt:message key="status"/></th>
<th> <spring:url value="/offers/food/new" var="newFoodUrl"> <th> <spring:url value="/offers/food/new" var="newFoodUrl">
</spring:url> </spring:url>
<!-- <a href="${fn:escapeXml(newFoodUrl)}" class="btn btn-default">Nueva oferta</a></th>--> <!-- <a href="${fn:escapeXml(newFoodUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
@ -36,6 +37,9 @@
<td> <td>
<c:out value="${localDateTimeFormat.format(foodOffer.end)}"/> <c:out value="${localDateTimeFormat.format(foodOffer.end)}"/>
</td> </td>
<td>
<c:out value="${foodOffer.status}"/>
</td>
<td> <td>
<spring:url value="/offers/food/{foodOfferId}" var="foodOfferUrl"> <spring:url value="/offers/food/{foodOfferId}" var="foodOfferUrl">
<spring:param name="foodOfferId" value="${foodOffer.id}"/> <spring:param name="foodOfferId" value="${foodOffer.id}"/>
@ -54,7 +58,7 @@
</c:if> </c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2>
<c:if test="${empty nuOfferLs }"> <c:if test="${empty nuOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p> <p id="vacio" >No hay ninguna oferta por número de comensales creada.</p>
</c:if> </c:if>
<c:if test="${not empty nuOfferLs }"> <c:if test="${not empty nuOfferLs }">
<table id="nuOfferTable" class="table table-striped"> <table id="nuOfferTable" class="table table-striped">
@ -63,6 +67,7 @@
<!-- <th style="width: 150px;">Restaurante</th> --> <!-- <th style="width: 150px;">Restaurante</th> -->
<th><fmt:message key="startDate"/></th> <th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th><fmt:message key="status"/></th>
<th> <spring:url value="/offers/nu/new" var="newNuUrl"> <th> <spring:url value="/offers/nu/new" var="newNuUrl">
</spring:url> </spring:url>
<!-- <a href="${fn:escapeXml(newNuUrl)}" class="btn btn-default">Nueva oferta</a></th>--> <!-- <a href="${fn:escapeXml(newNuUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
@ -79,6 +84,9 @@
<td> <td>
<c:out value="${localDateTimeFormat.format(nuOffer.end)}"/> <c:out value="${localDateTimeFormat.format(nuOffer.end)}"/>
</td> </td>
<td>
<c:out value="${nuOffer.status}"/>
</td>
<td> <td>
<spring:url value="/offers/nu/{nuOfferId}" var="nuOfferUrl"> <spring:url value="/offers/nu/{nuOfferId}" var="nuOfferUrl">
<spring:param name="nuOfferId" value="${nuOffer.id}"/> <spring:param name="nuOfferId" value="${nuOffer.id}"/>
@ -96,8 +104,8 @@
</c:if> </c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2>
<c:if test="${empty foodOfferLs }"> <c:if test="${empty speedOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p> <p id="vacio" >No hay ninguna oferta por tiempo empleado en comer creada.</p>
</c:if> </c:if>
<c:if test="${not empty speedOfferLs }"> <c:if test="${not empty speedOfferLs }">
<table id="speedOfferTable" class="table table-striped"> <table id="speedOfferTable" class="table table-striped">
@ -106,6 +114,7 @@
<!-- <th style="width: 150px;">Restaurante</th> --> <!-- <th style="width: 150px;">Restaurante</th> -->
<th><fmt:message key="startDate"/></th> <th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th><fmt:message key="status"/></th>
<th> <spring:url value="/offers/speed/new" var="newSpeedUrl"> <th> <spring:url value="/offers/speed/new" var="newSpeedUrl">
</spring:url> </spring:url>
<!-- <a href="${fn:escapeXml(newSpeedUrl)}" class="btn btn-default">Nueva oferta</a></th>--> <!-- <a href="${fn:escapeXml(newSpeedUrl)}" class="btn btn-default">Nueva oferta</a></th>-->
@ -122,6 +131,9 @@
<td> <td>
<c:out value="${localDateTimeFormat.format(speedOffer.end)}"/> <c:out value="${localDateTimeFormat.format(speedOffer.end)}"/>
</td> </td>
<td>
<c:out value="${speedOffer.status}"/>
</td>
<td> <td>
<spring:url value="/offers/speed/{speedOfferId}" var="speedOfferUrl"> <spring:url value="/offers/speed/{speedOfferId}" var="speedOfferUrl">
<spring:param name="speedOfferId" value="${speedOffer.id}"/> <spring:param name="speedOfferId" value="${speedOffer.id}"/>
@ -141,7 +153,7 @@
<h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2>
<c:if test="${empty timeOfferLs }"> <c:if test="${empty timeOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p> <p id="vacio" >No hay ninguna oferta por franja horaria creada.</p>
</c:if> </c:if>
<c:if test="${not empty timeOfferLs }"> <c:if test="${not empty timeOfferLs }">
<table id="timeOfferTable" class="table table-striped"> <table id="timeOfferTable" class="table table-striped">
@ -150,6 +162,7 @@
<!-- <th style="width: 150px;">Restaurante</th> --> <!-- <th style="width: 150px;">Restaurante</th> -->
<th><fmt:message key="startDate"/></th> <th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th><fmt:message key="status"/></th>
<th><spring:url value="/offers/time/new" var="newTimeUrl"> <th><spring:url value="/offers/time/new" var="newTimeUrl">
</spring:url> </spring:url>
<!--<a href="${fn:escapeXml(newTimeUrl)}" class="btn btn-default">Nueva oferta</a> </th>--> <!--<a href="${fn:escapeXml(newTimeUrl)}" class="btn btn-default">Nueva oferta</a> </th>-->
@ -165,6 +178,9 @@
<td> <td>
<c:out value="${localDateTimeFormat.format(timeOffer.end)}"/> <c:out value="${localDateTimeFormat.format(timeOffer.end)}"/>
</td> </td>
<td>
<c:out value="${timeOffer.status}"/>
</td>
<td> <td>
<spring:url value="/offers/time/{timeOfferId}" var="timeOfferUrl"> <spring:url value="/offers/time/{timeOfferId}" var="timeOfferUrl">
<spring:param name="timeOfferId" value="${timeOffer.id}"/> <spring:param name="timeOfferId" value="${timeOffer.id}"/>

View file

@ -47,15 +47,5 @@
</div> </div>
</form:form> </form:form>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -13,23 +13,13 @@
<form:form modelAttribute="nuOffer" class="form-horizontal"> <form:form modelAttribute="nuOffer" class="form-horizontal">
<div class="btns-edit"> <div class="btns-edit2">
<button type="submit" style="font-family: 'Lobster'; font-size: 20px;"> <button type="submit" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Dar de baja</button> Dar de baja</button>
</div> </div>
</form:form> </form:form>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</jsp:body> </jsp:body>
</cheapy:layout> </cheapy:layout>

View file

@ -53,19 +53,19 @@
</table> </table>
<div class="btn-menu"> <div class="btn-menu">
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<sec:authorize access="hasAnyAuthority('client')"> <sec:authorize access="hasAnyAuthority('client')">
<sec:authentication var="principal" property="principal" />
<div class="btns-edit"> <div class="btns-edit">
<spring:url value="{nuOfferId}/edit" var="editUrl"> <c:if test="${ principal.username eq nuOffer.client.usuar.username}">
<spring:param name="nuOfferId" value="${nuOffer.id}"/> <c:if test="${nuOffer.status eq 'active' || nuOffer.status eq 'hidden' }">
</spring:url> <spring:url value="{nuOfferId}/edit" var="editUrl">
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <spring:param name="nuOfferId" value="${nuOffer.id}"/>
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> </spring:url>
Editar oferta</button> <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 oferta</button>
</c:if>
<c:if test="${nuOffer.status eq 'hidden' }"> <c:if test="${nuOffer.status eq 'hidden' }">
<spring:url value="{nuOfferId}/activate" var="activateUrl"> <spring:url value="{nuOfferId}/activate" var="activateUrl">
<spring:param name="nuOfferId" value="${nuOffer.id}"/> <spring:param name="nuOfferId" value="${nuOffer.id}"/>
@ -83,13 +83,11 @@
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Desactivar oferta</button> Desactivar oferta</button>
</c:if> </c:if>
</c:if>
</div> </div>
</sec:authorize> </sec:authorize>
</div> </div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -33,14 +33,5 @@
</div> </div>
</div> </div>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -4,10 +4,12 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %> <%@ taglib prefix="cheapy" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'> <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet'>
<cheapy:layout pageName="ofertas"> <cheapy:layout pageName="ofertas">
<h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="foodOffers"/></h2>
<c:if test="${empty foodOfferLs }"> <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>
@ -16,16 +18,21 @@
<thead> <thead>
<tr> <tr>
<!-- <th style="width: 150px;">Restaurante</th> --> <!-- <th style="width: 150px;">Restaurante</th> -->
<th><fmt:message key="name"/></th>
<th><fmt:message key="food"/></th> <th><fmt:message key="food"/></th>
<th><fmt:message key="discount"/></th> <th><fmt:message key="discount"/></th>
<th><fmt:message key="startDate"/></th> <th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th> </th> <th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<c:forEach items="${foodOfferLs}" var="foodOffer"> <c:forEach items="${foodOfferLs}" var="foodOffer">
<tr> <tr>
<td>
<c:out value="${foodOffer.client.name}"/>
</td>
<td> <td>
<c:out value="${foodOffer.food}"/> <c:out value="${foodOffer.food}"/>
</td> </td>
@ -38,6 +45,7 @@
<td> <td>
<c:out value="${localDateTimeFormat.format(foodOffer.end)}"/> <c:out value="${localDateTimeFormat.format(foodOffer.end)}"/>
</td> </td>
<td> <td>
<spring:url value="/offers/food/{foodOfferId}" var="foodOfferUrl"> <spring:url value="/offers/food/{foodOfferId}" var="foodOfferUrl">
<spring:param name="foodOfferId" value="${foodOffer.id}"/> <spring:param name="foodOfferId" value="${foodOffer.id}"/>
@ -56,13 +64,14 @@
</c:if> </c:if>
<h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="nuOffers"/></h2>
<c:if test="${empty nuOfferLs }"> <c:if test="${empty nuOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p> <p id="vacio" >No hay ninguna oferta por número de comensales activa.</p>
</c:if> </c:if>
<c:if test="${not empty nuOfferLs }"> <c:if test="${not empty nuOfferLs }">
<table id="nuOfferTable" class="table table-striped"> <table id="nuOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
<!-- <th style="width: 150px;">Restaurante</th> --> <!-- <th style="width: 150px;">Restaurante</th> -->
<th><fmt:message key="name"/></th>
<th><fmt:message key="startDate"/></th> <th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th><fmt:message key="goldGoal"/></th> <th><fmt:message key="goldGoal"/></th>
@ -74,7 +83,9 @@
<tbody> <tbody>
<c:forEach items="${nuOfferLs}" var="nuOffer"> <c:forEach items="${nuOfferLs}" var="nuOffer">
<tr> <tr>
<td>
<c:out value="${nuOffer.client.name}"/>
</td>
<td> <td>
<c:out value="${localDateTimeFormat.format(nuOffer.start)}"/> <c:out value="${localDateTimeFormat.format(nuOffer.start)}"/>
</td> </td>
@ -105,13 +116,14 @@
<h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="speedOffers"/></h2>
<c:if test="${empty speedOfferLs }"> <c:if test="${empty speedOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p> <p id="vacio" >No hay ninguna oferta por tiempo empleado en comer activa.</p>
</c:if> </c:if>
<c:if test="${not empty speedOfferLs }"> <c:if test="${not empty speedOfferLs }">
<table id="speedOfferTable" class="table table-striped"> <table id="speedOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
<!-- <th style="width: 150px;">Restaurante</th> --> <!-- <th style="width: 150px;">Restaurante</th> -->
<th><fmt:message key="name"/></th>
<th><fmt:message key="startDate"/></th> <th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th><fmt:message key="goldGoal"/></th> <th><fmt:message key="goldGoal"/></th>
@ -123,7 +135,9 @@
<tbody> <tbody>
<c:forEach items="${speedOfferLs}" var="speedOffer"> <c:forEach items="${speedOfferLs}" var="speedOffer">
<tr> <tr>
<td>
<c:out value="${speedOffer.client.name}"/>
</td>
<td> <td>
<c:out value="${localDateTimeFormat.format(speedOffer.start)}"/> <c:out value="${localDateTimeFormat.format(speedOffer.start)}"/>
</td> </td>
@ -155,13 +169,14 @@
<h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2> <h2 style="text-align:center;padding:5px"><fmt:message key="timeOffers"/></h2>
<c:if test="${empty timeOfferLs }"> <c:if test="${empty timeOfferLs }">
<p id="vacio" >No hay ninguna oferta por plato específico activa.</p> <p id="vacio" >No hay ninguna oferta por franja horaria activa.</p>
</c:if> </c:if>
<c:if test="${not empty timeOfferLs }"> <c:if test="${not empty timeOfferLs }">
<table id="timeOfferTable" class="table table-striped"> <table id="timeOfferTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
<!-- <th style="width: 150px;">Restaurante</th> --> <!-- <th style="width: 150px;">Restaurante</th> -->
<th><fmt:message key="name"/></th>
<th><fmt:message key="startDate"/></th> <th><fmt:message key="startDate"/></th>
<th><fmt:message key="endDate"/></th> <th><fmt:message key="endDate"/></th>
<th><fmt:message key="init"/></th> <th><fmt:message key="init"/></th>
@ -172,7 +187,9 @@
<tbody> <tbody>
<c:forEach items="${timeOfferLs}" var="timeOffer"> <c:forEach items="${timeOfferLs}" var="timeOffer">
<tr> <tr>
<td>
<c:out value="${timeOffer.client.name}"/>
</td>
<td> <td>
<c:out value="${localDateTimeFormat.format(timeOffer.start)}"/> <c:out value="${localDateTimeFormat.format(timeOffer.start)}"/>
</td> </td>
@ -201,15 +218,6 @@
</tbody> </tbody>
</table> </table>
</c:if> </c:if>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -44,16 +44,6 @@
</div> </div>
</div> </div>
</form:form> </form:form>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -9,27 +9,18 @@
<cheapy:layout pageName="speedOffer"> <cheapy:layout pageName="speedOffer">
<jsp:body> <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"> <form:form modelAttribute="speedOffer" class="form-horizontal">
<div class="btns-edit"> <div class="btns-edit2">
<button type="submit" style="font-family: 'Lobster'; font-size: 20px;"> <button type="submit" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Dar de baja</button> Dar de baja</button>
</div> </div>
</form:form> </form:form>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</jsp:body> </jsp:body>
</cheapy:layout> </cheapy:layout>

View file

@ -53,19 +53,19 @@
</table> </table>
<div class="btn-menu"> <div class="btn-menu">
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<sec:authorize access="hasAnyAuthority('client')"> <sec:authorize access="hasAnyAuthority('client')">
<sec:authentication var="principal" property="principal" />
<div class="btns-edit"> <div class="btns-edit">
<spring:url value="{speedOfferId}/edit" var="editUrl"> <c:if test="${ principal.username eq speedOffer.client.usuar.username}">
<spring:param name="speedOfferId" value="${speedOffer.id}"/> <c:if test="${speedOffer.status eq 'active' || speedOffer.status eq 'hidden' }">
</spring:url> <spring:url value="{speedOfferId}/edit" var="editUrl">
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <spring:param name="speedOfferId" value="${speedOffer.id}"/>
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> </spring:url>
Editar oferta</button> <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 oferta</button>
</c:if>
<c:if test="${speedOffer.status eq 'hidden' }"> <c:if test="${speedOffer.status eq 'hidden' }">
<spring:url value="{speedOfferId}/activate" var="activateUrl"> <spring:url value="{speedOfferId}/activate" var="activateUrl">
@ -84,14 +84,12 @@
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Desactivar oferta</button> Desactivar oferta</button>
</c:if> </c:if>
</c:if>
</div> </div>
</sec:authorize> </sec:authorize>
</div> </div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -45,15 +45,6 @@
</div> </div>
</form:form> </form:form>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -13,23 +13,13 @@
<form:form modelAttribute="timeOffer" class="form-horizontal"> <form:form modelAttribute="timeOffer" class="form-horizontal">
<div class="btns-edit"> <div class="btns-edit2">
<button type="submit" style="font-family: 'Lobster'; font-size: 20px;"> <button type="submit" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Dar de baja</button> Dar de baja</button>
</div> </div>
</form:form> </form:form>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<script>
function goBack() {
window.history.back()
}
</script>
</jsp:body> </jsp:body>
</cheapy:layout> </cheapy:layout>

View file

@ -42,20 +42,19 @@
</table> </table>
<div class="btn-menu"> <div class="btn-menu">
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<sec:authorize access="hasAnyAuthority('client')"> <sec:authorize access="hasAnyAuthority('client')">
<sec:authentication var="principal" property="principal" />
<div class="btns-edit"> <div class="btns-edit">
<spring:url value="{timeOfferId}/edit" var="editUrl"> <c:if test="${ principal.username eq timeOffer.client.usuar.username}">
<spring:param name="timeOfferId" value="${timeOffer.id}"/> <c:if test="${timeOffer.status eq 'active' || timeOffer.status eq 'hidden' }">
</spring:url> <spring:url value="{timeOfferId}/edit" var="editUrl">
<button type="button" role="link" onclick="window.location='${fn:escapeXml(editUrl)}'" style="font-family: 'Lobster'; font-size: 20px;"> <spring:param name="timeOfferId" value="${timeOffer.id}"/>
<span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true" style="padding: 5px"> </span> </spring:url>
Editar oferta</button> <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 oferta</button>
</c:if>
<c:if test="${timeOffer.status eq 'hidden' }"> <c:if test="${timeOffer.status eq 'hidden' }">
<spring:url value="{timeOfferId}/activate" var="activateUrl"> <spring:url value="{timeOfferId}/activate" var="activateUrl">
<spring:param name="timeOfferId" value="${timeOffer.id}"/> <spring:param name="timeOfferId" value="${timeOffer.id}"/>
@ -73,15 +72,11 @@
<span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span> <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true" style="padding: 5px"> </span>
Desactivar oferta</button> Desactivar oferta</button>
</c:if> </c:if>
</c:if>
</div> </div>
</sec:authorize> </sec:authorize>
</div> </div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

@ -18,15 +18,22 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-2 col-sm-10"> <div class="col-sm-offset-2 col-sm-10">
<div class="btn-mod">
<c:choose> <c:choose>
<c:when test="${review['new']}"> <c:when test="${review['new']}">
<button class="btn btn-default" type="submit">Crear Reseña</button> <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:when>
<c:otherwise> <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:otherwise>
</c:choose> </c:choose>
</div>
</div> </div>
</div> </div>
</form:form> </form:form>
</cheapy:layout> </cheapy:layout>

View file

@ -24,11 +24,7 @@
</table> </table>
<div class="btn-return">
<button type="button" role="link" onclick="goBack()" style="font-family: 'Lobster'; font-size: 20px;">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true" style="padding: 5px"> </span>
<fmt:message key="return"/> </button>
</div>
<sec:authentication var="principal" property="principal" /> <sec:authentication var="principal" property="principal" />
<div class="btns-edit"> <div class="btns-edit">
@ -42,10 +38,6 @@
Editar opinión</button> Editar opinión</button>
</c:if> </c:if>
</div> </div>
<script>
function goBack() {
window.history.back()
}
</script>
</cheapy:layout> </cheapy:layout>

View file

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