form.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <!DOCTYPE html>
  2. <!--suppress XmlHighlighting -->
  3. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  4. <head>
  5. <!-- Required meta tags -->
  6. <meta charset="utf-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  8. <!-- Bootstrap CSS -->
  9. <!--suppress SpellCheckingInspection -->
  10. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
  11. integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  12. <!--suppress SpellCheckingInspection -->
  13. <script src="https://code.jquery.com/jquery-3.6.0.min.js"
  14. integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  15. <title>Grants - person</title>
  16. </head>
  17. <body>
  18. <div th:insert="~{fragments/layout::banner}"></div>
  19. <div class="container border border-info rounded-3 text-center p-4">
  20. <h3>Birth Certificate Details</h3>
  21. <form th:object="${birthCertificateCommand}" th:action="@{/birthCertificate}" method="post">
  22. <div th:if="${#fields.hasErrors('*')}" class="alert alert-danger">
  23. <p>Please Correct The Errors Below</p>
  24. </div>
  25. <table>
  26. <tr>
  27. <td style="text-align: right;">
  28. <label for="id">Database Id &nbsp;<span style="color: rgb(255,0,0);">*</span></label>
  29. </td>
  30. <td style="text-align: left;">
  31. <input class="form-control" id="id"
  32. th:field="*{id}" type="text" readonly>
  33. </td>
  34. </tr>
  35. <tr>
  36. <td style="text-align: right;">
  37. <label for="certificateNumber">Certificate Number&nbsp;</label>
  38. </td>
  39. <td style="text-align: left;">
  40. <input class="form-control" id="certificateNumber"
  41. th:field="*{certificateNumber}" type="text">
  42. <div th:if="${#fields.hasErrors('certificateNumber')}">
  43. <ul class="text-danger">
  44. <li th:each="err : ${#fields.errors('certificateNumber')}" th:text="${err}"/>
  45. </ul>
  46. </div>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td style="text-align: right;">
  51. <label for="certificateSource">Certificate Source&nbsp;</label>
  52. </td>
  53. <td style="text-align: left;">
  54. <div>
  55. <select id="certificateSource" name="certificateSource" th:field="*{certificateSource}">
  56. <option th:value="${''}" th:text="${''}"></option>
  57. <!--/*@thymesVar id="organisations" type="scot.carricksoftware.grants.domains.places.Organisation"*/-->
  58. <option th:each="organisation : ${organisations}"
  59. th:value="${organisation.id}" th:text="${organisation.toString()}"></option>
  60. </select>
  61. <div th:if="${#fields.hasErrors('certificateSource')}">
  62. <ul class="text-danger">
  63. <li th:each="err : ${#fields.errors('certificateSource')}" th:text="${err}"/>
  64. </ul>
  65. </div>
  66. </div>
  67. </td>
  68. </tr>
  69. <tr>
  70. <td style="text-align: right;">
  71. <label for="certificateDate">Certificate Date (dd/mm/yyyy)&nbsp;</label>
  72. </td>
  73. <td style="text-align: left;">
  74. <input class="form-control" id="certificateDate"
  75. th:field="*{certificateDate}" type="text">
  76. <div th:if="${#fields.hasErrors('certificateDate')}">
  77. <ul class="text-danger">
  78. <li th:each="err : ${#fields.errors('certificateDate')}" th:text="${err}"/>
  79. </ul>
  80. </div>
  81. </td>
  82. </tr>
  83. <tr style = "border-bottom: 5px solid #ccc;">
  84. <td style="text-align: right;">
  85. <label for="certificateType">Certificate Type&nbsp;</label>
  86. </td>
  87. <td style="text-align: left;">
  88. <div>
  89. <select id="certificateType" style="width: 200px;" name="certificateType"
  90. th:field="*{certificateType}">
  91. <option th:value="${''}" th:text="${''}"></option>
  92. <option th:each="value : ${T(scot.carricksoftware.grants.enums.certificates.CertificateType).values()}"
  93. th:value="${value}" th:text="${value.label}"></option>
  94. </select>
  95. </div>
  96. <div th:if="${#fields.hasErrors('certificateType')}">
  97. <ul class="text-danger">
  98. <li th:each="err : ${#fields.errors('certificateType')}" th:text="${err}"/>
  99. </ul>
  100. </div>
  101. </tr>
  102. <tr>
  103. <td style="text-align: right;">
  104. <label for="registrationAuthority">Registration Authority&nbsp;</label>
  105. </td>
  106. <td style="text-align: left;">
  107. <div>
  108. <select id="registrationAuthority" style="width: 200px;" name="registrationAuthority"
  109. th:field="*{registrationAuthority}">
  110. <option th:value="${''}" th:text="${''}"></option>
  111. <!--/*@thymesVar id="organisations" type="scot.carricksoftware.grants.domains.places.Organisation"*/-->
  112. <option th:each="organisation : ${organisations}"
  113. th:value="${organisation.id}" th:text="${organisation.name}"></option>
  114. </select>
  115. </div>
  116. <div th:if="${#fields.hasErrors('registrationAuthority')}">
  117. <ul class="text-danger">
  118. <li th:each="err : ${#fields.errors('registrationAuthority')}" th:text="${err}"/>
  119. </ul>
  120. </div>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td style="text-align: right;">
  125. <label for="volume">Volume&nbsp;</label>
  126. </td>
  127. <td style="text-align: left;">
  128. <div>
  129. <input class="volume" id="volume"
  130. th:field="*{volume}" type="text">
  131. <div th:if="${#fields.hasErrors('volume')}">
  132. <ul class="text-danger">
  133. <li th:each="err : ${#fields.errors('volume')}" th:text="${err}"/>
  134. </ul>
  135. </div>
  136. </div>
  137. </td>
  138. </tr>
  139. <tr style = "border-bottom: 5px solid #ccc;">
  140. <td style="text-align: right;">
  141. <label for="number">Number&nbsp;</label>
  142. </td>
  143. <td style="text-align: left;">
  144. <div>
  145. <input class="number" id="number"
  146. th:field="*{number}" type="text">
  147. <div th:if="${#fields.hasErrors('number')}">
  148. <ul class="text-danger">
  149. <li th:each="err : ${#fields.errors('number')}" th:text="${err}"/>
  150. </ul>
  151. </div>
  152. </div>
  153. </td>
  154. <tr>
  155. <td style="text-align: right;">
  156. <label for="newBorn">NewBorn&nbsp;</label>
  157. </td>
  158. <td style="text-align: left;">
  159. <select id="newBorn" name="newBorn" th:field="*{newBorn}">
  160. <option th:value="${''}" th:text="${''}"></option>
  161. <option th:each="person : ${people}"
  162. th:value="${person.id}" th:text="${person.toString()}"></option>
  163. </select>
  164. <div th:if="${#fields.hasErrors('newBorn')}">
  165. <ul class="text-danger">
  166. <li th:each="err : ${#fields.errors('newBorn')}" th:text="${err}"/>
  167. </ul>
  168. </div>
  169. </td>
  170. </tr>
  171. <tr>
  172. <td style="text-align: right;">
  173. <label for="sex">Sex&nbsp;</label>
  174. </td>
  175. <td style="text-align: left;">
  176. <select id="sex" style="width: 200px;" name="sex" th:field="*{sex}">
  177. <option th:value="${''}" th:text="${''}"></option>
  178. <option th:each="value : ${T(scot.carricksoftware.grants.enums.general.Sex).values()}"
  179. th:value="${value}" th:text="${value.label}"></option>
  180. </select>
  181. <div th:if="${#fields.hasErrors('sex')}">
  182. <ul class="text-danger">
  183. <li th:each="err : ${#fields.errors('sex')}" th:text="${err}"/>
  184. </ul>
  185. </div>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td style="text-align: right;">
  190. <label for="whenBorn">When Born (dd/mm/yyyy hh:mm)&nbsp;</label>
  191. </td>
  192. <td style="text-align: left;">
  193. <div>
  194. <input class="whenBorn" id="whenBorn"
  195. th:field="*{whenBorn}" type="text">
  196. <div th:if="${#fields.hasErrors('whenBorn')}">
  197. <ul class="text-danger">
  198. <li th:each="err : ${#fields.errors('whenBorn')}" th:text="${err}"/>
  199. </ul>
  200. </div>
  201. </div>
  202. </td>
  203. <tr>
  204. <td style="text-align: right; background-color: #C39BD3;">
  205. <label for="whereBorn">Where Born&nbsp;</label>
  206. </td>
  207. <td style="text-align: left;">
  208. <select id="whereBorn" name="whereBorn" th:field="*{whereBorn}">
  209. <option th:value="${''}" th:text="${''}"></option>
  210. <option th:each="place : ${places}"
  211. th:value="${place.id}" th:text="${place.toString()}"></option>
  212. </select>
  213. <div th:if="${#fields.hasErrors('whereBorn')}">
  214. <ul class="text-danger">
  215. <li th:each="err : ${#fields.errors('whereBorn')}" th:text="${err}"/>
  216. </ul>
  217. </div>
  218. </td>
  219. </tr>
  220. <tr>
  221. <td style="text-align: right; background-color: #C39BD3;">
  222. <label for="untrackedWhereBorn">Where Born&nbsp;(untracked)</label>
  223. </td>
  224. <td style="text-align: left;">
  225. <div>
  226. <input class="untrackedWhereBorn" id="untrackedWhereBorn"
  227. th:field="*{untrackedWhereBorn}" type="text">
  228. <div th:if="${#fields.hasErrors('untrackedWhereBorn')}">
  229. <ul class="text-danger">
  230. <li th:each="err : ${#fields.errors('untrackedWhereBorn')}" th:text="${err}"/>
  231. </ul>
  232. </div>
  233. </div>
  234. </td>
  235. </tr>
  236. <tr>
  237. <td style="text-align: right; background-color: #D6EEEE;">
  238. <label for="father">Father&nbsp;</label>
  239. </td>
  240. <td style="text-align: left;">
  241. <select id="father" name="father" th:field="*{father}">
  242. <option th:value="${''}" th:text="${''}"></option>
  243. <option th:each="person : ${people}"
  244. th:value="${person.id}" th:text="${person.toString()}"></option>
  245. </select>
  246. <div th:if="${#fields.hasErrors('father')}">
  247. <ul class="text-danger">
  248. <li th:each="err : ${#fields.errors('father')}" th:text="${err}"/>
  249. </ul>
  250. </div>
  251. </td>
  252. </tr>
  253. <tr>
  254. <td style="text-align: right; background-color: #D6EEEE;">
  255. <label for="untrackedFather">Father (untracked)&nbsp;</label>
  256. </td>
  257. <td style="text-align: left; ">
  258. <div>
  259. <input class="number" id="untrackedFather"
  260. th:field="*{untrackedFather}" type="text">
  261. <div th:if="${#fields.hasErrors('untrackedFather')}">
  262. <ul class="text-danger">
  263. <li th:each="err : ${#fields.errors('untrackedFather')}" th:text="${err}"/>
  264. </ul>
  265. </div>
  266. </div>
  267. </td>
  268. </tr>
  269. </table>
  270. <button type="submit" class="btn btn-primary">Commit</button>
  271. <a class="btn btn-secondary" th:href="@{/birthCertificates}" th:text="${'List all'}">List all</a>
  272. <a class="btn btn-success" th:href="@{/}" th:text="${'Home'}">Home</a>
  273. <h6><span style="color: rgb(255,0,0);">*</span><span> Cannot be edited</span></h6>
  274. </form>
  275. </div>
  276. </body>
  277. </html>