summaryrefslogtreecommitdiff
path: root/spring-boot/10-role-based-security/src/main/resources/templates/security/users.html
diff options
context:
space:
mode:
Diffstat (limited to 'spring-boot/10-role-based-security/src/main/resources/templates/security/users.html')
-rw-r--r--spring-boot/10-role-based-security/src/main/resources/templates/security/users.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/spring-boot/10-role-based-security/src/main/resources/templates/security/users.html b/spring-boot/10-role-based-security/src/main/resources/templates/security/users.html
new file mode 100644
index 0000000..81752c8
--- /dev/null
+++ b/spring-boot/10-role-based-security/src/main/resources/templates/security/users.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html xmlns:th="http://www.thymeleaf.org"
+ th:replace="~{layout/main :: layout(title='Users', content=~{::main})}">
+
+<body>
+ <main>
+ <table>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>Username</th>
+ <th>Description</th>
+ <th>Edit</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- th:each loops over the "userss" list sent by the controller -->
+ <tr th:each="user : ${users}">
+ <!-- th:text updates the cell contents dynamically -->
+ <td th:text="${user.id}">1</td>
+ <td th:text="${user.username}">Username</td>
+ <td th:text="${user.description}">User description</td>
+ <td><a th:href="@{/security/user/update/{id}(id=${user.id})}">Edit</a></td>
+ </tr>
+ </tbody>
+ </table>
+ </main>
+</body>
+
+</html> \ No newline at end of file