Let admins edit other user's profiles

This commit is contained in:
2024-04-09 19:06:29 +02:00
parent 783d59805b
commit 4b90ec9652
7 changed files with 319 additions and 15 deletions

View File

@ -0,0 +1,24 @@
{{define "page-content"}}
<h2>Alle Benutzer</h2>
<div class="flex flex-col gap-4">
{{range .}}
<button class="btn" hx-get="/edit-user/{{.ID}}" hx-target="#page-content">
<h1 class="font-bold text-2xl">
{{.UserName}}
({{if eq .Role 0}}
Admin
{{else if eq .Role 1}}
Herausgeber
{{else if eq .Role 2}}
Redakteur
{{else}}
Autor
{{end}})
</h1>
<p>{{.FirstName}} {{.LastName}}</p>
</button>
{{end}}
<button class="action-btn" hx-get="/hub" hx-target="#page-content">Zurück</button>
</div>
{{end}}