Website (rinkplanner.programmschmiede.de) liegt jetzt im Repo unter web/: Sprachweiche nach Accept-Language (der User-Agent enthält keine Sprache), /de/ und /en/ als eigene URLs mit hreflang, Cookie für die manuelle Wahl, Texte in web/i18n.php, Markup in web/template.php. Deployment über tools/deploy_web.sh (--sync, --check, --all); /index.html leitet weiter. Hub: optionale englische Oberfläche über den DE/EN-Umschalter, Cookie RHUB_LANG, Route /language. Alle Texte (Views, Meldungen, Validierung, API-messages) stehen in hub/app/i18n_strings.php und laufen über t(); Datum und Zahlen folgen der Sprache. Die API behält ihre code-Felder und antwortet ohne Cookie weiter deutsch. deploy_hub.sh --check prüft jetzt Schlüsselparität und fehlende t()-Schlüssel. Doku: docs/website.md neu, docs/hub.md und AGENTS.md ergänzt.
75 lines
3.1 KiB
PHP
75 lines
3.1 KiB
PHP
<?php
|
|
/** @var string $title */
|
|
/** @var string $content */
|
|
/** @var array|null $user */
|
|
$flashes = flash_pull();
|
|
$locale = hub_locale();
|
|
$next = (string) ($_SERVER['REQUEST_URI'] ?? '/');
|
|
?>
|
|
<!doctype html>
|
|
<html lang="<?= e($locale) ?>">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title><?= e($title) ?> · <?= e(t('app.name')) ?></title>
|
|
<link rel="icon" type="image/png" href="<?= e(url('/assets/logo-icon.png')) ?>">
|
|
<link rel="apple-touch-icon" href="<?= e(url('/assets/logo-icon.png')) ?>">
|
|
<link rel="stylesheet" href="<?= e(url('/assets/hub.css') . '?v=' . HUB_ASSET_VERSION) ?>">
|
|
</head>
|
|
<body>
|
|
<header class="topbar">
|
|
<a class="brand" href="<?= e(url('/')) ?>">
|
|
<img class="brand-mark" src="<?= e(url('/assets/logo.png')) ?>" alt="" width="32" height="32">
|
|
<span>Rinkplanner <strong>Hub</strong></span>
|
|
</a>
|
|
<nav class="nav">
|
|
<?php if ($user !== null): ?>
|
|
<a href="<?= e(url('/')) ?>"><?= e(t('nav.routines')) ?></a>
|
|
<a href="<?= e(url('/upload')) ?>"><?= e(t('nav.upload')) ?></a>
|
|
<a href="<?= e(url('/account')) ?>"><?= e($user['display_name']) ?></a>
|
|
<?php if (($user['role'] ?? '') === 'admin'): ?>
|
|
<a class="nav-admin" href="<?= e(url('/admin/invites')) ?>"><?= e(t('nav.admin')) ?></a>
|
|
<?php endif; ?>
|
|
<form class="inline" method="post" action="<?= e(url('/logout')) ?>">
|
|
<?= csrf_field() ?>
|
|
<button class="link-button" type="submit"><?= e(t('nav.logout')) ?></button>
|
|
</form>
|
|
<?php else: ?>
|
|
<a href="<?= e(url('/login')) ?>"><?= e(t('nav.login')) ?></a>
|
|
<?php endif; ?>
|
|
<div class="lang-switch" role="group" aria-label="<?= e(t('nav.language')) ?>">
|
|
<?php foreach (['de' => 'DE', 'en' => 'EN'] as $code => $label): ?>
|
|
<a href="<?= e(url('/language') . '?lang=' . $code . '&next=' . rawurlencode($next)) ?>"
|
|
lang="<?= e($code) ?>" hreflang="<?= e($code) ?>"<?= $locale === $code ? ' aria-current="true"' : '' ?>><?= $label ?></a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="page">
|
|
<?php if ($flashes): ?>
|
|
<div class="flashes">
|
|
<?php foreach ($flashes as $flash): ?>
|
|
<?php if (($flash['type'] ?? '') === 'secret'): ?>
|
|
<div class="flash flash-secret">
|
|
<strong><?= e($flash['label'] ?? t('flash.secret')) ?></strong>
|
|
<code><?= e($flash['value'] ?? '') ?></code>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="flash flash-<?= e($flash['type'] ?? 'info') ?>">
|
|
<?= e($flash['message'] ?? '') ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?= $content ?>
|
|
</main>
|
|
|
|
<footer class="footer">
|
|
<span><?= e(t('footer.beta')) ?></span>
|
|
<a href="https://rinkplanner.programmschmiede.de/"><?= e(t('footer.website')) ?></a>
|
|
</footer>
|
|
</body>
|
|
</html>
|