web admin mode

This commit is contained in:
2026-08-05 16:44:10 +02:00
parent c2d5ae45a2
commit 9458a88122
5 changed files with 234 additions and 7 deletions
+177
View File
@@ -0,0 +1,177 @@
<!-- Copyright (c) 2026 Stefan Koelle (https://stefankoelle.de) -->
<!-- Licensed under the MIT License. See LICENSE file in project root for details. -->
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<title>Admin Kontakte</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: #f5f5f5;
color: #333;
line-height: 1.6;
overflow-y: scroll;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 2rem 1rem;
}
h1 {
font-size: 1.5rem;
margin-bottom: 0.5rem;
color: #222;
}
.back-link {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: #0066cc;
text-decoration: none;
font-size: 0.875rem;
margin-bottom: 1.5rem;
}
.back-link:hover {
text-decoration: underline;
}
.card {
background: #fff;
border-radius: 8px;
padding: 1.25rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
margin-bottom: 1.5rem;
}
.card-title {
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #888;
margin-bottom: 1rem;
}
.toggle-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem;
background: #f8f9fa;
border-radius: 6px;
}
.toggle-label {
font-size: 0.875rem;
color: #333;
}
.toggle-sub {
font-size: 0.75rem;
color: #888;
margin-top: 0.25rem;
}
.toggle-switch {
position: relative;
width: 48px;
height: 26px;
flex-shrink: 0;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
inset: 0;
background: #ccc;
border-radius: 26px;
transition: background 0.2s;
}
.toggle-slider::before {
content: "";
position: absolute;
height: 20px;
width: 20px;
left: 3px;
bottom: 3px;
background: #fff;
border-radius: 50%;
transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
background: #0066cc;
}
.toggle-switch input:checked + .toggle-slider::before {
transform: translateX(22px);
}
.status {
margin-top: 1rem;
padding: 0.75rem;
border-radius: 6px;
font-size: 0.875rem;
}
.status-on {
background: #d4edda;
color: #155724;
}
.status-off {
background: #f8f9fa;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1><a href="/" style="text-decoration:none;color:inherit;display:inline-flex;align-items:center;gap:0.4rem"><img src="/static/favicon.svg" alt="" style="height:1.5em;width:1.5em;vertical-align:middle">Kontakte</a></h1>
<a href="/" class="back-link">← Zurück zur Übersicht</a>
<div class="card">
<div class="card-title">Admin-Einstellungen</div>
<form method="post" action="/admin/toggle">
<div class="toggle-row">
<div>
<div class="toggle-label">Alle Accounts anzeigen</div>
<div class="toggle-sub">Kontakte aller Benutzer einsehen</div>
</div>
<label class="toggle-switch">
<input type="checkbox" name="show_all" onchange="this.form.submit()" {% if show_all %}checked{% endif %}>
<span class="toggle-slider"></span>
</label>
</div>
</form>
<div class="status {% if show_all %}status-on{% else %}status-off{% endif %}">
{% if show_all %}
Aktiv: Du siehst alle Kontakte aller Accounts.
{% else %}
Inaktiv: Du siehst nur deine eigenen Kontakte.
{% endif %}
</div>
</div>
</div>
</body>
</html>