───────┬──────────────────────────────────────────────────────────────────────── │ File: src/main/resources/templates/list.html ───────┼──────────────────────────────────────────────────────────────────────── 1 │ <!DOCTYPE html> 2 │ <html lang="ja" xmlns:th="http://www.thymeleaf.org"> 3 │ 4 │ <head> 5 │ <meta charset="UTF-8"> 6 │ <title>ToDoList</title> 7 │ </head> 8 │ 9 │ <body> 10 │ <h1> ようこそ [[${member.name}]] さん!</h1> 11 │ <p> 12 │ <a th:href="@{/{mid}/todos/all(mid=${member.mid})}">みんなのToDo</a> 13 │ <a th:href="@{/}">ログアウト</a> 14 │ </p> 15 │ <h2>ToDo</h2> 16 │ <table border="1"> 17 │ <tr> 18 │ <th> 19 │ # 20 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'seq'}, order=${'asc'})}">↓</a> 21 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'seq'}, order=${'desc'})}">↑</a> 22 │ </th> 23 │ <th> 24 │ タイトル 25 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'title'}, order=${'asc'})}">↓</a> 26 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'title'}, order=${'desc'})}">↑</a> 27 │ </th> 28 │ <th> 29 │ 作成日時 30 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'created_at'}, order=${'asc'})}">↓</a> 31 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'created_at'}, order=${'desc'})}">↑</a> 32 │ </th> 33 │ <th>コマンド</th> 34 │ </tr> 35 │ <tr th:each="todo: ${todos}"> 36 │ <td>[[${todo.seq}]]</td> 37 │ <td>[[${todo.title}]]</td> 38 │ <td>[[${todo.createdAt}]]</td> 39 │ <td> 40 │ <a th:href="@{/{mid}/todos/{seq}/done(mid=${member.mid},seq=${todo.seq})}">完了</a> 41 │ </td> 42 │ </tr> 43 │ <tr> 44 │ <td> 45 │ * 46 │ </td> 47 │ <td colspan="3"> 48 │ <form role="form" th:action="@{/{mid}/todos(mid=${member.mid})}" th:object="${ToDoForm}" method="post"> 49 │ <input type="text" required th:field="*{title}" /> 50 │ <input type="submit" value="新規作成" /> 51 │ <div th:if="${#fields.hasErrors('title')}" th:errors="*{title}" style="color: red"></div> 52 │ </form> 53 │ </td> 54 │ </tr> 55 │ </table> 56 │ 57 │ <h2>Done</h2> 58 │ <table border="1"> 59 │ <tr> 60 │ <th> 61 │ # 62 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'seq'}, order=${'asc'})}">↓</a> 63 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'seq'}, order=${'desc'})}">↑</a> 64 │ </th> 65 │ <th> 66 │ タイトル 67 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'title'}, order=${'asc'})}">↓</a> 68 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'title'}, order=${'desc'})}">↑</a> 69 │ </th> 70 │ <th> 71 │ 作成日時 72 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'created_at'}, order=${'asc'})}">↓</a> 73 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'created_at'}, order=${'desc'})}">↑</a> 74 │ </th> 75 │ <th> 76 │ 完了日時 77 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'done_at'}, order=${'asc'})}">↓</a> 78 │ <a th:href="@{/{mid}/todos(mid=${member.mid}, sort_by=${'done_at'}, order=${'desc'})}">↑</a> 79 │ </th> 80 │ </tr> 81 │ <tr th:each="done: ${dones}"> 82 │ <td>[[${done.seq}]]</td> 83 │ <td>[[${done.title}]]</td> 84 │ <td>[[${done.createdAt}]]</td> 85 │ <td>[[${done.doneAt}]]</td> 86 │ </tr> 87 │ </table> 88 │ 89 │ </body> 90 │ 91 │ </html> ───────┴────────────────────────────────────────────────────────────────────────