lazyflat/web/templates/_settings_users.html
EiSiMo 2609d3504a guard double-apply, hide error msg, wohnungen polish, bitwarden block
- /actions/apply now no-ops (returns fresh partial) when a running
  application exists for this user+flat, or when a previous one succeeded.
  The list button was already visually disabled; this closes the direct-POST
  and double-click loopholes
- Drop the one-line error message under flat entries in the list
  (bewerbung_detail still shows the full message + the forensic ZIP report)
- Strip "min morgens" commute chip from the list; alert._flat_payload sends
  an empty connectivity dict so Maps.calculate_score is no longer called on
  every flat. Maps.calculate_score + Flat.connectivity stay in the codebase
  for easy re-enable (one-line swap in _flat_payload)
- List entry shows "vor 23 min" instead of "entdeckt vor 23 min"
- Bitwarden: rename profile email/immomio fields to opaque names
  (contact_addr, immomio_login, immomio_secret) + add data-bwignore across
  every settings form / input. Server-side update_profile maps the new
  field names back to the existing DB columns

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:20:31 +02:00

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-bwignore 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 data-bwignore>
</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>