- Bewerbungen chip "Trockenmodus" → "nicht abgeschickt" (list + detail view) - Profile form: add an off-screen honeypot (username + password) so Chrome's autofill burns its fill on those instead of the real E-Mail field; switch the visible E-Mail and Immomio-Email to type=text + inputmode=email so the browser heuristic no longer tags them as login emails - Users page: create-form sits on top in its own card (3-column grid with Administrator checkbox inline); full-width list below with Administrator chip, aktiv/deaktiviert chip, "du" marker for the current user, plus disable/activate and a new red "löschen" button (confirm prompt) wired to new POST /actions/users/delete which cascades through the user's data Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
70 lines
3.8 KiB
HTML
70 lines
3.8 KiB
HTML
<h2 class="font-semibold mb-4">Benutzer verwalten</h2>
|
|
|
|
{% if request.query_params.get('ok') %}<div class="chip chip-ok mb-4">Benutzer angelegt.</div>{% endif %}
|
|
{% if request.query_params.get('deleted') %}<div class="chip chip-ok mb-4">Benutzer gelöscht.</div>{% endif %}
|
|
{% if request.query_params.get('err') == 'exists' %}<div class="chip chip-bad mb-4">Benutzername existiert bereits.</div>{% endif %}
|
|
|
|
<section class="card p-5 mb-6">
|
|
<h3 class="font-semibold mb-3">Neuen Benutzer anlegen</h3>
|
|
<form method="post" action="/actions/users/create"
|
|
class="grid grid-cols-1 md:grid-cols-3 gap-3 items-end"
|
|
autocomplete="off" data-lpignore="true" data-1p-ignore data-form-type="other">
|
|
<input type="hidden" name="csrf" value="{{ csrf }}">
|
|
<div>
|
|
<label class="block text-xs uppercase text-slate-500 mb-1">Benutzername</label>
|
|
<input class="input" name="username" required autocomplete="off" data-lpignore="true" data-1p-ignore>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs uppercase text-slate-500 mb-1">Passwort (≥ 10 Zeichen)</label>
|
|
<input class="input" type="password" name="password" required
|
|
autocomplete="new-password" data-lpignore="true" data-1p-ignore>
|
|
</div>
|
|
<div class="flex items-center gap-4">
|
|
<label class="inline-flex items-center gap-2">
|
|
<input type="checkbox" name="is_admin">
|
|
<span>Administrator</span>
|
|
</label>
|
|
<button class="btn btn-primary ml-auto" type="submit">Anlegen</button>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<div class="flex items-center justify-between px-4 py-3 border-b border-soft">
|
|
<h3 class="font-semibold">Alle Benutzer</h3>
|
|
<span class="text-xs text-slate-500">{{ users|length }}</span>
|
|
</div>
|
|
<div class="divide-y divide-soft">
|
|
{% for u in users %}
|
|
<div class="px-4 py-3 flex items-center gap-3 flex-wrap">
|
|
<div class="flex items-center gap-2 flex-1 min-w-0">
|
|
<span class="font-medium truncate">{{ u.username }}</span>
|
|
{% if u.id == user.id %}<span class="chip chip-info">du</span>{% endif %}
|
|
</div>
|
|
<div class="flex items-center gap-1.5">
|
|
{% if u.is_admin %}<span class="chip chip-info">Administrator</span>{% endif %}
|
|
{% if u.disabled %}<span class="chip chip-bad">deaktiviert</span>
|
|
{% else %}<span class="chip chip-ok">aktiv</span>{% endif %}
|
|
</div>
|
|
{% if u.id != user.id %}
|
|
<div class="flex items-center gap-2 ml-auto">
|
|
<form method="post" action="/actions/users/disable">
|
|
<input type="hidden" name="csrf" value="{{ csrf }}">
|
|
<input type="hidden" name="target_id" value="{{ u.id }}">
|
|
<input type="hidden" name="value" value="{% if u.disabled %}off{% else %}on{% endif %}">
|
|
<button class="btn btn-ghost text-xs" type="submit">
|
|
{% if u.disabled %}aktivieren{% else %}deaktivieren{% endif %}
|
|
</button>
|
|
</form>
|
|
<form method="post" action="/actions/users/delete"
|
|
onsubmit="return confirm('Benutzer „{{ u.username }}“ dauerhaft löschen? Alle Profildaten, Filter, Bewerbungen und Einstellungen gehen verloren.');">
|
|
<input type="hidden" name="csrf" value="{{ csrf }}">
|
|
<input type="hidden" name="target_id" value="{{ u.id }}">
|
|
<button class="btn btn-danger text-xs" type="submit">löschen</button>
|
|
</form>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|