Cleanup HTML files

- Fixed broken paging and aligned vetList and OwnersList
- Adding Doctype for consistency
- Removed html5shim and respond for IE < 9
- Reformatting HTML

Signed-off-by: Patrick Baumgartner <contact@patbaumgartner.com>
This commit is contained in:
Patrick Baumgartner 2025-06-04 21:46:07 +02:00 committed by Dave Syer
parent 3a931080d4
commit af8645561b
12 changed files with 232 additions and 259 deletions

View file

@ -2,10 +2,10 @@
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'error')}"> <html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'error')}">
<body> <body>
<img src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}"/> <img src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}" />
<h2 th:text="#{somethingHappened}">Something happened...</h2> <h2 th:text="#{somethingHappened}">Something happened...</h2>
<p th:text="${message}">Exception message</p> <p th:text="${message}">Exception message</p>
</body> </body>
</html> </html>

View file

@ -1,23 +1,21 @@
<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org"> <html xmlns:th="https://www.thymeleaf.org">
<body> <body>
<form> <form>
<th:block th:fragment="input (label, name, type)"> <th:block th:fragment="input (label, name, type)">
<div th:with="valid=${!#fields.hasErrors(name)}" <div th:with="valid=${!#fields.hasErrors(name)}" th:class="${'form-group' + (valid ? '' : ' has-error')}"
th:class="${'form-group' + (valid ? '' : ' has-error')}"
class="form-group"> class="form-group">
<label th:for="${name}" class="col-sm-2 control-label" th:text="${label}">Label</label> <label th:for="${name}" class="col-sm-2 control-label" th:text="${label}">Label</label>
<div class="col-sm-10"> <div class="col-sm-10">
<div th:switch="${type}"> <div th:switch="${type}">
<input th:case="'text'" class="form-control" type="text" th:field="*{__${name}__}" /> <input th:case="'text'" class="form-control" type="text" th:field="*{__${name}__}" />
<input th:case="'date'" class="form-control" type="date" th:field="*{__${name}__}"/> <input th:case="'date'" class="form-control" type="date" th:field="*{__${name}__}" />
</div> </div>
<span th:if="${valid}" <span th:if="${valid}" class="fa fa-ok form-control-feedback" aria-hidden="true"></span>
class="fa fa-ok form-control-feedback"
aria-hidden="true"></span>
<th:block th:if="${!valid}"> <th:block th:if="${!valid}">
<span <span class="fa fa-remove form-control-feedback" aria-hidden="true"></span>
class="fa fa-remove form-control-feedback"
aria-hidden="true"></span>
<span class="help-inline" th:errors="*{__${name}__}" th:text="#{error}">Error</span> <span class="help-inline" th:errors="*{__${name}__}" th:text="#{error}">Error</span>
</th:block> </th:block>
</div> </div>
@ -25,4 +23,5 @@
</th:block> </th:block>
</form> </form>
</body> </body>
</html>
</html>

View file

@ -1,6 +1,6 @@
<!doctype html> <!DOCTYPE html>
<html th:fragment="layout (template, menu)"
xmlns:th="https://www.thymeleaf.org"> <html th:fragment="layout (template, menu)" xmlns:th="https://www.thymeleaf.org">
<head> <head>
@ -8,16 +8,8 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" th:href="@{/resources/images/favicon.png}"> <link rel="shortcut icon" type="image/x-icon" th:href="@{/resources/images/favicon.png}">
<title th:text="#{layoutTitle}">PetClinic :: a Spring Framework demonstration</title> <title th:text="#{layoutTitle}">PetClinic :: a Spring Framework demonstration</title>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link th:href="@{/webjars/font-awesome/css/font-awesome.min.css}" rel="stylesheet"> <link th:href="@{/webjars/font-awesome/css/font-awesome.min.css}" rel="stylesheet">
<link rel="stylesheet" th:href="@{/resources/css/petclinic.css}" /> <link rel="stylesheet" th:href="@{/resources/css/petclinic.css}" />
@ -81,7 +73,8 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-12 text-center"> <div class="col-12 text-center">
<img src="../static/images/spring-logo.svg" th:src="@{/resources/images/spring-logo.svg}" alt="VMware Tanzu Logo" class="logo"> <img src="../static/images/spring-logo.svg" th:src="@{/resources/images/spring-logo.svg}"
alt="VMware Tanzu Logo" class="logo">
</div> </div>
</div> </div>
</div> </div>
@ -92,4 +85,4 @@
</body> </body>
</html> </html>

