Skip to content
Snippets Groups Projects
Commit e44552ea authored by Thibault Duchateau's avatar Thibault Duchateau
Browse files

Added Dandelion-Datatables

New dependencies added
Old tables replaced by Datatables using Dandelion-Datatables
parent 9ee5e6f0
No related branches found
No related tags found
No related merge requests found
...@@ -47,7 +47,9 @@ ...@@ -47,7 +47,9 @@
<webjars-bootstrap.version>2.3.0</webjars-bootstrap.version> <webjars-bootstrap.version>2.3.0</webjars-bootstrap.version>
<webjars-jquery-ui.version>1.9.2</webjars-jquery-ui.version> <webjars-jquery-ui.version>1.9.2</webjars-jquery-ui.version>
<webjars-jquery.version>1.9.0</webjars-jquery.version> <webjars-jquery.version>1.9.0</webjars-jquery.version>
<dandelion.datatables.version>0.8.5</dandelion.datatables.version>
<dandelion.datatables.export.itext.version>0.1.5</dandelion.datatables.export.itext.version>
<maven-assembly-plugin.version>2.4</maven-assembly-plugin.version> <maven-assembly-plugin.version>2.4</maven-assembly-plugin.version>
<maven-clean-plugin.version>2.5</maven-clean-plugin.version> <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.0</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.0</maven-compiler-plugin.version>
...@@ -234,7 +236,18 @@ ...@@ -234,7 +236,18 @@
<groupId>org.aspectj</groupId> <groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId> <artifactId>aspectjweaver</artifactId>
</dependency> </dependency>
</dependencies> <!-- Dandelion -->
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-jsp</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-export-itext</artifactId>
<version>${dandelion.datatables.export.itext.version}</version>
</dependency>
</dependencies>
<!-- all Maven plugin versions are mentioned in order to guarantee the build reproducibility in the long term --> <!-- all Maven plugin versions are mentioned in order to guarantee the build reproducibility in the long term -->
<build> <build>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ 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="datatables" uri="http://github.com/dandelion/datatables" %>
<html lang="en"> <html lang="en">
...@@ -12,36 +12,29 @@ ...@@ -12,36 +12,29 @@
<div class="container"> <div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/> <jsp:include page="../fragments/bodyHeader.jsp"/>
<h2>Owners</h2> <h2>Owners</h2>
<table class="table table-striped"> <datatables:table id="owners" data="${selections}" cdn="true" row="owner" theme="bootstrap2"
<thead> cssClass="table table-striped" paginate="false" info="false" export="pdf">
<tr> <datatables:column title="Name" cssStyle="width: 150px;" display="html">
<th style="width: 150px;">Name</th> <spring:url value="owners/{ownerId}.html" var="ownerUrl">
<th style="width: 200px;">Address</th> <spring:param name="ownerId" value="${owner.id}"/>
<th>City</th> </spring:url>
<th>Telephone</th> <a href="${fn:escapeXml(ownerUrl)}"><c:out value="${owner.firstName} ${owner.lastName}"/></a>
<th style="width: 100px;">Pets</th> </datatables:column>
</tr> <datatables:column title="Name" display="pdf">
</thead> <c:out value="${owner.firstName} ${owner.lastName}"/>
<c:forEach var="owner" items="${selections}"> </datatables:column>
<tr> <datatables:column title="Address" property="address" cssStyle="width: 200px;"/>
<td> <datatables:column title="City" property="city"/>
<spring:url value="owners/{ownerId}.html" var="ownerUrl"> <datatables:column title="Telephone" property="telephone"/>
<spring:param name="ownerId" value="${owner.id}"/> <datatables:column title="Pets" cssStyle="width: 100px;">
</spring:url> <c:forEach var="pet" items="${owner.pets}">
<a href="${fn:escapeXml(ownerUrl)}"><c:out value="${owner.firstName} ${owner.lastName}"/></a> <c:out value="${pet.name}"/>
</td> </c:forEach>
<td><c:out value="${owner.address}"/></td> </datatables:column>
<td><c:out value="${owner.city}"/></td> <datatables:export type="pdf" cssClass="btn btn-small" />
<td><c:out value="${owner.telephone}"/></td> </datatables:table>
<td>
<c:forEach var="pet" items="${owner.pets}">
<c:out value="${pet.name}"/>
</c:forEach>
</td>
</tr>
</c:forEach>
</table>
<jsp:include page="../fragments/footer.jsp"/> <jsp:include page="../fragments/footer.jsp"/>
</div> </div>
......
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %>
<html lang="en"> <html lang="en">
...@@ -14,27 +14,18 @@ ...@@ -14,27 +14,18 @@
<h2>Veterinarians</h2> <h2>Veterinarians</h2>
<table class="table table-stripped" style="width:600px;"> <datatables:table id="vets" data="${vets.vetList}" cdn="true" row="vet" theme="bootstrap2" cssClass="table table-striped" paginate="false" info="false">
<thead> <datatables:column title="Name">
<tr> <c:out value="${vet.firstName} ${vet.lastName}"></c:out>
<th>Name</th> </datatables:column>
<th>Specialties</th> <datatables:column title="Specialties">
</tr> <c:forEach var="specialty" items="${vet.specialties}">
</thead> <c:out value="${specialty.name}"/>
<tbody> </c:forEach>
<c:forEach var="vet" items="${vets.vetList}"> <c:if test="${vet.nrOfSpecialties == 0}">none</c:if>
<tr> </datatables:column>
<td><c:out value="${vet.firstName} ${vet.lastName}"/></td> </datatables:table>
<td>
<c:forEach var="specialty" items="${vet.specialties}">
<c:out value="${specialty.name}"/>
</c:forEach>
<c:if test="${vet.nrOfSpecialties == 0}">none</c:if>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<table class="table-buttons"> <table class="table-buttons">
<tr> <tr>
<td> <td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment