<html xmlns:th="http://www.thymeleaf.org" xmlns:tiles="http://www.thymeleaf.org">
  <head>
    <title tiles:fragment="title">Messages : Create</title>
  </head>
  <body>
    <div tiles: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>