-
Notifications
You must be signed in to change notification settings - Fork 29k
Expand file tree
/
Copy pathcreateOrUpdateVisitForm.html
More file actions
59 lines (50 loc) · 1.78 KB
/
createOrUpdateVisitForm.html
File metadata and controls
59 lines (50 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<body>
<h2>
<th:block th:if="${visit['new']}" th:text="#{new}">New </th:block>
Visit
</h2>
<b th:text="#{pet}">Pet</b>
<table class="table table-striped">
<thead>
<tr>
<th th:text="#{name}">Name</th>
<th th:text="#{birthDate}">Birth Date</th>
<th th:text="#{type}">Type</th>
<th th:text="#{owner}">Owner</th>
</tr>
</thead>
<tr>
<td th:text="${pet.name}"></td>
<td th:text="${#temporals.format(pet.birthDate, 'yyyy-MM-dd')}"></td>
<td th:text="${pet.type}"></td>
<td th:text="${owner?.firstName + ' ' + owner?.lastName}"></td>
</tr>
</table>
<form th:object="${visit}" class="form-horizontal" method="post">
<div class="form-group has-feedback">
<input th:replace="~{fragments/inputField :: input (label='Date', name='date', type='date',minVal=${visit?.date})}" />
<input th:replace="~{fragments/inputField :: input ('Description', 'description', 'text')}" />
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="petId" th:value="${pet.id}" />
<button class="btn btn-primary" type="submit" th:text="#{addVisit}">Add Visit</button>
</div>
</div>
</form>
<br />
<b th:text="#{previousVisits}">Previous Visits</b>
<table class="table table-striped">
<tr>
<th th:text="#{date}">Date</th>
<th th:text="#{description}">Description</th>
</tr>
<tr th:if="${!visit['new']}" th:each="visit : ${pet.visits}">
<td th:text="${#temporals.format(visit.date, 'yyyy-MM-dd')}"></td>
<td th:text=" ${visit.description}"></td>
</tr>
</table>
</body>
</html>