This commit is contained in:
2025-12-10 21:01:22 +01:00
parent 6c5a544f67
commit 9eddc2ba17
2 changed files with 52 additions and 36 deletions

View File

@@ -10,15 +10,24 @@ $navLinks = $navLinks ?? [
];
$navActive = $navActive ?? null;
$headerTabs = isset($headerTabs) ? (string)$headerTabs : '';
$hasHeaderTabs = trim($headerTabs) !== '';
$showNavLinks = !$hasHeaderTabs && !empty($navLinks);
?>
<header class="site-header sticky top-0 z-40 border-b border-slate-200 bg-white/90 backdrop-blur">
<div class="max-w-6xl mx-auto px-4 lg:px-6 flex items-center gap-4 py-3">
<div class="max-w-6xl mx-auto px-4 lg:px-6 flex flex-wrap items-center gap-4 py-3">
<a href="<?= htmlspecialchars($appBaseUrl . '/index.php') ?>" class="flex items-center gap-2 text-slate-800 font-semibold">
<span class="inline-flex h-9 w-9 items-center justify-center rounded-xl bg-sky-500 text-white font-bold">ET</span>
<span class="hidden sm:block">Email Template System</span>
</a>
<nav class="ms-auto hidden md:flex items-center gap-2 text-sm font-medium text-slate-500">
<div class="ms-auto flex items-center gap-3 flex-wrap justify-end flex-1">
<?php if ($hasHeaderTabs): ?>
<div class="header-tabs flex flex-wrap items-center gap-3 justify-end text-sm w-full md:w-auto">
<?= $headerTabs ?>
</div>
<?php elseif ($showNavLinks): ?>
<nav class="hidden md:flex items-center gap-2 text-sm font-medium text-slate-500">
<?php foreach ($navLinks as $link): ?>
<?php
$isActive = $navActive && $navActive === ($link['id'] ?? null);
@@ -30,8 +39,9 @@ $navActive = $navActive ?? null;
</a>
<?php endforeach; ?>
</nav>
<?php endif; ?>
<div class="relative ms-auto md:ms-4" id="userMenu">
<div class="relative" id="userMenu">
<button id="btn-user" type="button" class="btn-avatar" aria-haspopup="true" aria-expanded="false">
<span id="userAvatar">U</span>
</button>
@@ -44,4 +54,5 @@ $navActive = $navActive ?? null;
</div>
</div>
</div>
</div>
</header>

View File

@@ -3,22 +3,27 @@ require_once __DIR__ . '/../config/fileload.php';
$pageTitle = 'Email Template System Admin';
$pageId = 'home';
$navActive = null;
require __DIR__ . '/../partials/structure/layout_start.php';
$navLinks = [];
ob_start();
?>
<main class="max-w-6xl mx-auto p-4 flex-1 w-full space-y-6">
<section class="bg-white border border-slate-200 rounded-2xl shadow-sm px-4 py-3 flex flex-wrap items-center gap-3 sticky top-20 z-10">
<h1 class="font-semibold text-lg text-slate-900 me-2">Email Template System</h1>
<nav class="isolate inline-flex rounded-2xl shadow-sm border bg-white overflow-hidden">
<nav class="isolate inline-flex flex-wrap rounded-2xl shadow-sm border bg-white overflow-hidden">
<button type="button" data-tab="templates" class="px-4 py-2 text-sm border-e bg-sky-50 text-sky-700">Templates</button>
<button type="button" data-tab="sections" class="px-4 py-2 text-sm border-e">Sections</button>
<button type="button" data-tab="blocks" class="px-4 py-2 text-sm border-e">Blocks</button>
<button type="button" data-tab="snippets" class="px-4 py-2 text-sm">Snippets</button>
</nav>
<div class="flex items-center gap-3 ms-auto">
<button id="btn-new" type="button" class="btn">Neu …</button>
</div>
</section>
<?php
$headerTabs = ob_get_clean();
require __DIR__ . '/../partials/structure/layout_start.php';
?>
<main class="max-w-6xl mx-auto p-4 flex-1 w-full space-y-6">
<header class="pb-2 border-b border-slate-200">
<h1 class="font-semibold text-lg text-slate-900">Email Template System</h1>
<p class="text-sm text-slate-500">Wähle eine Kategorie, um Templates, Sections, Blocks oder Snippets zu pflegen.</p>
</header>
<section id="view-templates" class="view"></section>
<section id="view-sections" class="view hidden"></section>