form.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. <!--/*@thymesVar id="birthCertificateCommand" type="scot.carricksoftware.grants.commands.certificates.birthCertificates.BirthCertificateCommand"*/-->
  19. <!--/*@thymesVar id="place" type="scot.carricksoftware.grants.domains.places.Place"*/-->
  20. <div th:insert="~{fragments/layout::banner}"></div>
  21. <div class="container border border-info rounded-3 text-center p-4">
  22. <h3>Birth Certificate Details</h3>
  23. <form th:object="${birthCertificateCommand}" th:action="@{/birthCertificate}" method="post">
  24. <div th:if="${#fields.hasErrors('*')}" class="alert alert-danger">
  25. <p>Please Correct The Errors Below</p>
  26. </div>
  27. <table>
  28. <tr>
  29. <td style="text-align: right;">
  30. <label for="id">Database Id &nbsp;<span style="color: rgb(255,0,0);">*</span></label>
  31. </td>
  32. <td style="text-align: left;">
  33. <input class="form-control" id="id"
  34. th:field="*{id}" type="text" readonly>
  35. </td>
  36. </tr>
  37. <tr>
  38. <td style="text-align: right;">
  39. <label for="certificateNumber">Certificate Number&nbsp;</label>
  40. </td>
  41. <td style="text-align: left;">
  42. <input class="form-control" id="certificateNumber"
  43. th:field="*{certificateNumber}" type="text">
  44. <div th:if="${#fields.hasErrors('certificateNumber')}">
  45. <ul class="text-danger">
  46. <li th:each="err : ${#fields.errors('certificateNumber')}" th:text="${err}"/>
  47. </ul>
  48. </div>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td style="text-align: right;">
  53. <label for="certificateSource">Certificate Source&nbsp;</label>
  54. </td>
  55. <td style="text-align: left;">
  56. <div>
  57. <select id="certificateSource" name="place" th:field="*{certificateSource}">
  58. <option th:value="${''}" th:text="${''}"></option>
  59. <option th:each="place : ${places}"
  60. th:value="${place.id}" th:text="${place.toString()}"></option>
  61. </select>
  62. <div th:if="${#fields.hasErrors('certificateSource')}">
  63. <ul class="text-danger">
  64. <li th:each="err : ${#fields.errors('certificateSource')}" th:text="${err}"/>
  65. </ul>
  66. </div>
  67. </div>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td style="text-align: right;">
  72. <label for="certificateDate">Issued At (dd/mm/yyyy)&nbsp;</label>
  73. </td>
  74. <td style="text-align: left;">
  75. <input class="form-control" id="certificateDate"
  76. th:field="*{certificateDate}" type="text">
  77. <div th:if="${#fields.hasErrors('certificateDate')}">
  78. <ul class="text-danger">
  79. <li th:each="err : ${#fields.errors('certificateDate')}" th:text="${err}"/>
  80. </ul>
  81. </div>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td style="text-align: right;">
  86. <label for="certificateType">Certificate Type&nbsp;</label>
  87. </td>
  88. <td style="text-align: left;">
  89. <div>
  90. <select id="certificateType" style="width: 200px;" name="certificateType"
  91. th:field="*{certificateType}">
  92. <option th:value="${''}" th:text="${''}"></option>
  93. <option th:each="value : ${T(scot.carricksoftware.grants.enums.certificates.CertificateType).values()}"
  94. th:value="${value}" th:text="${value.label}"></option>
  95. </select>
  96. </div>
  97. </td>
  98. </tr>
  99. <tr>
  100. <td style="text-align: right;">
  101. <label for="newBorn">NewBorn</label>
  102. </td>
  103. <td style="text-align: left;">
  104. <select id="newBorn" name="place" th:field="*{newBorn}">
  105. <option th:value="${''}" th:text="${''}"></option>
  106. <option th:each="person : ${people}"
  107. th:value="${person.id}" th:text="${person.toString()}"></option>
  108. </select>
  109. <div th:if="${#fields.hasErrors('newBorn')}">
  110. <ul class="text-danger">
  111. <li th:each="err : ${#fields.errors('newBorn')}" th:text="${err}"/>
  112. </ul>
  113. </div>
  114. </td>
  115. </tr>
  116. </table>
  117. <button type="submit" class="btn btn-primary">Commit</button>
  118. <a class="btn btn-secondary" th:href="@{/birthCertificates}" th:text="${'List all'}">List all</a>
  119. <a class="btn btn-success" th:href="@{/}" th:text="${'Home'}">Home</a>
  120. <h6><span style="color: rgb(255,0,0);">*</span><span> Cannot be edited</span></h6>
  121. </form>
  122. </div>
  123. </body>
  124. </html>