form.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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="regionCommand" type="scot.carricksoftware.grants.commands.places.regions.RegionCommand"*/-->
  19. <!--/*@thymesVar id="country" type="scot.carricksoftware.grants.domains.places.Country"*/-->
  20. <div th:insert="~{fragments/layout::banner}"></div>
  21. <div class="container border border-info
  22. rounded-3 text-center p-4">
  23. <form th:object="${regionCommand}" th:action="@{/region}" method="post">
  24. <div th:if="${#fields.hasErrors('*')}" class="alert alert-danger">
  25. <p>Please Correct The Errors Below</p>
  26. </div>
  27. <div class="form-group row justify-content-center">
  28. <div class="col-xs-4">
  29. <label for="id">Database Id<span style="color: rgb(255,0,0);">*</span></label>
  30. <input class="form-control" id="id"
  31. th:field="*{id}" type="text" style="margin-right:50px;" readonly>
  32. </div>
  33. <div class="col-xs-4" style="margin-right:20px;">
  34. <label for="name">Name</label>
  35. <input class="form-control" id="name"
  36. th:field="*{name}" type="text">
  37. <div th:if="${#fields.hasErrors('name')}">
  38. <ul class="text-danger">
  39. <li th:each="err : ${#fields.errors('name')}" th:text="${err}"/>
  40. </ul>
  41. </div>
  42. </div>
  43. <div class="col-xs-4" style="margin-right:20px;">
  44. <label for="country">Country</label>
  45. <div>
  46. <select id="country" style="width: 300px;" name="country" th:field="*{country}">
  47. <option th:value="${''}" th:text="${''}"></option>
  48. <option th:each="country : ${countries}"
  49. th:value="${country.id}" th:text="${country.name}"></option>
  50. </select>
  51. </div>
  52. </div>
  53. </div>
  54. <button type="submit" class="btn btn-primary">Commit</button>
  55. <a class="btn btn-secondary" th:href="@{/regions}" th:text="${'List all'}">List all</a>
  56. <a class="btn btn-success" th:href="@{/}" th:text="${'Home'}">Home</a>
  57. <h6><span style="color: rgb(255,0,0);">*</span><span> Cannot be edited</span></h6>
  58. </form>
  59. </div>
  60. </body>
  61. </html>