View file

@ -1,24 +1,21 @@
<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org"> <html xmlns:th="https://www.thymeleaf.org">
<body> <body>
<form> <form>
<th:block th:fragment="select (label, name, items)"> <th:block th:fragment="select (label, name, items)">
<div th:with="valid=${!#fields.hasErrors(name)}" <div th:with="valid=${!#fields.hasErrors(name)}" th:class="${'form-group' + (valid ? '' : ' has-error')}"
th:class="${'form-group' + (valid ? '' : ' has-error')}"
class="form-group"> class="form-group">
<label th:for="${name}" class="col-sm-2 control-label" th:text="${label}">Label</label> <label th:for="${name}" class="col-sm-2 control-label" th:text="${label}">Label</label>
<div class="col-sm-10"> <div class="col-sm-10">
<select th:field="*{__${name}__}"> <select th:field="*{__${name}__}">
<option th:each="item : ${items}" th:value="${item}" <option th:each="item : ${items}" th:value="${item}" th:text="${item}">dog</option>
th:text="${item}">dog</option>
</select> </select>
<span th:if="${valid}" <span th:if="${valid}" class="fa fa-ok form-control-feedback" aria-hidden="true"></span>
class="fa fa-ok form-control-feedback"
aria-hidden="true"></span>
<th:block th:if="${!valid}"> <th:block th:if="${!valid}">
<span <span class="fa fa-remove form-control-feedback" aria-hidden="true"></span>
class="fa fa-remove form-control-feedback"
aria-hidden="true"></span>
<span class="help-inline" th:errors="*{__${name}__}" th:text="#{error}">Error</span> <span class="help-inline" th:errors="*{__${name}__}" th:text="#{error}">Error</span>
</th:block> </th:block>
</div> </div>
@ -26,4 +23,5 @@
</th:block> </th:block>
</form> </form>
</body> </body>
</html>
</html>

View file

@ -1,30 +1,25 @@
<html xmlns:th="https://www.thymeleaf.org" <!DOCTYPE html>
th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<body> <body>
<h2 th:text="#{owner}">Owner</h2> <h2 th:text="#{owner}">Owner</h2>
<form th:object="${owner}" class="form-horizontal" id="add-owner-form" method="post"> <form th:object="${owner}" class="form-horizontal" id="add-owner-form" method="post">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<input <input th:replace="~{fragments/inputField :: input (#{firstName}, 'firstName', 'text')}" />
th:replace="~{fragments/inputField :: input (#{firstName}, 'firstName', 'text')}" /> <input th:replace="~{fragments/inputField :: input (#{lastName}, 'lastName', 'text')}" />
<input <input th:replace="~{fragments/inputField :: input (#{address}, 'address', 'text')}" />
th:replace="~{fragments/inputField :: input (#{lastName}, 'lastName', 'text')}" /> <input th:replace="~{fragments/inputField :: input (#{city}, 'city', 'text')}" />
<input <input th:replace="~{fragments/inputField :: input (#{telephone}, 'telephone', 'text')}" />
th:replace="~{fragments/inputField :: input (#{address}, 'address', 'text')}" />
<input
th:replace="~{fragments/inputField :: input (#{city}, 'city', 'text')}" />
<input
th:replace="~{fragments/inputField :: input (#{telephone}, 'telephone', 'text')}" />
</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">
<button <button th:with="text=${owner['new']} ? #{addOwner} : #{updateOwner}" class="btn btn-primary" type="submit"
th:with="text=${owner['new']} ? #{addOwner} : #{updateOwner}" th:text="${text}">Add Owner</button>
class="btn btn-primary" type="submit" th:text="${text}">Add
Owner</button>
</div> </div>
</div> </div>
</form> </form>
</body> </body>
</html>
</html>

