admin: bruger- og gruppe-administration (opret bruger m. gruppe-adgang, medlemsstyring)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
agw
2026-06-11 21:20:00 +02:00
co-authored by Claude Opus 4.8
parent dfe500c178
commit 7cf79fa901
7 changed files with 286 additions and 13 deletions
+19
View File
@@ -0,0 +1,19 @@
{% extends "base.html" %}
{% block title %}Admin — {{ u.username }}{% endblock %}
{% block body %}
<p><a href="/admin/users" class="muted">← Brugere</a></p>
<h1>{{ u.username }}</h1>
<p class="lead">{{ u.name }}{% if u.email %} · {{ u.email }}{% endif %}</p>
<form method="post" action="/admin/users/{{ u.pk }}">
<label style="display:flex;gap:.5rem;align-items:center;margin:1rem 0"><input type="checkbox" name="is_active" {% if u.active %}checked{% endif %} style="width:auto"> Aktiv konto</label>
<h2>Nulstil adgangskode</h2>
<input name="password" type="text" autocomplete="new-password" placeholder="(tom = uændret)" style="max-width:22rem">
<h2>Grupper (adgang til services)</h2>
<div style="display:grid;gap:.3rem .9rem;grid-template-columns:repeat(auto-fill,minmax(11rem,1fr))">
{% for g in groups %}
<label style="display:flex;gap:.4rem;align-items:center;font-size:.9rem"><input type="checkbox" name="groups" value="{{ g.pk }}" {% if g.pk in u.groups %}checked{% endif %} style="width:auto"> {{ g.name }}</label>
{% endfor %}
</div>
<p style="margin-top:1.2rem"><button class="btn" type="submit">Gem</button></p>
</form>
{% endblock %}