145 lines
7.3 KiB
PHP
145 lines
7.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
$brandSubtitle = match ($page) {
|
|
'dashboard' => 'Statistiken und Verlauf',
|
|
'track' => 'Tag erfassen und bewerten',
|
|
'archive' => 'Rückblick auf vergangene Tage',
|
|
'options' => 'Logik, Erinnerungen, Sicherheit und Accounts',
|
|
'login' => 'Geschützter Zugang',
|
|
'setup' => 'Erstkonfiguration',
|
|
default => 'Stimmungstracker',
|
|
};
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="theme-color" content="#0b1e2e">
|
|
<meta name="robots" content="noindex, nofollow, noarchive, nosnippet">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
<meta name="apple-mobile-web-app-title" content="Mood-Board">
|
|
<meta name="csrf-token" content="<?= e(csrf_token()) ?>">
|
|
<?php if (!empty($pushPublicKey)): ?>
|
|
<meta name="mood-push-public-key" content="<?= e((string) $pushPublicKey) ?>">
|
|
<?php endif; ?>
|
|
<title><?= e($pageTitle) ?> · Mood</title>
|
|
<link rel="icon" type="image/svg+xml" href="/assets/branding/favicon.svg?v=20260412">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/assets/branding/favicon-32.png?v=20260412">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/assets/branding/favicon-16.png?v=20260412">
|
|
<link rel="shortcut icon" href="/favicon.ico?v=20260412">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/assets/branding/apple-touch-icon.png?v=20260412">
|
|
<link rel="manifest" href="/manifest.webmanifest">
|
|
<link rel="stylesheet" href="/assets/css/app.css">
|
|
<script defer src="/assets/js/app.js"></script>
|
|
</head>
|
|
<body class="app-body page-<?= e($page) ?><?= $authUser !== null ? ' is-authenticated' : '' ?>" data-authenticated="<?= $authUser !== null ? '1' : '0' ?>"<?= isset($trackMood) ? ' data-track-mood="' . e($trackMood) . '"' : '' ?>>
|
|
<div class="aurora aurora-one"></div>
|
|
<div class="aurora aurora-two"></div>
|
|
<div class="pull-refresh-indicator glass-panel" data-pull-refresh-indicator aria-hidden="true">Zum Aktualisieren ziehen</div>
|
|
<div class="shell">
|
|
<?php if ($authUser !== null): ?>
|
|
<aside class="sidebar glass-panel">
|
|
<div class="brand-block">
|
|
<div class="brand-mark">
|
|
<img src="/assets/branding/logo-mark.svg" alt="Mood Logo">
|
|
</div>
|
|
<div>
|
|
<p class="eyebrow">mood.heinz.media</p>
|
|
<h1>Mood</h1>
|
|
</div>
|
|
</div>
|
|
|
|
<nav class="main-nav" aria-label="Hauptnavigation">
|
|
<a class="<?= is_active_path('/') ? 'active' : '' ?>" href="/">
|
|
<img class="nav-icon" src="<?= e(icon_path('dashboard')) ?>" alt="">
|
|
<span>Dashboard</span>
|
|
</a>
|
|
<a class="<?= is_active_path('/track') ? 'active' : '' ?>" href="/track">
|
|
<img class="nav-icon" src="<?= e(icon_path('track')) ?>" alt="">
|
|
<span>Tracken</span>
|
|
</a>
|
|
<a class="<?= is_active_path('/archive') ? 'active' : '' ?>" href="/archive">
|
|
<img class="nav-icon" src="<?= e(icon_path('archive')) ?>" alt="">
|
|
<span>Archiv</span>
|
|
</a>
|
|
<a class="<?= is_active_path('/options') ? 'active' : '' ?>" href="/options">
|
|
<img class="nav-icon" src="<?= e(icon_path('options')) ?>" alt="">
|
|
<span>Optionen</span>
|
|
</a>
|
|
</nav>
|
|
|
|
<div class="sidebar-footer">
|
|
<div class="user-chip">
|
|
<span class="user-chip__name"><?= e($authUser['username']) ?></span>
|
|
<span class="user-chip__role"><?= !empty($authUser['is_admin']) ? 'Admin' : 'Nutzer' ?></span>
|
|
</div>
|
|
<form method="post" action="/logout">
|
|
<?= csrf_field() ?>
|
|
<button class="ghost-button" type="submit">Abmelden</button>
|
|
</form>
|
|
</div>
|
|
</aside>
|
|
<?php endif; ?>
|
|
|
|
<main class="content">
|
|
<?php if ($authUser !== null): ?>
|
|
<header class="topbar glass-panel">
|
|
<div>
|
|
<p class="eyebrow"><?= e($brandSubtitle) ?></p>
|
|
<h2><?= e($pageTitle) ?></h2>
|
|
</div>
|
|
<div class="topbar__meta">
|
|
<?php if ($page === 'track' && isset($topbarDate)): ?>
|
|
<a class="meta-pill meta-pill--button" href="/track?date=<?= e(rawurlencode(shift_date($topbarDate, -1))) ?>">Vorheriger Tag</a>
|
|
<form method="get" action="/track" class="topbar-date-form">
|
|
<input class="topbar-date-input" type="date" name="date" value="<?= e($topbarDate) ?>">
|
|
</form>
|
|
<a class="meta-pill meta-pill--button" href="/track?date=<?= e(rawurlencode(shift_date($topbarDate, 1))) ?>">Nächster Tag</a>
|
|
<?php else: ?>
|
|
<span class="meta-pill"><?= e(date('d.m.Y')) ?></span>
|
|
<?php endif; ?>
|
|
<span class="meta-pill"><?= e($authUser['username']) ?></span>
|
|
</div>
|
|
</header>
|
|
<?php endif; ?>
|
|
|
|
<?php foreach ($flashes as $flash): ?>
|
|
<div class="flash flash-<?= e($flash['type']) ?> glass-panel"><?= e($flash['message']) ?></div>
|
|
<?php endforeach; ?>
|
|
|
|
<?= $content ?>
|
|
|
|
<footer class="site-footer glass-panel">
|
|
<a class="site-footer__link" href="https://git.hnz.io/hnzio/mood-tracking/releases" target="_blank" rel="noreferrer">Version 1.2.0</a>
|
|
<a class="site-footer__link" href="https://hnz.io" target="_blank" rel="noreferrer">(c) 2026 @hnz.io</a>
|
|
</footer>
|
|
</main>
|
|
|
|
<?php if ($authUser !== null): ?>
|
|
<nav class="mobile-nav glass-panel" aria-label="Mobile Hauptnavigation">
|
|
<a class="<?= is_active_path('/') ? 'active' : '' ?>" href="/">
|
|
<img class="nav-icon" src="<?= e(icon_path('dashboard')) ?>" alt="">
|
|
<span>Dashboard</span>
|
|
</a>
|
|
<a class="<?= is_active_path('/track') ? 'active' : '' ?>" href="/track">
|
|
<img class="nav-icon" src="<?= e(icon_path('track')) ?>" alt="">
|
|
<span>Tracken</span>
|
|
</a>
|
|
<a class="<?= is_active_path('/archive') ? 'active' : '' ?>" href="/archive">
|
|
<img class="nav-icon" src="<?= e(icon_path('archive')) ?>" alt="">
|
|
<span>Archiv</span>
|
|
</a>
|
|
<a class="<?= is_active_path('/options') ? 'active' : '' ?>" href="/options">
|
|
<img class="nav-icon" src="<?= e(icon_path('options')) ?>" alt="">
|
|
<span>Optionen</span>
|
|
</a>
|
|
</nav>
|
|
<?php endif; ?>
|
|
</div>
|
|
</body>
|
|
</html>
|