View file

@ -1,21 +1,20 @@
<html xmlns:th="https://www.thymeleaf.org" <!DOCTYPE html>
th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<body> <body>
<h2 th:text="#{findOwners}">Find Owners</h2> <h2 th:text="#{findOwners}">Find Owners</h2>
<form th:object="${owner}" th:action="@{/owners}" method="get" <form th:object="${owner}" th:action="@{/owners}" method="get" class="form-horizontal" id="search-owner-form">
class="form-horizontal" id="search-owner-form">
<div class="form-group"> <div class="form-group">
<div class="control-group" id="lastNameGroup"> <div class="control-group" id="lastNameGroup">
<label class="col-sm-2 control-label" th:text="#{lastName}">Last name </label> <label class="col-sm-2 control-label" th:text="#{lastName}">Last name </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input class="form-control" th:field="*{lastName}" size="30" <input class="form-control" th:field="*{lastName}" size="30" maxlength="80" />
maxlength="80" />
<span class="help-inline"> <span class="help-inline">
<div th:if="${#fields.hasAnyErrors()}"> <div th:if="${#fields.hasAnyErrors()}">
<p th:each="err : ${#fields.allErrors()}" th:text="${err}">Error</p> <p th:each="err : ${#fields.allErrors()}" th:text="${err}">Error</p>
</div> </div>
</span> </span>
</div> </div>
@ -32,4 +31,5 @@
</form> </form>
</body> </body>
</html>
</html>

View file

