form.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 - appendix images</title>
  16. </head>
  17. <body>
  18. <!--/*@thymesVar id="appendixImageCommand" type="scot.carricksoftware.grants.commands.images.AppendixImageCommand"*/-->
  19. <div th:insert="~{fragments/layout::banner}"></div>
  20. <div class="container border border-info rounded-3 text-center p-4">
  21. <h3>Appendix Image Details</h3>
  22. <form th:object="${appendixImageCommand}" th:action="@{/appendixImage}" method="post">
  23. <div th:if="${#fields.hasErrors('*')}" class="alert alert-danger">
  24. <p>Please Correct The Errors Below</p>
  25. </div>
  26. <table style="width:100%;">
  27. <tr>
  28. <td style="text-align: right;">
  29. <label for="id"><span style="color: rgb(255,0,0);">*</span>Database Id :&nbsp;</label>
  30. </td>
  31. <td style="text-align: left;">
  32. <input class="form-control" id="id"
  33. th:field="*{id}" type="text" readonly>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td style="text-align: right;">
  38. <label for="image">Image : &nbsp;</label>
  39. </td>
  40. <td style="text-align: left;">
  41. <select id="image" name="image" th:field="*{image}">
  42. <option th:value="${''}" th:text="${''}"></option>
  43. <option th:each="image : ${images}"
  44. th:value="${image.id}" th:text="${image.name}"></option>
  45. </select>
  46. <div th:if="${#fields.hasErrors('image')}">
  47. <ul class="text-danger">
  48. <li th:each="err : ${#fields.errors('image')}" th:text="${err}"/>
  49. </ul>
  50. </div>
  51. </td>
  52. </tr>
  53. <tr>
  54. <td style="text-align: right;">
  55. <label for="order">Order :&nbsp;</label>
  56. </td>
  57. <td style="text-align: left;">
  58. <input class="form-control" id="order"
  59. th:field="*{order}" type="text">
  60. <div th:if="${#fields.hasErrors('order')}">
  61. <ul class="text-danger">
  62. <li th:each="err : ${#fields.errors('order')}" th:text="${err}"/>
  63. </ul>
  64. </div>
  65. </td>
  66. </tr>
  67. <tr>
  68. <td style="text-align: right;">
  69. <label for="level">Level :&nbsp;</label>
  70. </td>
  71. <td style="text-align: left;">
  72. <input class="form-control" id="level"
  73. th:field="*{level}" type="text">
  74. <div th:if="${#fields.hasErrors('level')}">
  75. <ul class="text-danger">
  76. <li th:each="err : ${#fields.errors('level')}" th:text="${err}"/>
  77. </ul>
  78. </div>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td style="text-align: right;">
  83. <label for="caption">Caption :&nbsp;</label>
  84. </td>
  85. <td style="text-align: left;">
  86. <input class="form-control" id="caption"
  87. th:field="*{caption}" type="text">
  88. <div th:if="${#fields.hasErrors('caption')}">
  89. <ul class="text-danger">
  90. <li th:each="err : ${#fields.errors('caption')}" th:text="${err}"/>
  91. </ul>
  92. </div>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td style="text-align: right;">
  97. <label for="width">Width :&nbsp;</label>
  98. </td>
  99. <td style="text-align: left;">
  100. <input class="form-control" id="width"
  101. th:field="*{width}" type="text">
  102. <div th:if="${#fields.hasErrors('width')}">
  103. <ul class="text-danger">
  104. <li th:each="err : ${#fields.errors('width')}" th:text="${err}"/>
  105. </ul>
  106. </div>
  107. </td>
  108. </tr>
  109. <tr>
  110. <td style="text-align: right;">
  111. <label for="height">Height :&nbsp;</label>
  112. </td>
  113. <td style="text-align: left;">
  114. <input class="form-control" id="height"
  115. th:field="*{height}" type="text">
  116. <div th:if="${#fields.hasErrors('height')}">
  117. <ul class="text-danger">
  118. <li th:each="err : ${#fields.errors('height')}" th:text="${err}"/>
  119. </ul>
  120. </div>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td>&nbsp;</td>
  125. </tr>
  126. </table>
  127. <button type="submit" class="btn btn-primary">Commit</button>
  128. <a class="btn btn-secondary" th:href="@{/appendixImages}" th:text="${'List all'}">List all</a>
  129. <a class="btn btn-success" th:href="@{/}" th:text="${'Home'}">Home</a>
  130. <h6><span style="color: rgb(255,0,0);">*</span><span> Cannot be edited</span></h6>
  131. </form>
  132. </div>
  133. </body>
  134. </html>