compose.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <html xmlns:th="https://www.thymeleaf.org">
  2. <head th:include="layout :: head(title=~{::title},links=~{})">
  3. <title>Create</title>
  4. </head>
  5. <body th:include="layout :: body" th:with="content=~{::content}">
  6. <div th:fragment="content">
  7. <div class="container">
  8. <h1>Messages : Create</h1>
  9. <form id="messageForm"
  10. th:action="@{/}"
  11. th:object="${message}"
  12. action="view.html"
  13. method="post">
  14. <div th:if="${#fields.hasErrors('*')}"
  15. class="alert alert-error">
  16. <p th:each="error : ${#fields.errors('*')}"
  17. th:text="${error}">
  18. Validation error
  19. </p>
  20. </div>
  21. <label for="summary">
  22. Summary
  23. </label>
  24. <input type="text"
  25. th:field="*{summary}"
  26. th:class="${#fields.hasErrors('summary')} ? 'field-error'"/>
  27. <label for="text">
  28. Message
  29. </label>
  30. <textarea th:field="*{text}"
  31. th:class="${#fields.hasErrors('text')} ? 'field-error'">
  32. </textarea>
  33. <div class="form-actions">
  34. <input type="submit" value="Create"/>
  35. </div>
  36. </form>
  37. </div>
  38. </div>
  39. </body>
  40. </html>