@ -1,102 +1,96 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org" <html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<body> <body>
<h2 th:text="#{ownerInformation}">Owner Information</h2>
<div th:if="${message}" class="alert alert-success" id="success-message"> <h2 th:text="#{ownerInformation}">Owner Information</h2>
<span th:text="${message}"></span>
</div>
<div th:if="${error}" class="alert alert-danger" id="error-message"> <div th:if="${message}" class="alert alert-success" id="success-message">
<span th:text="${error}"></span> <span th:text="${message}"></span>
</div> </div>
<div th:if="${error}" class="alert alert-danger" id="error-message">
<span th:text="${error}"></span>
</div>
<table class="table table-striped" th:object="${owner}">
<tr>
<th th:text="#{name}">Name</th>
<td><b th:text="*{firstName + ' ' + lastName}"></b></td>
</tr>
<tr>
<th th:text="#{address}">Address</th>
<td th:text="*{address}"></td>
</tr>
<tr>
<th th:text="#{city}">City</th>
<td th:text="*{city}"></td>
</tr>
<tr>
<th th:text="#{telephone}">Telephone</th>
<td th:text="*{telephone}"></td>
</tr>
</table>
<a th:href="@{__${owner.id}__/edit}" class="btn btn-primary" th:text="#{editOwner}">Edit
Owner</a>
<a th:href="@{__${owner.id}__/pets/new}" class="btn btn-primary" th:text="#{addNewPet}">Add
New Pet</a>
<table class="table table-striped" th:object="${owner}"> <br />
<tr> <br />
<th th:text="#{name}">Name</th> <br />
<td><b th:text="*{firstName + ' ' + lastName}"></b></td> <h2 th:text="#{petsAndVisits}">Pets and Visits</h2>
</tr>
<tr> <table class="table table-striped">
<th th:text="#{address}">Address</th>
<td th:text="*{address}"></td> <tr th:each="pet : ${owner.pets}">
</tr> <td valign="top">
<tr> <dl class="dl-horizontal">
<th th:text="#{city}">City</th> <dt th:text="#{name}">Name</dt>
<td th:text="*{city}"></td> <dd th:text="${pet.name}"></dd>
</tr> <dt th:text="#{birthDate}">Birth Date</dt>
<tr> <dd th:text="${#temporals.format(pet.birthDate, 'yyyy-MM-dd')}"></dd>
<th th:text="#{telephone}">Telephone</th> <dt th:text="#{type}">Type</dt>
<td th:text="*{telephone}"></td> <dd th:text="${pet.type}"></dd>
</tr> </dl>
</table> </td>
<td valign="top">
<a th:href="@{__${owner.id}__/edit}" class="btn btn-primary" th:text="#{editOwner}">Edit <table class="table-condensed">
Owner</a> <thead>
<a th:href="@{__${owner.id}__/pets/new}" class="btn btn-primary" th:text="#{addNewPet}">Add
New Pet</a>
<br />
<br />
<br />
<h2 th:text="#{petsAndVisits}">Pets and Visits</h2>
<table class="table table-striped">
<tr th:each="pet : ${owner.pets}">
<td valign="top">
<dl class="dl-horizontal">
<dt th:text="#{name}">Name</dt>
<dd th:text="${pet.name}"></dd>
<dt th:text="#{birthDate}">Birth Date</dt>
<dd
th:text="${#temporals.format(pet.birthDate, 'yyyy-MM-dd')}"></dd>
<dt th:text="#{type}">Type</dt>
<dd th:text="${pet.type}"></dd>
</dl>
</td>
<td valign="top">
<table class="table-condensed">
<thead>
<tr>
<th th:text="#{visitDate}">Visit Date</th>
<th th:text="#{description}">Description</th>
</tr>
</thead>
<tr th:each="visit : ${pet.visits}">
<td th:text="${#temporals.format(visit.date, 'yyyy-MM-dd')}"></td>
<td th:text="${visit?.description}"></td>
</tr>
<tr> <tr>
<td><a th:href="@{__${owner.id}__/pets/__${pet.id}__/edit}" th:text="#{editPet}">Edit Pet</a></td> <th th:text="#{visitDate}">Visit Date</th>
<td><a th:href="@{__${owner.id}__/pets/__${pet.id}__/visits/new}" th:text="#{addVisit}">Add Visit</a></td> <th th:text="#{description}">Description</th>
</tr> </tr>
</table> </thead>
</td> <tr th:each="visit : ${pet.visits}">
</tr> <td th:text="${#temporals.format(visit.date, 'yyyy-MM-dd')}"></td>
<td th:text="${visit?.description}"></td>
</table> </tr>
<script> <tr>
<td><a th:href="@{__${owner.id}__/pets/__${pet.id}__/edit}" th:text="#{editPet}">Edit Pet</a></td>
<td><a th:href="@{__${owner.id}__/pets/__${pet.id}__/visits/new}" th:text="#{addVisit}">Add Visit</a></td>
</tr>
</table>
</td>
</tr>
</table>
<script>
// Function to hide the success and error messages after 3 seconds // Function to hide the success and error messages after 3 seconds
function hideMessages() { function hideMessages() {
setTimeout(function() { setTimeout(function () {
document.getElementById("success-message").style.display = "none"; document.getElementById("success-message").style.display = "none";
document.getElementById("error-message").style.display = "none"; document.getElementById("error-message").style.display = "none";
}, 3000); // 3000 milliseconds (3 seconds) }, 3000); // 3000 milliseconds (3 seconds)
} }
// Call the function to hide messages // Call the function to hide messages
hideMessages(); hideMessages();
</script> </script>
</body> </body>
</html> </html>

View file

@ -4,59 +4,58 @@
<body> <body>
<h2 th:text="#{owners}">Owners</h2> <h2 th:text="#{owners}">Owners</h2>
<table id="owners" class="table table-striped"> <table id="owners" class="table table-striped">
<thead> <thead>
<tr> <tr>
<th th:text="#{name}" style="width: 150px;">Name</th> <th th:text="#{name}" style="width: 150px;">Name</th>
<th th:text="#{address}" style="width: 200px;">Address</th> <th th:text="#{address}" style="width: 200px;">Address</th>
<th th:text="#{city}">City</th> <th th:text="#{city}">City</th>
<th th:text="#{telephone}" style="width: 120px">Telephone</th> <th th:text="#{telephone}" style="width: 120px">Telephone</th>
<th th:text="#{pets}">Pets</th> <th th:text="#{pets}">Pets</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="owner : ${listOwners}"> <tr th:each="owner : ${listOwners}">
<td> <td>
<a th:href="@{/owners/__${owner.id}__}" th:text="${owner.firstName + ' ' + owner.lastName}"/></a> <a th:href="@{/owners/__${owner.id}__}" th:text="${owner.firstName + ' ' + owner.lastName}" /></a>
</td> </td>
<td th:text="${owner.address}"/> <td th:text="${owner.address}" />
<td th:text="${owner.city}"/> <td th:text="${owner.city}" />
<td th:text="${owner.telephone}"/> <td th:text="${owner.telephone}" />
<td><span th:text="${#strings.listJoin(owner.pets, ', ')}"/></td> <td><span th:text="${#strings.listJoin(owner.pets, ', ')}" /></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div th:if="${totalPages > 1}"> <div th:if="${totalPages > 1}">
<span th:text="#{pages}">Pages:</span> <span th:text="#{pages}">Pages:</span>
<span>[</span> <span>[</span>
<span th:each="i: ${#numbers.sequence(1, totalPages)}"> <span th:each="i: ${#numbers.sequence(1, totalPages)}">
<a th:if="${currentPage != i}" th:href="@{'/owners?page=' + ${i}}">[[${i}]]</a> <a th:if="${currentPage != i}" th:href="@{'/owners?page=' + ${i}}">[[${i}]]</a>
<span th:unless="${currentPage != i}">[[${i}]]</span> <span th:unless="${currentPage != i}">[[${i}]]</span>
</span> </span>
<span>]&nbsp;</span> <span>]&nbsp;</span>
<span> <span>
<a th:if="${currentPage > 1}" th:href="@{'/owners?page=1'}" th:title="#{first}" <a th:if="${currentPage > 1}" th:href="@{'/owners?page=1'}" th:title="#{first}" class="fa fa-fast-backward"></a>
class="fa fa-fast-backward"></a>
<span th:unless="${currentPage > 1}" th:title="#{first}" class="fa fa-fast-backward"></span> <span th:unless="${currentPage > 1}" th:title="#{first}" class="fa fa-fast-backward"></span>
</span> </span>
<span> <span>
<a th:if="${currentPage > 1}" th:href="@{'/owners?page=__${currentPage - 1}__'}" th:title="#{previous}" <a th:if="${currentPage > 1}" th:href="@{'/owners?page=__${currentPage - 1}__'}" th:title="#{previous}"
class="fa fa-step-backward"></a> class="fa fa-step-backward"></a>
<span th:unless="${currentPage > 1}" th:title="#{previous}" class="fa fa-step-backward"></span> <span th:unless="${currentPage > 1}" th:title="#{previous}" class="fa fa-step-backward"></span>
</span> </span>
<span> <span>
<a th:if="${currentPage < totalPages}" th:href="@{'/owners?page=__${currentPage + 1}__'}" th:title="#{next}" <a th:if="${currentPage < totalPages}" th:href="@{'/owners?page=__${currentPage + 1}__'}" th:title="#{next}"
class="fa fa-step-forward"></a> class="fa fa-step-forward"></a>
<span th:unless="${currentPage < totalPages}" th:title="#{next}" class="fa fa-step-forward"></span> <span th:unless="${currentPage < totalPages}" th:title="#{next}" class="fa fa-step-forward"></span>
</span> </span>
<span> <span>
<a th:if="${currentPage < totalPages}" th:href="@{'/owners?page=__${totalPages}__'}" th:title="#{last}" <a th:if="${currentPage < totalPages}" th:href="@{'/owners?page=__${totalPages}__'}" th:title="#{last}"
class="fa fa-fast-forward"></a> class="fa fa-fast-forward"></a>
<span th:unless="${currentPage < totalPages}" th:title="#{last}" class="fa fa-step-forward"></span> <span th:unless="${currentPage < totalPages}" th:title="#{last}" class="fa fa-fast-forward"></span>
</span> </span>
</div> </div>
</body> </body>
</html>
</html>

View file

@ -1,5 +1,6 @@
<html xmlns:th="https://www.thymeleaf.org" <!DOCTYPE html>
th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<body> <body>
@ -16,22 +17,18 @@
<span th:text="${owner?.firstName + ' ' + owner?.lastName}" /> <span th:text="${owner?.firstName + ' ' + owner?.lastName}" />
</div> </div>
</div> </div>
<input <input th:replace="~{fragments/inputField :: input ('Name', 'name', 'text')}" />
th:replace="~{fragments/inputField :: input ('Name', 'name', 'text')}" /> <input th:replace="~{fragments/inputField :: input ('Birth Date', 'birthDate', 'date')}" />
<input <input th:replace="~{fragments/selectField :: select ('Type', 'type', ${types})}" />
th:replace="~{fragments/inputField :: input ('Birth Date', 'birthDate', 'date')}" />
<input
th:replace="~{fragments/selectField :: select ('Type', 'type', ${types})}" />
</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">
<button <button th:with="text=${pet['new']} ? 'Add Pet' : 'Update Pet'" class="btn btn-primary" type="submit"
th:with="text=${pet['new']} ? 'Add Pet' : 'Update Pet'" th:text="${text}">Add Pet</button>
class="btn btn-primary" type="submit" th:text="${text}">Add Pet</button>
</div> </div>
</div> </div>
</form> </form>
</body> </body>
</html> </html>

View file

@ -1,5 +1,6 @@
<html xmlns:th="https://www.thymeleaf.org" <!DOCTYPE html>
th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<body> <body>
@ -20,20 +21,16 @@
</thead> </thead>
<tr> <tr>
<td th:text="${pet.name}"></td> <td th:text="${pet.name}"></td>
<td <td th:text="${#temporals.format(pet.birthDate, 'yyyy-MM-dd')}"></td>
th:text="${#temporals.format(pet.birthDate, 'yyyy-MM-dd')}"></td>
<td th:text="${pet.type}"></td> <td th:text="${pet.type}"></td>
<td <td th:text="${owner?.firstName + ' ' + owner?.lastName}"></td>
th:text="${owner?.firstName + ' ' + owner?.lastName}"></td>
</tr> </tr>
</table> </table>
<form th:object="${visit}" class="form-horizontal" method="post"> <form th:object="${visit}" class="form-horizontal" method="post">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<input <input th:replace="~{fragments/inputField :: input ('Date', 'date', 'date')}" />
th:replace="~{fragments/inputField :: input ('Date', 'date', 'date')}" /> <input th:replace="~{fragments/inputField :: input ('Description', 'description', 'text')}" />
<input
th:replace="~{fragments/inputField :: input ('Description', 'description', 'text')}" />
</div> </div>
<div class="form-group"> <div class="form-group">
@ -58,4 +55,5 @@
</table> </table>
</body> </body>
</html>
</html>

View file

@ -1,57 +1,57 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org" <html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'vets')}">
th:replace="~{fragments/layout :: layout (~{::body},'vets')}">
<body> <body>
<h2 th:text="#{vets}">Veterinarians</h2> <h2 th:text="#{vets}">Veterinarians</h2>
<table id="vets" class="table table-striped"> <table id="vets" class="table table-striped">
<thead> <thead>
<tr> <tr>
<th th:text="#{name}">Name</th> <th th:text="#{name}">Name</th>
<th th:text="#{specialties}">Specialties</th> <th th:text="#{specialties}">Specialties</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="vet : ${listVets}"> <tr th:each="vet : ${listVets}">
<td th:text="${vet.firstName + ' ' + vet.lastName}"></td> <td th:text="${vet.firstName + ' ' + vet.lastName}"></td>
<td><span th:each="specialty : ${vet.specialties}" <td>
th:text="${specialty.name + ' '}"/> <span <span th:each="specialty : ${vet.specialties}" th:text="${specialty.name + ' '}" /> <span
th:if="${vet.nrOfSpecialties == 0}" th:text="#{none}">none</span></td> th:if="${vet.nrOfSpecialties == 0}" th:text="#{none}">none</span>
</tr> </td>
</tbody> </tr>
</table> </tbody>
</table>
<div th:if="${totalPages > 1}"> <div th:if="${totalPages > 1}">
<span th:text="#{pages}">Pages:</span> <span th:text="#{pages}">Pages:</span>
<span>[</span> <span>[</span>
<span th:each="i: ${#numbers.sequence(1, totalPages)}"> <span th:each="i: ${#numbers.sequence(1, totalPages)}">
<a th:if="${currentPage != i}" th:href="@{'/vets.html?page=__${i}__'}">[[${i}]]</a> <a th:if="${currentPage != i}" th:href="@{'/vets.html?page=__${i}__'}">[[${i}]]</a>
<span th:unless="${currentPage != i}">[[${i}]]</span> <span th:unless="${currentPage != i}">[[${i}]]</span>
</span> </span>
<span>]&nbsp;</span> <span>]&nbsp;</span>
<span> <span>
<a th:if="${currentPage > 1}" th:href="@{'/vets.html?page=1'}" th:title="#{first}" <a th:if="${currentPage > 1}" th:href="@{'/vets.html?page=1'}" th:title="#{first}"
class="fa fa-fast-backward"></a> class="fa fa-fast-backward"></a>
<span th:unless="${currentPage > 1}" th:text="#{first}" th:title="#{first}" class="fa fa-fast-backward"></span> <span th:unless="${currentPage > 1}" th:title="#{first}" class="fa fa-fast-backward"></span>
</span> </span>
<span> <span>
<a th:if="${currentPage > 1}" th:href="@{'/vets.html?page=__${currentPage - 1}__'}" th:title="#{previous}" <a th:if="${currentPage > 1}" th:href="@{'/vets.html?page=__${currentPage - 1}__'}" th:title="#{previous}"
class="fa fa-step-backward"></a> class="fa fa-step-backward"></a>
<span th:unless="${currentPage > 1}" th:text="#{previous}" th:title="#{previous}" class="fa fa-step-backward"></span> <span th:unless="${currentPage > 1}" th:title="#{previous}" class="fa fa-step-backward"></span>
</span> </span>
<span> <span>
<a th:if="${currentPage < totalPages}" th:href="@{'/vets.html?page=__${currentPage + 1}__'}" th:title="#{next}" <a th:if="${currentPage < totalPages}" th:href="@{'/vets.html?page=__${currentPage + 1}__'}" th:title="#{next}"
class="fa fa-step-forward"></a> class="fa fa-step-forward"></a>
<span th:unless="${currentPage < totalPages}" th:text="#{next}" th:title="#{next}" class="fa fa-step-forward"></span> <span th:unless="${currentPage < totalPages}" th:title="#{next}" class="fa fa-step-forward"></span>
</span> </span>
<span> <span>
<a th:if="${currentPage < totalPages}" th:href="@{'/vets.html?page=__${totalPages}__'}" th:title="#{last}" <a th:if="${currentPage < totalPages}" th:href="@{'/vets.html?page=__${totalPages}__'}" th:title="#{last}"
class="fa fa-fast-forward"></a> class="fa fa-fast-forward"></a>
<span th:unless="${currentPage < totalPages}" th:text="#{last}" class="fa fa-fast-forward"></span> <span th:unless="${currentPage < totalPages}" th:title="#{last}" class="fa fa-fast-forward"></span>
</span> </span>
</div> </div>
</body> </body>
</html>
</html>

View file

@ -2,15 +2,15 @@
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'home')}"> <html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'home')}">
<body> <body>
<h2 th:text="#{welcome}">Welcome</h2> <h2 th:text="#{welcome}">Welcome</h2>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<img class="img-responsive" src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}"/> <img class="img-responsive" src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}" />
</div>
</div> </div>
</div>
</body> </body>
</html> </html>