summaryrefslogtreecommitdiff
path: root/src/main/resources/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/templates')
-rw-r--r--src/main/resources/templates/configs/userroles.html7
-rw-r--r--src/main/resources/templates/fragments.html24
2 files changed, 19 insertions, 12 deletions
diff --git a/src/main/resources/templates/configs/userroles.html b/src/main/resources/templates/configs/userroles.html
index 23cc5f2..f5e4586 100644
--- a/src/main/resources/templates/configs/userroles.html
+++ b/src/main/resources/templates/configs/userroles.html
@@ -21,16 +21,17 @@
<td>
<div class="userrole-form">
<form th:hx-put="@{/configs/userroles/{id}(id=${userRole.id})}" hx-target="#userroles">
- <select name="role">
+ <select name="role" th:disabled="${#authorization.authentication.getName() == userRole.username}">
<option th:selected="${userRole.role.value == 'guest'}" value="GUEST">Gast</option>
<option th:selected="${userRole.role.value == 'user'}" value="USER">Benutzer</option>
+ <option th:selected="${userRole.role.value == 'admin'}" value="ADMIN">Administrator</option>
</select>
- <button class="btn btn-blue">Übernehmen</button>
+ <button class="btn btn-blue" th:disabled="${#authorization.authentication.getName() == userRole.username}">Übernehmen</button>
</form>
</div>
</td>
<td>
- <button class="btn btn-red" th:hx-delete="@{/configs/userroles/{id}(id=${userRole.id})}" hx-target="#userroles">Löschen</button>
+ <button class="btn btn-red" th:hx-delete="@{/configs/userroles/{id}(id=${userRole.id})}" hx-target="#userroles" th:disabled="${#authorization.authentication.getName() == userRole.username}">Löschen</button>
</td>
</tr>
</tbody>
diff --git a/src/main/resources/templates/fragments.html b/src/main/resources/templates/fragments.html
index bfa36a2..467a483 100644
--- a/src/main/resources/templates/fragments.html
+++ b/src/main/resources/templates/fragments.html
@@ -7,10 +7,12 @@
<body>
<div th:fragment="nav">
<nav>
- <a class="nav-home" th:href="@{/}">
- <img th:src="@{/icon.svg}" alt="Icon" />
- <span>ETL-Processor</span>
- </a>
+ <span>
+ <a class="nav-home" th:href="@{/}">
+ <img th:src="@{/icon.svg}" alt="Icon" />
+ <span>ETL-Processor</span>
+ </a>
+ </span>
<ul>
<li><a th:href="@{/}">Übersicht</a></li>
<li><a th:href="@{/statistics}">Statistiken</a></li>
@@ -18,15 +20,19 @@
<a th:href="@{/configs}">Konfiguration</a>
</li>
<li class="login" sec:authorize="not isAuthenticated()">
- <a th:href="@{/login}">Login</a>
+ <a class="btn btn-blue" th:href="@{/login}">Login</a>
</li>
<li class="login" sec:authorize="isAuthenticated()">
<span>
- <span>👤</span>
- <span sec:authentication="name">?</span>
+ <div class="user-icon">
+ <img th:src="@{user.svg}" alt="User-Image">
+ <span sec:authorize="hasRole('ADMIN')" class="user-role admin">Admin</span>
+ <span sec:authorize="hasRole('USER')" class="user-role user">User</span>
+ <span sec:authorize="hasRole('GUEST')" class="user-role guest">Guest</span>
+ </div>
+ <span class="user-name" sec:authentication="name">?</span>
</span>
- &nbsp;
- <a th:href="@{/logout}">Abmelden</a>
+ <a class="btn btn-red" th:href="@{/logout}">Abmelden</a>
</li>
</ul>
</nav>