Eigenes CSS statt Framework, Vanilla-JavaScript, heller und dunkler Modus. Ohne JavaScript bleibt alles bedienbar; das Liniendiagramm faellt auf eine selbst gezeichnete Balkendarstellung zurueck, wenn das CDN nicht erreichbar ist. Chart.js ist auf eine Version festgelegt und per Subresource Integrity an seinen Hash gebunden. Die Domain-Seite enthaelt eine Schritt-fuer-Schritt-Anleitung fuer DNS, Hosting-Panel und Zertifikat samt Fehlersuche.
69 lines
2.5 KiB
PHP
69 lines
2.5 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Layout des Admin-Bereichs.
|
|
*
|
|
* @var App\View $view
|
|
* @var App\Config $config
|
|
* @var App\Security\Csrf $csrf
|
|
* @var App\Security\Auth $auth
|
|
* @var string $content
|
|
* @var list<array{type:string,message:string}> $flashes
|
|
* @var string $currentPath
|
|
*/
|
|
|
|
$title = $pageTitle ?? 'Verwaltung';
|
|
$isActive = static fn (string $prefix): bool => str_starts_with($currentPath ?? '/', $prefix);
|
|
?>
|
|
<!doctype html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="robots" content="noindex, nofollow">
|
|
<title><?= $e($title) ?> · Kurzlinks</title>
|
|
<link rel="stylesheet" href="<?= $e($url('assets/app.css')) ?>">
|
|
<link rel="icon" href="<?= $e($url('assets/favicon.svg')) ?>" type="image/svg+xml">
|
|
</head>
|
|
<body>
|
|
<header class="topbar">
|
|
<div class="container topbar__inner">
|
|
<a class="brand" href="<?= $e($url('/admin')) ?>">
|
|
<span class="brand__mark" aria-hidden="true"></span>
|
|
<span class="brand__text">Kurzlinks</span>
|
|
</a>
|
|
|
|
<nav class="mainnav" aria-label="Hauptnavigation">
|
|
<a href="<?= $e($url('/admin')) ?>" class="<?= ($currentPath === '/admin' || $currentPath === '/') ? 'is-active' : '' ?>">Übersicht</a>
|
|
<a href="<?= $e($url('/admin/links')) ?>" class="<?= $isActive('/admin/links') ? 'is-active' : '' ?>">Kurzlinks</a>
|
|
<a href="<?= $e($url('/admin/domains')) ?>" class="<?= $isActive('/admin/domains') ? 'is-active' : '' ?>">Domains</a>
|
|
<a href="<?= $e($url('/admin/links/new')) ?>" class="btn btn--primary btn--sm">Neuer Kurzlink</a>
|
|
</nav>
|
|
|
|
<form class="logout" method="post" action="<?= $e($url('/logout')) ?>">
|
|
<?= $csrf->field() ?>
|
|
<span class="logout__user" title="Angemeldet als"><?= $e($auth->currentUser() ?? '') ?></span>
|
|
<button type="submit" class="btn btn--ghost btn--sm">Abmelden</button>
|
|
</form>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="container main">
|
|
<?php foreach ($flashes ?? [] as $flash): ?>
|
|
<div class="alert alert--<?= $e($flash['type']) ?>" role="status"><?= $e($flash['message']) ?></div>
|
|
<?php endforeach; ?>
|
|
|
|
<?= $content ?>
|
|
</main>
|
|
|
|
<footer class="footer">
|
|
<div class="container">
|
|
<span>Basis-URL: <code><?= $e(rtrim($config->baseUrl(), '/')) ?></code></span>
|
|
</div>
|
|
</footer>
|
|
|
|
<script src="<?= $e($url('assets/app.js')) ?>" defer></script>
|
|
<?= $pageScripts ?? '' ?>
|
|
</body>
|
|
</html>
|