From 58110199087641510effbb1e7d1991af35185e09 Mon Sep 17 00:00:00 2001 From: Maaxxs <61059039+MaaxxsDev@users.noreply.github.com> Date: Fri, 18 Sep 2026 06:52:19 +0200 Subject: [PATCH] Redesign the logged-in area with a left icon sidebar layout Replaces the top navbar with a fixed vertical sidebar (brand, nav links with inline SVG icons, active-link highlighting, user info and logout pinned to the bottom) for a more modern dashboard feel. Public pages (login, install, logged-out landing) keep the simple top bar. Collapses to an icon-only horizontal bar under 860px since there's no JS toggle. Dashboard quick-links get matching icon badges. Co-Authored-By: Claude Sonnet 5 --- assets/css/style.css | 185 ++++++++++++++++++++++++++++++++++++----- dashboard.php | 20 +++-- includes/footer.php | 6 ++ includes/functions.php | 18 ++++ includes/header.php | 58 +++++++++---- 5 files changed, 243 insertions(+), 44 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 87c78cf..4321d12 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -9,6 +9,7 @@ --gold-hover: #e0b930; --danger: #d9534f; --success: #4caf50; + --sidebar-width: 260px; } * { box-sizing: border-box; } @@ -24,6 +25,9 @@ body { a { color: var(--gold); text-decoration: none; } a:hover { color: var(--gold-hover); text-decoration: underline; } +.icon { flex-shrink: 0; } + +/* Oeffentliche/nicht eingeloggte Seiten: schlichte Kopfzeile */ .navbar { display: flex; align-items: center; @@ -32,7 +36,6 @@ a:hover { color: var(--gold-hover); text-decoration: underline; } padding: 0.75rem 1.5rem; background: var(--bg-panel); border-bottom: 1px solid var(--border); - flex-wrap: wrap; } .navbar-brand a { @@ -41,19 +44,6 @@ a:hover { color: var(--gold-hover); text-decoration: underline; } color: var(--gold); } -.navbar-links { - display: flex; - align-items: center; - gap: 1rem; - flex-wrap: wrap; -} - -.navbar-group { - color: var(--text-muted); - font-size: 0.85rem; - margin-left: 0.5rem; -} - .navbar-user { display: flex; align-items: center; @@ -61,8 +51,98 @@ a:hover { color: var(--gold-hover); text-decoration: underline; } font-size: 0.9rem; } +/* Eingeloggter Bereich: Sidebar-Layout */ +.app-shell { + display: flex; + align-items: stretch; + min-height: 100vh; +} + +.sidebar { + width: var(--sidebar-width); + flex-shrink: 0; + display: flex; + flex-direction: column; + background: var(--bg-panel); + border-right: 1px solid var(--border); + padding: 1.5rem 1rem; + position: sticky; + top: 0; + height: 100vh; + overflow-y: auto; +} + +.sidebar-brand { + padding: 0 0.65rem 1.5rem; + font-size: 1.15rem; + font-weight: bold; +} + +.sidebar-brand a { color: var(--gold); } + +.sidebar-nav { + display: flex; + flex-direction: column; + gap: 0.2rem; + flex: 1; +} + +.sidebar-section-label { + margin-top: 1rem; + padding: 0.5rem 0.65rem 0.25rem; + font-size: 0.7rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.06em; + color: var(--text-muted); +} + +.sidebar-link { + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.65rem 0.75rem; + border-radius: 6px; + color: var(--text); + font-weight: 500; + font-size: 0.95rem; +} + +.sidebar-link:hover { + background: var(--bg-panel-alt); + color: var(--text); + text-decoration: none; +} + +.sidebar-link.active { + background: rgba(201, 162, 39, 0.15); + color: var(--gold); +} + +.sidebar-footer { + border-top: 1px solid var(--border); + margin-top: 1rem; + padding-top: 1rem; + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.sidebar-user { + padding: 0 0.65rem; + font-size: 0.82rem; + color: var(--text-muted); +} + +.sidebar-user strong { color: var(--text); } + +.app-content { + flex: 1; + min-width: 0; +} + .container { - max-width: 1000px; + max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; } @@ -70,9 +150,10 @@ a:hover { color: var(--gold-hover); text-decoration: underline; } .panel { background: var(--bg-panel); border: 1px solid var(--border); - border-radius: 8px; + border-radius: 10px; padding: 1.5rem 2rem; margin-bottom: 1.5rem; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); } .panel-narrow { @@ -115,7 +196,7 @@ textarea, select { background: var(--bg-panel-alt); border: 1px solid var(--border); - border-radius: 4px; + border-radius: 6px; padding: 0.6rem 0.75rem; color: var(--text); font-size: 1rem; @@ -138,7 +219,7 @@ input:focus, select:focus, textarea:focus { gap: 0.5rem; background: var(--bg-panel-alt); border: 1px solid var(--border); - border-radius: 4px; + border-radius: 6px; padding: 1rem; } @@ -156,13 +237,14 @@ input:focus, select:focus, textarea:focus { background: var(--gold); color: #1a1a1a; border: none; - border-radius: 4px; + border-radius: 6px; padding: 0.6rem 1.25rem; font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center; width: fit-content; + transition: background 0.15s ease; } .button:hover, button:hover { background: var(--gold-hover); text-decoration: none; } @@ -190,7 +272,7 @@ input:focus, select:focus, textarea:focus { .flash { padding: 0.75rem 1rem; - border-radius: 4px; + border-radius: 6px; margin-bottom: 1rem; font-size: 0.95rem; } @@ -212,3 +294,66 @@ input:focus, select:focus, textarea:focus { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; } + +.stat-card { + display: flex; + align-items: center; + gap: 1rem; +} + +.stat-card .icon-badge { + display: flex; + align-items: center; + justify-content: center; + width: 44px; + height: 44px; + border-radius: 8px; + background: rgba(201, 162, 39, 0.15); + color: var(--gold); + flex-shrink: 0; +} + +.stat-card h3 { margin: 0 0 0.15rem; color: var(--text); font-size: 1rem; } +.stat-card p { margin: 0; } + +@media (max-width: 860px) { + .app-shell { + flex-direction: column; + min-height: 0; + } + + .sidebar { + position: static; + width: 100%; + height: auto; + flex-direction: row; + align-items: center; + gap: 0.5rem; + padding: 0.6rem 0.75rem; + overflow-x: auto; + } + + .sidebar-brand { padding: 0 0.75rem 0 0; } + + .sidebar-nav { + flex-direction: row; + flex: none; + } + + .sidebar-section-label { display: none; } + + .sidebar-link .label { display: none; } + + .sidebar-footer { + flex-direction: row; + align-items: center; + margin-top: 0; + margin-left: auto; + padding-top: 0; + padding-left: 0.75rem; + border-top: none; + border-left: 1px solid var(--border); + } + + .sidebar-user { display: none; } +} diff --git a/dashboard.php b/dashboard.php index 169fd76..925f076 100644 --- a/dashboard.php +++ b/dashboard.php @@ -19,17 +19,21 @@ include __DIR__ . '/includes/header.php';

