<html xmlns:th="http://www.thymeleaf.org">
  <head th:include="layout :: head(title=~{::title},links=~{})">
      <title>Create</title>
  </head>
  <body th:include="layout :: body" th:with="content=~{::content}">
    <div th:fragment="content">
      <div class="container">
            <h1>Messages : Create</h1>
            <form id="messageForm"
                  th:action="@{/}"
                  th:object="${message}"
                  action="view.html"
                  method="post">
                <div th:if="${#fields.hasErrors('*')}"
                    class="alert alert-error">
                  <p th:each="error : ${#fields.errors('*')}"
                      th:text="${error}">
                    Validation error
                  </p>
                </div>
                <label for="summary">
                  Summary
                 </label>
                <input type="text"
                    th:field="*{summary}"
                    th:class="${#fields.hasErrors('summary')} ? 'field-error'"/>
                <label for="text">
                  Message
                </label>
                <textarea th:field="*{text}"
                    th:class="${#fields.hasErrors('text')} ? 'field-error'">
                </textarea>
                <div class="form-actions">
                  <input type="submit" value="Create"/>
                </div>
            </form>
        </div>
    </div>
  </body>
</html>