113 lines
5.4 KiB
Twig
113 lines
5.4 KiB
Twig
{% extends 'admin/base.html.twig' %}
|
|
|
|
{% block title %}Benutzer bearbeiten{% endblock %}
|
|
|
|
{% block body %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2">
|
|
<div>
|
|
<h1 class="h3 mb-1">
|
|
<i class="bi bi-person-gear"></i> Benutzer bearbeiten
|
|
</h1>
|
|
<div class="small text-muted">
|
|
{{ managed_user.email }}
|
|
</div>
|
|
</div>
|
|
<a href="{{ path('admin_users_index') }}" class="btn btn-sm btn-outline-secondary">
|
|
Zurück zur Liste
|
|
</a>
|
|
</div>
|
|
|
|
{% for message in app.flashes('danger') %}
|
|
<div class="alert alert-danger shadow-sm">{{ message }}</div>
|
|
{% endfor %}
|
|
|
|
<div class="card bg-black border-secondary text-light shadow-sm">
|
|
<div class="card-body">
|
|
<form method="post" action="{{ path('admin_users_edit', {id: managed_user.id}) }}" autocomplete="off">
|
|
<input type="hidden" name="_token" value="{{ csrf_token('admin_user_edit_' ~ managed_user.id) }}">
|
|
|
|
<div class="row g-4">
|
|
<div class="col-lg-6">
|
|
<label class="form-label" for="user-email">E-Mail</label>
|
|
<input id="user-email"
|
|
type="email"
|
|
name="email"
|
|
required
|
|
value="{{ managed_user.email }}"
|
|
class="form-control bg-dark text-light border-secondary"
|
|
autocomplete="off">
|
|
</div>
|
|
|
|
<div class="col-lg-3">
|
|
<label class="form-label" for="user-password">Neues Passwort</label>
|
|
<input id="user-password"
|
|
type="password"
|
|
name="password"
|
|
minlength="8"
|
|
class="form-control bg-dark text-light border-secondary"
|
|
autocomplete="new-password"
|
|
placeholder="leer lassen">
|
|
</div>
|
|
|
|
<div class="col-lg-3">
|
|
<label class="form-label" for="user-password-repeat">Passwort wiederholen</label>
|
|
<input id="user-password-repeat"
|
|
type="password"
|
|
name="password_repeat"
|
|
minlength="8"
|
|
class="form-control bg-dark text-light border-secondary"
|
|
autocomplete="new-password"
|
|
placeholder="leer lassen">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="small text-muted mt-2">
|
|
Das Passwort bleibt unverändert, wenn beide Passwortfelder leer sind.
|
|
</div>
|
|
|
|
<hr class="border-secondary my-4">
|
|
|
|
<div class="row g-4">
|
|
<div class="col-lg-7">
|
|
<h2 class="h5 text-info mb-3">Rollen</h2>
|
|
<div class="row g-2">
|
|
{% for role, label in role_choices %}
|
|
<div class="col-md-6">
|
|
<label class="form-check bg-dark border border-secondary rounded p-3 h-100">
|
|
<input class="form-check-input me-2"
|
|
type="checkbox"
|
|
name="roles[]"
|
|
value="{{ role }}"
|
|
{{ role in managed_user.roles ? 'checked' : '' }}>
|
|
<span class="form-check-label">
|
|
<strong>{{ label }}</strong><br>
|
|
<span class="small text-muted">{{ role }}</span>
|
|
</span>
|
|
</label>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-5">
|
|
<h2 class="h5 text-info mb-3">Status</h2>
|
|
<label class="form-check form-switch bg-dark border border-secondary rounded p-3 ps-5">
|
|
<input class="form-check-input" type="checkbox" name="is_active" value="1" {{ managed_user.active ? 'checked' : '' }}>
|
|
<span class="form-check-label">Benutzer ist aktiv</span>
|
|
</label>
|
|
|
|
<div class="alert alert-warning mt-3 mb-0 small">
|
|
<strong>Self-Protection:</strong> Du kannst dich nicht selbst deaktivieren und dir nicht selbst die Super-Admin-Rolle entziehen. Der letzte aktive Super-Admin bleibt ebenfalls geschützt.
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-end gap-2 mt-4">
|
|
<a href="{{ path('admin_users_index') }}" class="btn btn-outline-secondary">Abbrechen</a>
|
|
<button class="btn btn-outline-info" type="submit">Änderungen speichern</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|