Administration

-
-

Benutzerverwaltung

-

Mitglieder anlegen, bearbeiten, deaktivieren.

- Oeffnen +
+
+
+

Benutzerverwaltung

+

Mitglieder anlegen, bearbeiten, deaktivieren

+
-
-

Berechtigungsgruppen

-

Rollen und deren Berechtigungen verwalten.

- Oeffnen +
+
+
+

Berechtigungsgruppen

+

Rollen und Berechtigungen verwalten

+
diff --git a/includes/footer.php b/includes/footer.php index 9865361..769b023 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -1,3 +1,9 @@ + + +
+
+ + diff --git a/includes/functions.php b/includes/functions.php index b93f70c..df8653b 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -58,3 +58,21 @@ function generate_temp_password(int $length = 12): string } return $password; } + +// Kleine, abhaengigkeitsfreie Icon-Sammlung (Strichgrafiken, angelehnt an +// Feather Icons) fuer die Sidebar-Navigation. +function icon(string $name): string +{ + $paths = [ + 'home' => '', + 'users' => '', + 'shield' => '', + 'log-out' => '', + 'lock' => '', + ]; + + $path = $paths[$name] ?? ''; + + return ''; +} diff --git a/includes/header.php b/includes/header.php index 59562e5..fc72513 100644 --- a/includes/header.php +++ b/includes/header.php @@ -4,6 +4,11 @@ $currentUser = current_user(); $canViewUsers = $currentUser && user_has_permission('users.view'); $canManageRoles = $currentUser && user_has_permission('roles.manage'); $showAdminMenu = $canViewUsers || $canManageRoles; + +$currentScript = basename((string) ($_SERVER['SCRIPT_NAME'] ?? '')); +$isDashboardActive = $currentScript === 'dashboard.php'; +$isUsersActive = in_array($currentScript, ['users.php', 'user_form.php', 'user_delete.php'], true); +$isRolesActive = in_array($currentScript, ['roles.php', 'role_form.php', 'role_delete.php'], true); ?> @@ -14,28 +19,49 @@ $showAdminMenu = $canViewUsers || $canManageRoles; + +
+ +
+
+ +
+ +
+