Stirling-PDF/src/main/resources/templates/addUsers.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
3.8 KiB
HTML
Raw Normal View History

2023-08-13 02:12:29 +02:00
<!DOCTYPE html>
<html th:lang="${#locale.toString()}" th:lang-direction="#{language.direction}" xmlns:th="http://www.thymeleaf.org">
2023-08-17 01:10:14 +02:00
<th:block th:insert="~{fragments/common :: head(title=#{adminUserSettings.title})}"></th:block>
2023-08-13 02:12:29 +02:00
<body>
<th:block th:insert="~{fragments/common :: game}"></th:block>
<div id="page-container">
<div id="content-wrap">
<div th:insert="~{fragments/navbar.html :: navbar}"></div>
<br> <br>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
2023-09-04 19:42:22 +02:00
2023-08-13 02:12:29 +02:00
<!-- User Settings Title -->
2023-08-17 01:10:14 +02:00
<h2 class="text-center" th:text="#{adminUserSettings.header}">Admin User Control Settings</h2>
2023-08-15 01:39:13 +02:00
2023-08-13 02:12:29 +02:00
<table class="table">
2023-08-30 23:52:38 +02:00
<thead>
<tr>
<th th:text="#{username}">Username</th>
<th th:text="#{adminUserSettings.roles}">Roles</th>
<th th:text="#{adminUserSettings.actions}">Actions</th>
</tr>
</thead>
<tbody>
<tr th:each="user : ${users}">
<td th:text="${user.username}"></td>
<td th:text="${user.getRolesAsString()}"></td>
<td>
2023-09-12 00:19:50 +02:00
<form th:if="${user.username != currentUsername}" th:action="@{'/api/v1/user/admin/deleteUser/' + ${user.username}}" method="post">
2023-08-30 23:52:38 +02:00
<button type="submit" th:text="#{delete}">Delete</button>
</form>
</td>
</tr>
</tbody>
</table>
2023-08-13 02:12:29 +02:00
2023-08-17 23:03:43 +02:00
<h2 th:text="#{adminUserSettings.addUser}">Add New User</h2>
2023-09-04 19:42:22 +02:00
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'usernameExists'}" class="alert alert-danger">
<span th:text="#{usernameExistsMessage}">Default message if not found</span>
</div>
2023-09-12 00:19:50 +02:00
<form action="/api/v1/user/admin/saveUser" method="post">
2023-08-20 22:57:19 +02:00
<div class="mb-3">
2023-08-17 01:10:14 +02:00
<label for="username" th:text="#{username}">Username</label>
2023-08-13 02:12:29 +02:00
<input type="text" class="form-control" name="username" required>
</div>
2023-08-20 22:57:19 +02:00
<div class="mb-3">
2023-08-17 01:10:14 +02:00
<label for="password" th:text="#{password}">Password</label>
2023-08-13 02:12:29 +02:00
<input type="password" class="form-control" name="password" required>
</div>
2023-08-20 22:57:19 +02:00
<div class="mb-3">
2023-08-17 23:03:43 +02:00
<label for="role" th:text="#{adminUserSettings.role}">Role</label>
2023-08-13 02:12:29 +02:00
<select name="role" class="form-control" required>
2023-08-17 01:10:14 +02:00
<option value="ROLE_ADMIN" th:text="#{adminUserSettings.admin}">Admin</option>
<option value="ROLE_USER" th:text="#{adminUserSettings.user}">User</option>
<option value="ROLE_LIMITED_API_USER" th:text="#{adminUserSettings.apiUser}">Limited API User</option>
<option value="ROLE_WEB_ONLY_USER" th:text="#{adminUserSettings.webOnlyUser}">Web Only User</option>
2023-12-27 23:56:51 +01:00
<option value="ROLE_DEMO_USER" th:text="#{adminUserSettings.demoUser}">Demo User</option>
2023-08-13 02:12:29 +02:00
</select>
</div>
2023-09-04 19:42:22 +02:00
<div class="mb-3">
<input type="checkbox" class="form-check-input" id="forceChange" name="forceChange">
<label class="form-check-label" for="forceChange" th:text="#{adminUserSettings.forceChange}">Force user to change username/password on login</label>
</div>
2023-08-13 02:12:29 +02:00
<!-- Add other fields as required -->
2023-08-17 01:10:14 +02:00
<button type="submit" class="btn btn-primary" th:text="#{adminUserSettings.submit}">Save User</button>
2023-08-13 02:12:29 +02:00
</form>
</div>
</div>
</div>
</div>
<div th:insert="~{fragments/footer.html :: footer}"></div>
</div>
</body>
</html>