admin berreich, user anmeldung
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Verwaltung · Pingu Concerts</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<style>
|
||||
.admin-section { margin: 0 0 28px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
|
||||
.invite-link { display: block; margin-top: 14px; padding: 12px; overflow-wrap: anywhere; background: #0f1420; border: 1px solid var(--border); border-radius: 9px; color: #c4b5fd; }
|
||||
.user-list { display: grid; gap: 12px; }
|
||||
.user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 16px; background: #0f1420; border: 1px solid var(--border); border-radius: 10px; }
|
||||
.user-meta { color: var(--muted); font-size: .9rem; margin-top: 4px; }
|
||||
.role-form, .delete-form { margin: 0; display: flex; align-items: center; gap: 8px; }
|
||||
.role-form select { padding: 9px; background: #0b0f19; color: var(--text); border: 1px solid var(--border); border-radius: 8px; }
|
||||
.delete-button { padding: 9px 12px; color: #fecaca; border: 1px solid #7f1d1d; background: #450a0a; border-radius: 8px; cursor: pointer; }
|
||||
@media (max-width: 700px) { .user-row { grid-template-columns: 1fr; } .role-form, .delete-form { width: 100%; } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="header-inner">
|
||||
<a href="/" class="logo">🎸 Pingu <span>Concerts</span></a>
|
||||
<span>{{ user.display_name }}</span>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="page-title">
|
||||
<h1>⚙️ Verwaltung</h1>
|
||||
<p>Einladungen und Benutzerkonten verwalten.</p>
|
||||
</div>
|
||||
<section class="admin-section">
|
||||
<h2>Einladung erstellen</h2>
|
||||
<p>Der Link kann einmalig verwendet werden, um einen neuen Account anzulegen.</p>
|
||||
<form method="post" action="/admin/invites">
|
||||
<button class="button" type="submit">+ Einladungslink erzeugen</button>
|
||||
</form>
|
||||
{% if invite_url %}
|
||||
<label class="invite-link">{{ invite_url }}</label>
|
||||
{% endif %}
|
||||
</section>
|
||||
<section class="admin-section">
|
||||
<h2>Benutzer</h2>
|
||||
<div class="user-list">
|
||||
{% for managed_user in users %}
|
||||
<div class="user-row">
|
||||
<div>
|
||||
<strong>{{ managed_user.display_name }}</strong>
|
||||
<div class="user-meta">@{{ managed_user.username }} · {{ managed_user.email }} · seit {{ managed_user.created_at }}</div>
|
||||
</div>
|
||||
<form class="role-form" method="post" action="/admin/users/{{ managed_user.id }}">
|
||||
<select name="role" aria-label="Rolle für {{ managed_user.username }}">
|
||||
<option value="user" {% if not managed_user.is_admin %}selected{% endif %}>Benutzer</option>
|
||||
<option value="admin" {% if managed_user.is_admin %}selected{% endif %}>Admin</option>
|
||||
</select>
|
||||
<button class="button" type="submit">Speichern</button>
|
||||
</form>
|
||||
{% if managed_user.id != user.id %}
|
||||
<form class="delete-form" method="post" action="/admin/users/{{ managed_user.id }}/delete" onsubmit="return confirm('Diesen Benutzer wirklich löschen?');">
|
||||
<button class="delete-button" type="submit">Löschen</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user