forked from springframeworkguru/sfg-pet-clinic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
display Owner Record closes springframeworkguru#53
- Loading branch information
1 parent
8f0670d
commit 888d2a8
Showing
6 changed files
with
203 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
pet-clinic-web/src/main/resources/templates/owners/createOrUpdateOwnerForm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<html xmlns:th="http://www.thymeleaf.org" | ||
th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> | ||
|
||
<body> | ||
|
||
<h2>Owner</h2> | ||
<form th:object="${owner}" class="form-horizontal" id="add-owner-form" method="post"> | ||
<div class="form-group has-feedback"> | ||
<input | ||
th:replace="~{fragments/inputField :: input ('First Name', 'firstName', 'text')}" /> | ||
<input | ||
th:replace="~{fragments/inputField :: input ('Last Name', 'lastName', 'text')}" /> | ||
<input | ||
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 class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<button | ||
th:with="text=${owner['new']} ? 'Add Owner' : 'Update Owner'" | ||
class="btn btn-default" type="submit" th:text="${text}">Add | ||
Owner</button> | ||
</div> | ||
</div> | ||
</form> | ||
</body> | ||
</html> |
35 changes: 35 additions & 0 deletions
35
pet-clinic-web/src/main/resources/templates/owners/findOwners.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<html xmlns:th="http://www.thymeleaf.org" | ||
th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> | ||
|
||
<body> | ||
|
||
<h2>Find Owners</h2> | ||
|
||
<form th:object="${owner}" th:action="@{/owners}" method="get" | ||
class="form-horizontal" id="search-owner-form"> | ||
<div class="form-group"> | ||
<div class="control-group" id="lastNameGroup"> | ||
<label class="col-sm-2 control-label">Last name </label> | ||
<div class="col-sm-10"> | ||
<input class="form-control" th:field="*{lastName}" size="30" | ||
maxlength="80" /> <span class="help-inline"><div | ||
th:if="${#fields.hasAnyErrors()}"> | ||
<p th:each="err : ${#fields.allErrors()}" th:text="${err}">Error</p> | ||
</div></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<button type="submit" class="btn btn-default">Find | ||
Owner</button> | ||
</div> | ||
</div> | ||
|
||
</form> | ||
|
||
<br /> | ||
<a class="btn btn-default" th:href="@{/owners/new}">Add Owner</a> | ||
|
||
</body> | ||
</html> |
83 changes: 83 additions & 0 deletions
83
pet-clinic-web/src/main/resources/templates/owners/ownerDetails.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<!DOCTYPE html> | ||
|
||
<html xmlns:th="http://www.thymeleaf.org" | ||
th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> | ||
|
||
<body> | ||
|
||
|
||
<h2>Owner Information</h2> | ||
|
||
|
||
<table class="table table-striped" th:object="${owner}"> | ||
<tr> | ||
<th>Name</th> | ||
<td><b th:text="*{firstName + ' ' + lastName}"></b></td> | ||
</tr> | ||
<tr> | ||
<th>Address</th> | ||
<td th:text="*{address}" /></td> | ||
</tr> | ||
<tr> | ||
<th>City</th> | ||
<td th:text="*{city}" /></td> | ||
</tr> | ||
<tr> | ||
<th>Telephone</th> | ||
<td th:text="*{telephone}" /></td> | ||
</tr> | ||
</table> | ||
|
||
<a th:href="@{{id}/edit(id=${owner.id})}" class="btn btn-default">Edit | ||
Owner</a> | ||
<a th:href="@{{id}/pets/new(id=${owner.id})}" class="btn btn-default">Add | ||
New Pet</a> | ||
|
||
<br /> | ||
<br /> | ||
<br /> | ||
<h2>Pets and Visits</h2> | ||
|
||
<table class="table table-striped"> | ||
|
||
<tr th:each="pet : ${owner.pets}"> | ||
<td valign="top"> | ||
<dl class="dl-horizontal"> | ||
<dt>Name</dt> | ||
<dd th:text="${pet.name}" /></dd> | ||
<dt>Birth Date</dt> | ||
<dd | ||
th:text="${#temporals.format(pet.birthDate, 'yyyy-MM-dd')}" /></dd> | ||
<dt>Type</dt> | ||
<dd th:text="${pet.type}" /></dd> | ||
</dl> | ||
</td> | ||
<td valign="top"> | ||
<table class="table-condensed"> | ||
<thead> | ||
<tr> | ||
<th>Visit Date</th> | ||
<th>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> | ||
<td><a | ||
th:href="@{{ownerId}/pets/{petId}/edit(ownerId=${owner.id},petId=${pet.id})}">Edit | ||
Pet</a></td> | ||
<td><a | ||
th:href="@{{ownerId}/pets/{petId}/visits/new(ownerId=${owner.id},petId=${pet.id})}">Add | ||
Visit</a></td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
|
||
</table> | ||
|
||
</body> | ||
|
||
</html> |
33 changes: 33 additions & 0 deletions
33
pet-clinic-web/src/main/resources/templates/owners/ownersList.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
|
||
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> | ||
|
||
<body> | ||
|
||
<h2>Owners</h2> | ||
|
||
<table id="vets" class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th style="width: 150px;">Name</th> | ||
<th style="width: 200px;">Address</th> | ||
<th>City</th> | ||
<th style="width: 120px">Telephone</th> | ||
<th>Pets</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr th:each="owner : ${selections}"> | ||
<td> | ||
<a th:href="@{/owners/__${owner.id}__}" th:text="${owner.firstName + ' ' + owner.lastName}"/></a> | ||
</td> | ||
<td th:text="${owner.address}"/> | ||
<td th:text="${owner.city}"/> | ||
<td th:text="${owner.telephone}"/> | ||
<td><span th:each="pet : ${owner.pets}" th:text="${pet.name} "/></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters