settings: relabel dry-run, harder PM block, rework users page
- 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>
This commit is contained in:
parent
931e0bb8b7
commit
de3ce19393
6 changed files with 89 additions and 31 deletions
|
|
@ -1,39 +1,53 @@
|
|||
<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 %}
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h3 class="font-semibold mb-2">Neuen Benutzer anlegen</h3>
|
||||
<form method="post" action="/actions/users/create" class="space-y-3 max-w-md">
|
||||
<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>
|
||||
</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>
|
||||
</div>
|
||||
<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-Rechte</span>
|
||||
<span>Administrator</span>
|
||||
</label>
|
||||
<button class="btn btn-primary" type="submit">Anlegen</button>
|
||||
</form>
|
||||
</div>
|
||||
<button class="btn btn-primary ml-auto" type="submit">Anlegen</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<div>
|
||||
<h3 class="font-semibold mb-2">Alle Benutzer</h3>
|
||||
<div class="card divide-y divide-soft">
|
||||
{% for u in users %}
|
||||
<div class="px-3 py-2 flex items-center gap-2 text-sm">
|
||||
<span class="flex-1">{{ u.username }}</span>
|
||||
<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 %}
|
||||
{% if u.id != user.id %}
|
||||
</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 }}">
|
||||
|
|
@ -42,9 +56,15 @@
|
|||
{% if u.disabled %}aktivieren{% else %}deaktivieren{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<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>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue