form.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 - images</title>
  16. </head>
  17. <body>
  18. <!--/*@thymesVar id="personImageCommand" type="scot.carricksoftware.grants.commands.images.PersonImageCommand"*/-->
  19. <div th:insert="~{fragments/layout::banner}"></div>
  20. <div class="container border border-info rounded-3 text-center p-4">
  21. <h3>Personal Image Details</h3>
  22. <form th:object="${personImageCommand}" th:action="@{/personImage}" 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="person">Person :&nbsp;</label>
  39. </td>
  40. <td style="text-align: left;">
  41. <select id="person" style="width: 300px;" name="person" th:field="*{person}">
  42. <option th:value="${''}" th:text="${''}"></option>
  43. <option th:each="person : ${people}"
  44. th:value="${person.id}" th:text="${person.toString()}"></option>
  45. </select>
  46. <div th:if="${#fields.hasErrors('person')}">
  47. <ul class="text-danger">
  48. <li th:each="err : ${#fields.errors('person')}" th:text="${err}"/>
  49. </ul>
  50. </div>
  51. </td>
  52. </tr>
  53. <tr>
  54. <td style="text-align: right;">
  55. <label for="image">Image : &nbsp;</label>
  56. </td>
  57. <td style="text-align: left;">
  58. <select id="image" name="image" th:field="*{image}">
  59. <option th:value="${''}" th:text="${''}"></option>
  60. <option th:each="image : ${images}"
  61. th:value="${image.id}" th:text="${image.name}"></option>
  62. </select>
  63. <div th:if="${#fields.hasErrors('image')}">
  64. <ul class="text-danger">
  65. <li th:each="err : ${#fields.errors('image')}" th:text="${err}"/>
  66. </ul>
  67. </div>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td style="text-align: right;">
  72. <label for="order">Order :&nbsp;</label>
  73. </td>
  74. <td style="text-align: left;">
  75. <input class="form-control" id="order"
  76. th:field="*{order}" type="text">
  77. <div th:if="${#fields.hasErrors('order')}">
  78. <ul class="text-danger">
  79. <li th:each="err : ${#fields.errors('order')}" th:text="${err}"/>
  80. </ul>
  81. </div>
  82. </td>
  83. </tr><tr>
  84. <td style="text-align: right;">
  85. <label for="level">Level :&nbsp;</label>
  86. </td>
  87. <td style="text-align: left;">
  88. <input class="form-control" id="level"
  89. th:field="*{level}" type="text">
  90. <div th:if="${#fields.hasErrors('level')}">
  91. <ul class="text-danger">
  92. <li th:each="err : ${#fields.errors('level')}" th:text="${err}"/>
  93. </ul>
  94. </div>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td style="text-align: right;">
  99. <label for="caption">Caption :&nbsp;</label>
  100. </td>
  101. <td style="text-align: left;">
  102. <input class="form-control" id="caption"
  103. th:field="*{caption}" type="text">
  104. <div th:if="${#fields.hasErrors('caption')}">
  105. <ul class="text-danger">
  106. <li th:each="err : ${#fields.errors('caption')}" th:text="${err}"/>
  107. </ul>
  108. </div>
  109. </td>
  110. </tr>
  111. <tr><td>&nbsp;</td></tr>
  112. </table>
  113. <button type="submit" class="btn btn-primary">Commit</button>
  114. <a class="btn btn-secondary" th:href="@{/personImages}" th:text="${'List all'}">List all</a>
  115. <a class="btn btn-success" th:href="@{/}" th:text="${'Home'}">Home</a>
  116. <h6><span style="color: rgb(255,0,0);">*</span><span> Cannot be edited</span></h6>
  117. </form>
  118. </div>
  119. </body>
  120. </html>