66 lines
1.7 KiB
HTML
66 lines
1.7 KiB
HTML
{{define "users.html"}}
|
|
<!doctype html>
|
|
<html lang="de">
|
|
{{template "partials_head" .}}
|
|
<body>
|
|
{{template "partials_nav" .}}
|
|
<main class="page">
|
|
<h1>Users</h1>
|
|
{{template "partials_flash" .}}
|
|
|
|
{{if or (eq .Role "operator") (eq .Role "admin")}}
|
|
<section class="card">
|
|
<h2>Neuen ntfy User erstellen</h2>
|
|
<form method="post" action="{{abs "/users"}}">
|
|
<input type="hidden" name="csrf" value="{{.CSRF}}">
|
|
<input type="hidden" name="action" value="create">
|
|
<div class="grid">
|
|
<div>
|
|
<label>Username</label>
|
|
<input name="username" required>
|
|
</div>
|
|
<div>
|
|
<label>Passwort</label>
|
|
<input name="password" type="password" required>
|
|
</div>
|
|
<div>
|
|
<label>Rolle</label>
|
|
<select name="role">
|
|
<option value="user">user</option>
|
|
<option value="admin">admin</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label>Tier (optional)</label>
|
|
<input name="tier" placeholder="none/pro/...">
|
|
</div>
|
|
</div>
|
|
<button class="btn" type="submit">Erstellen</button>
|
|
</form>
|
|
</section>
|
|
{{end}}
|
|
|
|
<section class="card">
|
|
<h2>Liste</h2>
|
|
<table class="table">
|
|
<thead><tr><th>User</th><th>Role</th><th>Tier</th><th>Access</th></tr></thead>
|
|
<tbody>
|
|
{{range .Users}}
|
|
<tr>
|
|
<td><a href="{{abs (print "/users/" .Username)}}">{{.Username}}</a></td>
|
|
<td>{{.Role}}</td>
|
|
<td>{{.Tier}}</td>
|
|
<td>
|
|
{{range .Access}}<span class="pill">{{.Perm}} → {{.Topic}}</span> {{end}}
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
</main>
|
|
{{template "partials_footer" .}}
|
|
</body>
|
|
</html>
|
|
{{end}}
|