Enhance UI and functionality for admin dashboard and user management

- Update `_base_context` to include `active_nav` for dynamic navigation highlighting.
- Revamp `base.html` to improve header layout and navigation links for better user experience.
- Redesign `dashboard.html` to include statistics for new and edited articles, enhancing visibility of content changes.
- Improve `users.html` layout for user management, adding detailed user roles and status indicators.
- Update CSS styles for a cohesive design across the application, introducing new color variables and layout adjustments.
This commit is contained in:
smueller
2026-07-03 13:44:57 +02:00
parent df4424fdf9
commit 9f42cc77cc
7 changed files with 1168 additions and 323 deletions

View File

@@ -1,43 +1,78 @@
{% extends "base.html" %}
{% block title %}Benutzerverwaltung{% endblock %}
{% block content %}
<section class="card">
<h2>Benutzerverwaltung</h2>
<form method="post" action="/admin/users" class="form-grid">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<label>E-Mail
<input type="email" name="email" required>
</label>
<label>Vollständiger Name
<input type="text" name="full_name" required>
</label>
<label>Passwort
<input type="password" name="password" required minlength="10">
</label>
<label>Rolle
<select name="role">
<option value="reader">Reader</option>
<option value="editor">Editor</option>
<option value="admin">Admin</option>
</select>
</label>
<button type="submit">Benutzer erstellen</button>
</form>
</section>
<section class="card">
<h3>Bestehende Benutzer</h3>
<table>
<thead><tr><th>E-Mail</th><th>Name</th><th>Rolle</th><th>Aktiv</th></tr></thead>
<tbody>
{% for u in users %}
<tr>
<td>{{ u.email }}</td>
<td>{{ u.full_name }}</td>
<td>{{ u.role }}</td>
<td>{{ "Ja" if u.is_active else "Nein" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
<div class="page-header">
<h2>Benutzerverwaltung</h2>
<p class="page-lead"><a href="/dashboard">← Zurück zum Dashboard</a></p>
</div>
<div class="layout-2col">
<div class="main-col">
<section class="card card-accent-orange">
<div class="card-header">
<h3>Neuen Benutzer anlegen</h3>
</div>
<form method="post" action="/admin/users" class="form-grid">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<div class="form-row">
<label>E-Mail
<input type="email" name="email" required placeholder="name@firma.de">
</label>
<label>Vollständiger Name
<input type="text" name="full_name" required>
</label>
</div>
<div class="form-row">
<label>Passwort
<input type="password" name="password" required minlength="10">
</label>
<label>Rolle
<select name="role">
<option value="reader">Leser (nur ansehen)</option>
<option value="editor">Editor (generieren &amp; senden)</option>
<option value="admin">Admin (voller Zugriff)</option>
</select>
</label>
</div>
<button type="submit" class="btn-primary">Benutzer erstellen</button>
</form>
</section>
<section class="card">
<div class="card-header">
<h3>Bestehende Benutzer <span class="count-badge">{{ users|length }}</span></h3>
</div>
<div class="table-wrap">
<table>
<thead>
<tr><th>E-Mail</th><th>Name</th><th>Rolle</th><th>Status</th></tr>
</thead>
<tbody>
{% for u in users %}
<tr>
<td>{{ u.email }}</td>
<td>{{ u.full_name }}</td>
<td><span class="badge badge-{{ u.role }}">{{ u.role }}</span></td>
<td>{{ "Aktiv" if u.is_active else "Inaktiv" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
</div>
<aside class="sidebar-col">
<div class="sidebar-card">
<h4>Rollen</h4>
<ul>
<li><strong>Leser</strong> Newsletter ansehen</li>
<li><strong>Editor</strong> Generieren &amp; senden</li>
<li><strong>Admin</strong> Benutzer &amp; SMTP</li>
</ul>
</div>
</aside>
</div>
{% endblock %}