feat: Website und Hub zweisprachig (Deutsch/Englisch)

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.
This commit is contained in:
torsten 2026-11-12 22:38:32 +01:00
parent 6c8dc942e8
commit 9819311403
41 changed files with 2801 additions and 326 deletions

View file

@ -1,7 +1,7 @@
<?php /** @var string $active */ ?>
<nav class="admin-tabs">
<a class="<?= $active === 'invites' ? 'active' : '' ?>" href="<?= e(url('/admin/invites')) ?>">Einladungen</a>
<a class="<?= $active === 'users' ? 'active' : '' ?>" href="<?= e(url('/admin/users')) ?>">Benutzer</a>
<a class="<?= $active === 'routines' ? 'active' : '' ?>" href="<?= e(url('/admin/routines')) ?>">Küren</a>
<a class="<?= $active === 'audit' ? 'active' : '' ?>" href="<?= e(url('/admin/audit')) ?>">Audit-Log</a>
<a class="<?= $active === 'invites' ? 'active' : '' ?>" href="<?= e(url('/admin/invites')) ?>"><?= e(t('admin.tab_invites')) ?></a>
<a class="<?= $active === 'users' ? 'active' : '' ?>" href="<?= e(url('/admin/users')) ?>"><?= e(t('admin.tab_users')) ?></a>
<a class="<?= $active === 'routines' ? 'active' : '' ?>" href="<?= e(url('/admin/routines')) ?>"><?= e(t('admin.tab_routines')) ?></a>
<a class="<?= $active === 'audit' ? 'active' : '' ?>" href="<?= e(url('/admin/audit')) ?>"><?= e(t('admin.tab_audit')) ?></a>
</nav>

View file

@ -2,51 +2,58 @@
<?php $user = auth_user(); ?>
<section class="page-head">
<div>
<h1>Konto</h1>
<p class="muted"><?= e($user['username']) ?> · <?= e($user['role'] === 'admin' ? 'Administrator' : 'Beta-Nutzer') ?></p>
<h1><?= e(t('account.title')) ?></h1>
<p class="muted"><?= e($user['username']) ?> · <?= e($user['role'] === 'admin' ? t('account.role_admin') : t('account.role_user')) ?></p>
</div>
</section>
<?php if ($user['must_change_password'] === 1): ?>
<div class="flash flash-info">Bitte ein neues Passwort setzen, bevor du den Hub weiter nutzt.</div>
<div class="flash flash-info"><?= e(t('account.must_change')) ?></div>
<?php endif; ?>
<div class="columns">
<section class="panel">
<h2>Passwort ändern</h2>
<h2><?= e(t('account.change_password')) ?></h2>
<form method="post" action="<?= e(url('/account/password')) ?>" class="stack">
<?= csrf_field() ?>
<label>
Aktuelles Passwort
<?= e(t('account.current_password')) ?>
<input type="password" name="current_password" autocomplete="current-password" required>
</label>
<label>
Neues Passwort
<?= e(t('account.new_password')) ?>
<input type="password" name="password" autocomplete="new-password" required>
<span class="hint">Mindestens 10 Zeichen.</span>
<span class="hint"><?= e(t('account.password_hint')) ?></span>
</label>
<label>
Neues Passwort wiederholen
<?= e(t('account.repeat_password')) ?>
<input type="password" name="password_repeat" autocomplete="new-password" required>
</label>
<button class="primary" type="submit">Passwort speichern</button>
<button class="primary" type="submit"><?= e(t('account.save_password')) ?></button>
</form>
</section>
<section class="panel">
<h2>API-Tokens</h2>
<p class="muted">Für die Godot-App. Ein Token ersetzt Benutzername und Passwort im Client und lässt sich jederzeit widerrufen.</p>
<h2><?= e(t('account.tokens')) ?></h2>
<p class="muted"><?= e(t('account.tokens_lede')) ?></p>
<form method="post" action="<?= e(url('/account/tokens')) ?>" class="inline-form">
<?= csrf_field() ?>
<input type="text" name="name" maxlength="64" placeholder="Name, z. B. Büro-PC" required>
<button type="submit">Token erzeugen</button>
<input type="text" name="name" maxlength="64" placeholder="<?= e_attr(t('account.token_placeholder')) ?>" required>
<button type="submit"><?= e(t('account.token_create')) ?></button>
</form>
<?php if ($tokens): ?>
<div class="table-wrap">
<table class="list compact">
<thead>
<tr><th>Name</th><th>Prefix</th><th>Erstellt</th><th>Zuletzt</th><th>Status</th><th></th></tr>
<tr>
<th><?= e(t('table.name')) ?></th>
<th><?= e(t('table.prefix')) ?></th>
<th><?= e(t('table.created')) ?></th>
<th><?= e(t('table.last_used')) ?></th>
<th><?= e(t('table.status')) ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($tokens as $token): ?>
@ -55,13 +62,13 @@
<td><code><?= e($token['prefix']) ?>…</code></td>
<td><?= e(fmt_dt($token['created_at'])) ?></td>
<td><?= e(fmt_dt($token['last_used_at'])) ?></td>
<td><?= $token['revoked_at'] !== null ? 'widerrufen' : 'aktiv' ?></td>
<td><?= e($token['revoked_at'] !== null ? t('account.token_revoked') : t('account.token_active')) ?></td>
<td>
<?php if ($token['revoked_at'] === null): ?>
<form class="inline" method="post" action="<?= e(url('/account/tokens/revoke')) ?>">
<?= csrf_field() ?>
<input type="hidden" name="token_id" value="<?= (int) $token['id'] ?>">
<button class="link-button danger" type="submit">widerrufen</button>
<button class="link-button danger" type="submit"><?= e(t('account.token_revoke')) ?></button>
</form>
<?php endif; ?>
</td>
@ -71,7 +78,7 @@
</table>
</div>
<?php else: ?>
<p class="muted small">Noch kein Token erzeugt.</p>
<p class="muted small"><?= e(t('account.no_tokens')) ?></p>
<?php endif; ?>
</section>
</div>

View file

@ -1,20 +1,27 @@
<?php /** @var array $entries */ ?>
<div class="page-head">
<div>
<h1>Verwaltung</h1>
<p class="muted">Die letzten <?= count($entries) ?> Ereignisse.</p>
<h1><?= e(t('admin.title')) ?></h1>
<p class="muted"><?= e(t('admin.audit_lede', ['count' => count($entries)])) ?></p>
</div>
</div>
<?php $active = 'audit'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
<section class="panel">
<?php if (!$entries): ?>
<p class="muted">Noch keine Einträge.</p>
<p class="muted"><?= e(t('admin.audit_empty')) ?></p>
<?php else: ?>
<div class="table-wrap">
<table class="list compact">
<thead>
<tr><th>Zeit</th><th>Akteur</th><th>Aktion</th><th>Objekt</th><th>Detail</th><th>IP</th></tr>
<tr>
<th><?= e(t('table.time')) ?></th>
<th><?= e(t('table.actor')) ?></th>
<th><?= e(t('table.action')) ?></th>
<th><?= e(t('table.subject')) ?></th>
<th><?= e(t('table.detail')) ?></th>
<th><?= e(t('table.ip')) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($entries as $entry): ?>

View file

@ -1,63 +1,71 @@
<?php /** @var array $invites */ ?>
<div class="page-head">
<div>
<h1>Verwaltung</h1>
<p class="muted">Einladungen für die geschlossene Beta.</p>
<h1><?= e(t('admin.title')) ?></h1>
<p class="muted"><?= e(t('admin_invites.lede')) ?></p>
</div>
</div>
<?php $active = 'invites'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
<section class="panel">
<h2>Neue Einladung</h2>
<p class="muted">Der Code wird nach dem Anlegen genau einmal angezeigt. Er gilt für ein Konto.</p>
<h2><?= e(t('admin_invites.new')) ?></h2>
<p class="muted"><?= e(t('admin_invites.new_lede')) ?></p>
<form method="post" action="<?= e(url('/admin/invites')) ?>" class="stack">
<?= csrf_field() ?>
<div class="grid-3">
<label>
Notiz (intern)
<input type="text" name="note" maxlength="190" placeholder="z. B. Verein Nord">
<?= e(t('admin_invites.note')) ?>
<input type="text" name="note" maxlength="190" placeholder="<?= e_attr(t('admin_invites.note_placeholder')) ?>">
</label>
<label>
E-Mail binden (optional)
<?= e(t('admin_invites.email')) ?>
<input type="email" name="email" maxlength="190">
<span class="hint">Nur diese Adresse kann den Code nutzen.</span>
<span class="hint"><?= e(t('admin_invites.email_hint')) ?></span>
</label>
<label>
Gültig (Tage)
<?= e(t('admin_invites.days')) ?>
<input type="number" name="expires_days" min="0" max="365" value="30">
<span class="hint">0 = unbegrenzt.</span>
<span class="hint"><?= e(t('admin_invites.days_hint')) ?></span>
</label>
</div>
<button class="primary" type="submit">Einladung erzeugen</button>
<button class="primary" type="submit"><?= e(t('admin_invites.create')) ?></button>
</form>
</section>
<section class="panel">
<h2>Einladungen</h2>
<h2><?= e(t('admin_invites.list')) ?></h2>
<?php if (!$invites): ?>
<p class="muted">Noch keine Einladungen.</p>
<p class="muted"><?= e(t('admin_invites.empty')) ?></p>
<?php else: ?>
<div class="table-wrap">
<table class="list compact">
<thead>
<tr><th>Erstellt</th><th>Notiz</th><th>E-Mail</th><th>Status</th><th>Von / an</th><th>Gültig bis</th><th></th></tr>
<tr>
<th><?= e(t('table.created')) ?></th>
<th><?= e(t('table.note')) ?></th>
<th><?= e(t('table.email')) ?></th>
<th><?= e(t('table.status')) ?></th>
<th><?= e(t('table.from_to')) ?></th>
<th><?= e(t('table.valid_until')) ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($invites as $invite): ?>
<?php
$status = invite_status($invite);
$statusClass = [
'offen' => 'open',
'eingelöst' => 'used',
'abgelaufen' => 'expired',
'widerrufen' => 'revoked',
'open' => 'open',
'used' => 'used',
'expired' => 'expired',
'revoked' => 'revoked',
][$status] ?? 'expired';
?>
<tr>
<td><?= e(fmt_dt($invite['created_at'])) ?></td>
<td><?= e($invite['note'] ?: '–') ?></td>
<td><?= e($invite['email'] ?: '–') ?></td>
<td><span class="status status-<?= e($statusClass) ?>"><?= e($status) ?></span></td>
<td><span class="status status-<?= e($statusClass) ?>"><?= e(t('invite.status.' . $status)) ?></span></td>
<td>
<?= e($invite['creator_name'] ?: '–') ?>
<?php if (!empty($invite['used_name'])): ?>
@ -66,11 +74,11 @@
</td>
<td><?= e(fmt_dt($invite['expires_at'])) ?></td>
<td>
<?php if ($status === 'offen'): ?>
<?php if ($status === 'open'): ?>
<form class="inline" method="post" action="<?= e(url('/admin/invites/revoke')) ?>">
<?= csrf_field() ?>
<input type="hidden" name="invite_id" value="<?= (int) $invite['id'] ?>">
<button class="link-button danger" type="submit">widerrufen</button>
<button class="link-button danger" type="submit"><?= e(t('admin_invites.revoke')) ?></button>
</form>
<?php endif; ?>
</td>

View file

@ -17,26 +17,34 @@ $linkFor = static function (int $targetPage) use ($query): string {
?>
<div class="page-head">
<div>
<h1>Verwaltung</h1>
<p class="muted"><?= (int) $total ?> Küren insgesamt, auch versteckte.</p>
<h1><?= e(t('admin.title')) ?></h1>
<p class="muted"><?= e(t('admin_routines.lede', ['total' => (int) $total])) ?></p>
</div>
</div>
<?php $active = 'routines'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
<div class="toolbar">
<form method="get" action="<?= e(url('/admin/routines')) ?>" class="search">
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="Titel, Skater, Benutzer …">
<button type="submit">Suchen</button>
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="<?= e_attr(t('admin_routines.search_placeholder')) ?>">
<button type="submit"><?= e(t('dashboard.search')) ?></button>
</form>
</div>
<?php if (!$items): ?>
<div class="empty"><p>Keine Küren gefunden.</p></div>
<div class="empty"><p><?= e(t('admin_routines.empty')) ?></p></div>
<?php else: ?>
<div class="table-wrap">
<table class="list compact">
<thead>
<tr><th>Titel</th><th>Von</th><th>Status</th><th>Rev.</th><th>Aktualisiert</th><th>Downloads</th><th>Aktionen</th></tr>
<tr>
<th><?= e(t('table.title')) ?></th>
<th><?= e(t('table.by')) ?></th>
<th><?= e(t('table.status')) ?></th>
<th><?= e(t('table.revision')) ?></th>
<th><?= e(t('table.updated')) ?></th>
<th><?= e(t('table.downloads')) ?></th>
<th><?= e(t('table.actions')) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($items as $item): ?>
@ -53,19 +61,19 @@ $linkFor = static function (int $targetPage) use ($query): string {
<?= csrf_field() ?>
<input type="hidden" name="routine_id" value="<?= (int) $item['id'] ?>">
<input type="hidden" name="action" value="<?= $item['status'] === 'published' ? 'hide' : 'publish' ?>">
<button class="link-button" type="submit"><?= $item['status'] === 'published' ? 'verstecken' : 'veröffentlichen' ?></button>
<button class="link-button" type="submit"><?= e($item['status'] === 'published' ? t('admin_routines.hide') : t('admin_routines.publish')) ?></button>
</form>
<details class="danger-zone">
<summary>löschen</summary>
<summary><?= e(t('admin_routines.delete')) ?></summary>
<form method="post" action="<?= e(url('/admin/routines/action')) ?>" class="stack-tight">
<?= csrf_field() ?>
<input type="hidden" name="routine_id" value="<?= (int) $item['id'] ?>">
<input type="hidden" name="action" value="delete">
<label class="check small">
<input type="checkbox" name="confirm" value="1" required>
endgültig löschen
<?= e(t('admin_routines.delete_confirm')) ?>
</label>
<button class="link-button danger" type="submit">Löschen bestätigen</button>
<button class="link-button danger" type="submit"><?= e(t('admin_routines.delete_submit')) ?></button>
</form>
</details>
</div>
@ -78,9 +86,9 @@ $linkFor = static function (int $targetPage) use ($query): string {
<?php if ($pages > 1): ?>
<nav class="pagination">
<?php if ($page > 1): ?><a href="<?= e($linkFor($page - 1)) ?>">← Zurück</a><?php endif; ?>
<span>Seite <?= (int) $page ?> von <?= (int) $pages ?></span>
<?php if ($page < $pages): ?><a href="<?= e($linkFor($page + 1)) ?>">Weiter →</a><?php endif; ?>
<?php if ($page > 1): ?><a href="<?= e($linkFor($page - 1)) ?>"><?= e(t('pagination.back')) ?></a><?php endif; ?>
<span><?= e(t('pagination.page', ['page' => (int) $page, 'pages' => (int) $pages])) ?></span>
<?php if ($page < $pages): ?><a href="<?= e($linkFor($page + 1)) ?>"><?= e(t('pagination.next')) ?></a><?php endif; ?>
</nav>
<?php endif; ?>
<?php endif; ?>

View file

@ -2,18 +2,26 @@
<?php $me = auth_user(); ?>
<div class="page-head">
<div>
<h1>Verwaltung</h1>
<p class="muted">Beta-Konten verwalten.</p>
<h1><?= e(t('admin.title')) ?></h1>
<p class="muted"><?= e(t('admin_users.lede')) ?></p>
</div>
</div>
<?php $active = 'users'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
<section class="panel">
<h2>Benutzer</h2>
<h2><?= e(t('admin.tab_users')) ?></h2>
<div class="table-wrap">
<table class="list compact">
<thead>
<tr><th>Benutzer</th><th>Rolle</th><th>Status</th><th>Küren</th><th>Registriert</th><th>Letzte Anmeldung</th><th>Aktionen</th></tr>
<tr>
<th><?= e(t('admin.tab_users')) ?></th>
<th><?= e(t('table.role')) ?></th>
<th><?= e(t('table.status')) ?></th>
<th><?= e(t('table.routines')) ?></th>
<th><?= e(t('table.registered')) ?></th>
<th><?= e(t('table.last_login')) ?></th>
<th><?= e(t('table.actions')) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user): ?>
@ -25,10 +33,10 @@
<div class="muted small"><?= e($user['email']) ?></div>
<?php endif; ?>
</td>
<td><?= $user['role'] === 'admin' ? 'Admin' : 'Nutzer' ?></td>
<td><?= e($user['role'] === 'admin' ? t('admin_users.role_admin') : t('admin_users.role_user')) ?></td>
<td>
<span class="status status-<?= $user['status'] === 'active' ? 'open' : 'expired' ?>">
<?= $user['status'] === 'active' ? 'aktiv' : 'gesperrt' ?>
<?= e($user['status'] === 'active' ? t('status.active') : t('status.blocked')) ?>
</span>
</td>
<td><?= (int) $user['routine_count'] ?></td>
@ -36,7 +44,7 @@
<td><?= e(fmt_dt($user['last_login_at'])) ?></td>
<td>
<?php if ((int) $user['id'] === (int) $me['id']): ?>
<span class="muted small">eigenes Konto</span>
<span class="muted small"><?= e(t('admin_users.self')) ?></span>
<?php else: ?>
<div class="row-actions">
<?php if ($user['status'] === 'active'): ?>
@ -44,33 +52,33 @@
<?= csrf_field() ?>
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
<input type="hidden" name="action" value="disable">
<button class="link-button danger" type="submit">sperren</button>
<button class="link-button danger" type="submit"><?= e(t('admin_users.block')) ?></button>
</form>
<?php else: ?>
<form class="inline" method="post" action="<?= e(url('/admin/users/action')) ?>">
<?= csrf_field() ?>
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
<input type="hidden" name="action" value="enable">
<button class="link-button" type="submit">entsperren</button>
<button class="link-button" type="submit"><?= e(t('admin_users.unblock')) ?></button>
</form>
<?php endif; ?>
<form class="inline" method="post" action="<?= e(url('/admin/users/action')) ?>">
<?= csrf_field() ?>
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
<input type="hidden" name="action" value="reset">
<button class="link-button" type="submit">Passwort zurücksetzen</button>
<button class="link-button" type="submit"><?= e(t('admin_users.reset')) ?></button>
</form>
<details class="danger-zone">
<summary>löschen</summary>
<summary><?= e(t('admin_users.delete')) ?></summary>
<form method="post" action="<?= e(url('/admin/users/action')) ?>" class="stack-tight">
<?= csrf_field() ?>
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
<input type="hidden" name="action" value="delete">
<label class="check small">
<input type="checkbox" name="confirm" value="1" required>
mit allen Küren löschen
<?= e(t('admin_users.delete_confirm')) ?>
</label>
<button class="link-button danger" type="submit">Löschen bestätigen</button>
<button class="link-button danger" type="submit"><?= e(t('admin_users.delete_submit')) ?></button>
</form>
</details>
</div>

View file

@ -24,39 +24,42 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
alt="Rinkplanner-Hub-Logo: drei Schlittschuhe, durch ein Netz verbunden"
width="132" height="132">
<div class="hub-hero-text">
<p class="eyebrow">Viele Schlittschuhe, ein Netz</p>
<p class="hub-hero-title">Küren teilen, Fassungen vergleichen, gemeinsam weiterentwickeln.</p>
<p class="hub-hero-sub">Der Hub sammelt Küren, Musik und Revisionen deines Teams an einem Ort.</p>
<p class="eyebrow"><?= e(t('dashboard.eyebrow')) ?></p>
<p class="hub-hero-title"><?= e(t('dashboard.hero_title')) ?></p>
<p class="hub-hero-sub"><?= e(t('dashboard.hero_sub')) ?></p>
</div>
</section>
<div class="page-head">
<div>
<h1>Küren</h1>
<p class="muted"><?= (int) $total ?> <?= $total === 1 ? 'Kür' : 'Küren' ?> im Hub<?= $mine ? ' (nur deine)' : '' ?>.</p>
<h1><?= e(t('dashboard.title')) ?></h1>
<p class="muted"><?= e(t('dashboard.count', [
'count' => (int) $total,
'label' => t($total === 1 ? 'dashboard.one_routine' : 'dashboard.many_routines'),
])) ?><?= $mine ? e(t('dashboard.mine_suffix')) : '' ?>.</p>
</div>
<a class="button primary" href="<?= e(url('/upload')) ?>">Kür hochladen</a>
<a class="button primary" href="<?= e(url('/upload')) ?>"><?= e(t('dashboard.upload')) ?></a>
</div>
<div class="toolbar">
<form method="get" action="<?= e(url('/')) ?>" class="search">
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="Titel, Skater, Musik, Benutzer …">
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="<?= e_attr(t('dashboard.search_placeholder')) ?>">
<?php if ($mine): ?><input type="hidden" name="mine" value="1"><?php endif; ?>
<button type="submit">Suchen</button>
<button type="submit"><?= e(t('dashboard.search')) ?></button>
</form>
<div class="tabs">
<a class="<?= $mine ? '' : 'active' ?>" href="<?= e(url('/')) ?>">Alle</a>
<a class="<?= $mine ? 'active' : '' ?>" href="<?= e(url('/?mine=1')) ?>">Meine Küren</a>
<a class="<?= $mine ? '' : 'active' ?>" href="<?= e(url('/')) ?>"><?= e(t('dashboard.all')) ?></a>
<a class="<?= $mine ? 'active' : '' ?>" href="<?= e(url('/?mine=1')) ?>"><?= e(t('dashboard.mine')) ?></a>
</div>
</div>
<?php if (!$items): ?>
<div class="empty">
<p>Keine Küren gefunden.</p>
<p><?= e(t('dashboard.empty')) ?></p>
<?php if ($query !== ''): ?>
<p class="muted">Suche zurücksetzen oder <a href="<?= e(url('/upload')) ?>">selbst eine Kür hochladen</a>.</p>
<p class="muted"><?= e(t('dashboard.empty_hint')) ?> <a href="<?= e(url('/upload')) ?>"><?= e(t('dashboard.empty_upload')) ?></a>.</p>
<?php else: ?>
<p class="muted">Der Hub ist noch leer. <a href="<?= e(url('/upload')) ?>">Erste Kür hochladen</a>.</p>
<p class="muted"><?= e(t('dashboard.empty_first')) ?> <a href="<?= e(url('/upload')) ?>"><?= e(t('dashboard.empty_first_action')) ?></a>.</p>
<?php endif; ?>
</div>
<?php else: ?>
@ -64,13 +67,13 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
<table class="list">
<thead>
<tr>
<th>Titel</th>
<th>Skater</th>
<th>Musik</th>
<th>Rev.</th>
<th>Größe</th>
<th>Aktualisiert</th>
<th>Von</th>
<th><?= e(t('table.title')) ?></th>
<th><?= e(t('table.skater')) ?></th>
<th><?= e(t('table.music')) ?></th>
<th><?= e(t('table.revision')) ?></th>
<th><?= e(t('table.size')) ?></th>
<th><?= e(t('table.updated')) ?></th>
<th><?= e(t('table.by')) ?></th>
</tr>
</thead>
<tbody>
@ -79,7 +82,7 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
<td>
<a class="title-link" href="<?= e(url('/routines/' . (int) $item['id'])) ?>"><?= e($item['title']) ?></a>
<?php if ($item['status'] !== 'published'): ?>
<span class="badge">versteckt</span>
<span class="badge"><?= e(t('badge.hidden')) ?></span>
<?php endif; ?>
<?php if (!empty($item['category'])): ?>
<span class="badge badge-soft"><?= e($item['category']) ?></span>
@ -110,11 +113,11 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
<?php if ($pages > 1): ?>
<nav class="pagination">
<?php if ($page > 1): ?>
<a href="<?= e($linkFor($page - 1)) ?>">← Zurück</a>
<a href="<?= e($linkFor($page - 1)) ?>"><?= e(t('pagination.back')) ?></a>
<?php endif; ?>
<span>Seite <?= (int) $page ?> von <?= (int) $pages ?></span>
<span><?= e(t('pagination.page', ['page' => (int) $page, 'pages' => (int) $pages])) ?></span>
<?php if ($page < $pages): ?>
<a href="<?= e($linkFor($page + 1)) ?>">Weiter →</a>
<a href="<?= e($linkFor($page + 1)) ?>"><?= e(t('pagination.next')) ?></a>
<?php endif; ?>
</nav>
<?php endif; ?>

View file

@ -1,7 +1,7 @@
<?php /** @var int $status */ ?>
<?php /** @var string $message */ ?>
<section class="auth-card">
<p class="eyebrow">Fehler <?= (int) $status ?></p>
<p class="eyebrow"><?= e(t('error.label', ['status' => (int) $status])) ?></p>
<h1><?= e($message) ?></h1>
<p class="muted">Zurück zur <a href="<?= e(url('/')) ?>">Küren-Übersicht</a>.</p>
<p class="muted"><?= e(t('error.back')) ?> <a href="<?= e(url('/')) ?>"><?= e(t('error.back_link')) ?></a>.</p>
</section>

View file

@ -3,16 +3,18 @@
/** @var string $content */
/** @var array|null $user */
$flashes = flash_pull();
$locale = hub_locale();
$next = (string) ($_SERVER['REQUEST_URI'] ?? '/');
?>
<!doctype html>
<html lang="de">
<html lang="<?= e($locale) ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= e($title) ?> · Rinkplanner-Hub</title>
<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')) ?>">
<link rel="stylesheet" href="<?= e(url('/assets/hub.css') . '?v=' . HUB_ASSET_VERSION) ?>">
</head>
<body>
<header class="topbar">
@ -22,19 +24,25 @@ $flashes = flash_pull();
</a>
<nav class="nav">
<?php if ($user !== null): ?>
<a href="<?= e(url('/')) ?>">Küren</a>
<a href="<?= e(url('/upload')) ?>">Hochladen</a>
<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')) ?>">Verwaltung</a>
<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">Abmelden</button>
<button class="link-button" type="submit"><?= e(t('nav.logout')) ?></button>
</form>
<?php else: ?>
<a href="<?= e(url('/login')) ?>">Anmelden</a>
<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>
@ -44,7 +52,7 @@ $flashes = flash_pull();
<?php foreach ($flashes as $flash): ?>
<?php if (($flash['type'] ?? '') === 'secret'): ?>
<div class="flash flash-secret">
<strong><?= e($flash['label'] ?? 'Geheimnis') ?></strong>
<strong><?= e($flash['label'] ?? t('flash.secret')) ?></strong>
<code><?= e($flash['value'] ?? '') ?></code>
</div>
<?php else: ?>
@ -60,8 +68,8 @@ $flashes = flash_pull();
</main>
<footer class="footer">
<span>Geschlossene Beta · Rinkplanner-Hub</span>
<a href="https://rinkplanner.programmschmiede.de/">Zur Rinkplanner-Seite</a>
<span><?= e(t('footer.beta')) ?></span>
<a href="https://rinkplanner.programmschmiede.de/"><?= e(t('footer.website')) ?></a>
</footer>
</body>
</html>

View file

@ -2,8 +2,8 @@
<?php /** @var string $login */ ?>
<?php /** @var string $next */ ?>
<section class="auth-card">
<h1>Anmelden</h1>
<p class="muted">Der Kür-Hub ist in einer geschlossenen Beta. Zugang gibt es per Einladungscode.</p>
<h1><?= e(t('login.title')) ?></h1>
<p class="muted"><?= e(t('login.lede')) ?></p>
<?php if ($error !== ''): ?>
<div class="flash flash-error"><?= e($error) ?></div>
@ -13,19 +13,19 @@
<?= csrf_field() ?>
<input type="hidden" name="next" value="<?= e_attr($next) ?>">
<label>
Benutzername oder E-Mail
<?= e(t('login.login_label')) ?>
<input type="text" name="login" value="<?= e_attr($login) ?>" autocomplete="username" required autofocus>
</label>
<label>
Passwort
<?= e(t('login.password')) ?>
<input type="password" name="password" autocomplete="current-password" required>
</label>
<label class="check">
<input type="checkbox" name="remember" value="1">
Angemeldet bleiben (30 Tage)
<?= e(t('login.remember')) ?>
</label>
<button class="primary" type="submit">Anmelden</button>
<button class="primary" type="submit"><?= e(t('login.submit')) ?></button>
</form>
<p class="muted small">Noch keinen Zugang? Ein Beta-Code kommt von der Hub-Administration.</p>
<p class="muted small"><?= e(t('login.no_access')) ?></p>
</section>

View file

@ -3,8 +3,8 @@
<?php /** @var array $errors */ ?>
<?php /** @var array $input */ ?>
<section class="auth-card wide">
<h1>Beta-Zugang einlösen</h1>
<p class="muted">Ein Einladungscode legt genau ein Konto an. Der Code verliert danach seine Gültigkeit.</p>
<h1><?= e(t('register.title')) ?></h1>
<p class="muted"><?= e(t('register.lede')) ?></p>
<?php if ($errors): ?>
<div class="flash flash-error">
@ -19,44 +19,44 @@
<form method="post" action="<?= e(url('/register')) ?>" class="stack">
<?= csrf_field() ?>
<label>
Einladungscode
<?= e(t('register.code')) ?>
<input type="text" name="code" value="<?= e_attr($code) ?>" placeholder="RHUB-XXXX-XXXX-XXXX-XXXX" required>
</label>
<div class="grid-2">
<label>
Benutzername
<?= e(t('register.username')) ?>
<input type="text" name="username" value="<?= e_attr($input['username']) ?>" autocomplete="username" required>
<span class="hint">3–32 Zeichen, nur Kleinbuchstaben, Ziffern, Punkt, Bindestrich, Unterstrich.</span>
<span class="hint"><?= e(t('register.username_hint')) ?></span>
</label>
<label>
Anzeigename
<?= e(t('register.display_name')) ?>
<input type="text" name="display_name" value="<?= e_attr($input['display_name']) ?>" maxlength="64">
</label>
</div>
<label>
E-Mail (optional)
<?= e(t('register.email')) ?>
<input type="email" name="email" value="<?= e_attr($input['email']) ?>" autocomplete="email"<?= $invite !== null && !empty($invite['email']) ? ' readonly' : '' ?>>
<?php if ($invite !== null && !empty($invite['email'])): ?>
<span class="hint">Diese Einladung ist an <?= e($invite['email']) ?> gebunden.</span>
<span class="hint"><?= e(t('register.email_bound', ['email' => $invite['email']])) ?></span>
<?php endif; ?>
</label>
<div class="grid-2">
<label>
Passwort
<?= e(t('register.password')) ?>
<input type="password" name="password" autocomplete="new-password" required>
<span class="hint">Mindestens 10 Zeichen.</span>
<span class="hint"><?= e(t('register.password_hint')) ?></span>
</label>
<label>
Passwort wiederholen
<?= e(t('register.password_repeat')) ?>
<input type="password" name="password_repeat" autocomplete="new-password" required>
</label>
</div>
<label class="check">
<input type="checkbox" name="rights" value="1" required>
Ich akzeptiere die Beta-Regeln und teile keine Inhalte, an denen ich keine Rechte habe.
<?= e(t('register.rights')) ?>
</label>
<button class="primary" type="submit">Konto anlegen</button>
<button class="primary" type="submit"><?= e(t('register.submit')) ?></button>
</form>
<p class="muted small">Schon ein Konto? <a href="<?= e(url('/login')) ?>">Anmelden</a></p>
<p class="muted small"><?= e(t('register.have_account')) ?> <a href="<?= e(url('/login')) ?>"><?= e(t('register.login_link')) ?></a></p>
</section>

View file

@ -1,93 +1,93 @@
<?php /** @var array $routine */ ?>
<?php /** @var array|null $routine */ ?>
<?php /** @var bool $can_edit */ ?>
<?php /** @var bool $is_admin */ ?>
<?php $audioName = $routine['audio_original_name'] ?? ''; ?>
<article class="detail">
<div class="page-head">
<div>
<p class="eyebrow"><a href="<?= e(url('/')) ?>">Küren</a> / Kür</p>
<p class="eyebrow"><a href="<?= e(url('/')) ?>"><?= e(t('routine.breadcrumb')) ?></a> / <?= e(t('routine.breadcrumb_current')) ?></p>
<h1><?= e($routine['title']) ?></h1>
<p class="muted">
<?= e($routine['owner_display_name'] ?: $routine['owner_username']) ?>
· Revision <?= (int) ($routine['revision'] ?? 0) ?>
· <?= e(t('routine.revision', ['revision' => (int) ($routine['revision'] ?? 0)])) ?>
· <?= e(fmt_dt($routine['updated_at'])) ?>
<?php if ($routine['status'] !== 'published'): ?>
· <span class="badge">versteckt</span>
· <span class="badge"><?= e(t('badge.hidden')) ?></span>
<?php endif; ?>
</p>
</div>
<div class="actions">
<?php if (!empty($routine['routine_path'])): ?>
<a class="button primary" href="<?= e(url('/routines/' . (int) $routine['id'] . '/download')) ?>">Kür herunterladen</a>
<a class="button primary" href="<?= e(url('/routines/' . (int) $routine['id'] . '/download')) ?>"><?= e(t('routine.download')) ?></a>
<?php endif; ?>
<?php if ($audioName !== ''): ?>
<a class="button" href="<?= e(url('/routines/' . (int) $routine['id'] . '/audio')) ?>">Musik herunterladen</a>
<a class="button" href="<?= e(url('/routines/' . (int) $routine['id'] . '/audio')) ?>"><?= e(t('routine.download_audio')) ?></a>
<?php endif; ?>
</div>
</div>
<?php if ($can_edit): ?>
<div class="owner-bar">
<span class="muted">Du kannst diese Kür verwalten.</span>
<a class="button small" href="<?= e(url('/routines/' . (int) $routine['id'] . '/revise')) ?>">Neue Revision hochladen</a>
<span class="muted"><?= e(t('routine.owner_bar')) ?></span>
<a class="button small" href="<?= e(url('/routines/' . (int) $routine['id'] . '/revise')) ?>"><?= e(t('routine.new_revision')) ?></a>
<?php if ($routine['status'] === 'published'): ?>
<form class="inline" method="post" action="<?= e(url('/routines/' . (int) $routine['id'] . '/hide')) ?>">
<?= csrf_field() ?>
<button class="button small danger-ghost" type="submit">Aus dem Hub nehmen</button>
<button class="button small danger-ghost" type="submit"><?= e(t('routine.hide')) ?></button>
</form>
<?php else: ?>
<form class="inline" method="post" action="<?= e(url('/routines/' . (int) $routine['id'] . '/publish')) ?>">
<?= csrf_field() ?>
<button class="button small" type="submit">Wieder veröffentlichen</button>
<button class="button small" type="submit"><?= e(t('routine.publish')) ?></button>
</form>
<?php endif; ?>
<?php if ($is_admin): ?>
<a class="button small danger-ghost" href="<?= e(url('/admin/routines?q=' . rawurlencode($routine['title']))) ?>">In der Verwaltung öffnen</a>
<a class="button small danger-ghost" href="<?= e(url('/admin/routines?q=' . rawurlencode($routine['title']))) ?>"><?= e(t('routine.open_admin')) ?></a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (!empty($routine['description'])): ?>
<section class="panel">
<h2>Beschreibung</h2>
<h2><?= e(t('routine.description')) ?></h2>
<p class="preline"><?= e($routine['description']) ?></p>
</section>
<?php endif; ?>
<?php if ($audioName !== ''): ?>
<section class="panel">
<h2>Musik</h2>
<h2><?= e(t('routine.music')) ?></h2>
<audio controls preload="none" src="<?= e(url('/routines/' . (int) $routine['id'] . '/audio')) ?>"></audio>
<p class="muted small"><?= e($audioName) ?> · <?= e(human_bytes((int) ($routine['audio_bytes'] ?? 0))) ?></p>
</section>
<?php endif; ?>
<section class="panel">
<h2>Details</h2>
<h2><?= e(t('routine.details')) ?></h2>
<dl class="facts">
<div><dt>Skater</dt><dd><?= e($routine['skater_name'] ?: '–') ?></dd></div>
<div><dt>Kategorie</dt><dd><?= e($routine['category'] ?: '–') ?></dd></div>
<div><dt>Musiktitel</dt><dd><?= e($routine['music_title'] ?: '–') ?></dd></div>
<div><dt>Musik</dt><dd><?= e($routine['music_artist'] ?: '–') ?></dd></div>
<div><dt>Kür-Datei</dt><dd><?= e($routine['routine_original_name'] ?? '–') ?> · <?= e(human_bytes((int) ($routine['routine_bytes'] ?? 0))) ?></dd></div>
<div><dt>Audio-Datei</dt><dd><?= e($audioName !== '' ? $audioName . ' · ' . human_bytes((int) ($routine['audio_bytes'] ?? 0)) : '–') ?></dd></div>
<div><dt>Downloads</dt><dd><?= (int) $routine['download_count'] ?></dd></div>
<div><dt>Eingestellt</dt><dd><?= e(fmt_dt($routine['created_at'])) ?></dd></div>
<div><dt><?= e(t('table.skater')) ?></dt><dd><?= e($routine['skater_name'] ?: '–') ?></dd></div>
<div><dt><?= e(t('routine.category')) ?></dt><dd><?= e($routine['category'] ?: '–') ?></dd></div>
<div><dt><?= e(t('routine.music_title')) ?></dt><dd><?= e($routine['music_title'] ?: '–') ?></dd></div>
<div><dt><?= e(t('routine.music_artist')) ?></dt><dd><?= e($routine['music_artist'] ?: '–') ?></dd></div>
<div><dt><?= e(t('routine.routine_file')) ?></dt><dd><?= e($routine['routine_original_name'] ?? '–') ?> · <?= e(human_bytes((int) ($routine['routine_bytes'] ?? 0))) ?></dd></div>
<div><dt><?= e(t('routine.audio_file')) ?></dt><dd><?= e($audioName !== '' ? $audioName . ' · ' . human_bytes((int) ($routine['audio_bytes'] ?? 0)) : '–') ?></dd></div>
<div><dt><?= e(t('table.downloads')) ?></dt><dd><?= (int) $routine['download_count'] ?></dd></div>
<div><dt><?= e(t('table.created')) ?></dt><dd><?= e(fmt_dt($routine['created_at'])) ?></dd></div>
</dl>
</section>
<section class="panel">
<h2>Prüfsummen</h2>
<h2><?= e(t('routine.checksums')) ?></h2>
<div class="hash">
<span>Kür</span>
<span><?= e(t('routine.breadcrumb_current')) ?></span>
<code><?= e($routine['routine_sha256'] ?? '–') ?></code>
</div>
<?php if ($audioName !== ''): ?>
<div class="hash">
<span>Musik</span>
<span><?= e(t('routine.music')) ?></span>
<code><?= e($routine['audio_sha256'] ?? '–') ?></code>
</div>
<?php endif; ?>
<p class="muted small">Beim Download prüfen, ob die SHA-256-Summe zur Kür passt.</p>
<p class="muted small"><?= e(t('routine.checksum_hint')) ?></p>
</section>
</article>

View file

@ -3,11 +3,11 @@
<?php /** @var array|null $routine */ ?>
<?php $isRevision = $routine !== null; ?>
<section class="auth-card wide">
<h1><?= $isRevision ? 'Neue Revision' : 'Kür hochladen' ?></h1>
<h1><?= e($isRevision ? t('upload.title_revision') : t('upload.title_new')) ?></h1>
<?php if ($isRevision): ?>
<p class="muted">Neue Fassung von „<?= e($routine['title']) ?>“. Die bisherige Revision bleibt erhalten.</p>
<p class="muted"><?= e(t('upload.revision_lede', ['title' => $routine['title']])) ?></p>
<?php else: ?>
<p class="muted">Lade die Kür-JSON und – falls die Kür Musik nutzt – die zugehörige Audiodatei hoch. Beide gehören als Paket zusammen.</p>
<p class="muted"><?= e(t('upload.lede')) ?></p>
<?php endif; ?>
<?php if ($errors): ?>
@ -26,41 +26,41 @@
<?= csrf_field() ?>
<div class="grid-2">
<label>
Kür-Datei (.json)
<?= e(t('upload.routine_file')) ?>
<input type="file" name="routine" accept=".json,application/json" required>
<span class="hint">Aus Rinkplanner gespeicherte Kür, max. <?= e(human_bytes((int) config('app.max_routine_bytes', 8 * 1024 * 1024))) ?>.</span>
<span class="hint"><?= e(t('upload.routine_hint', ['max' => human_bytes((int) config('app.max_routine_bytes', 8 * 1024 * 1024))])) ?></span>
</label>
<label>
Musikdatei (MP3/OGG/WAV/M4A/AAC)
<?= e(t('upload.audio_file')) ?>
<input type="file" name="audio" accept=".mp3,.ogg,.wav,.m4a,.aac,audio/*">
<span class="hint">Dateiname muss exakt dem Feld „music_file“ der Kür entsprechen.</span>
<span class="hint"><?= e(t('upload.audio_hint')) ?></span>
</label>
</div>
<label>
Beschreibung (optional)
<?= e(t('upload.description')) ?>
<textarea name="description" rows="4" maxlength="2000"><?= e($input['description']) ?></textarea>
</label>
<div class="grid-2">
<label>
Musiktitel (optional)
<?= e(t('upload.music_title')) ?>
<input type="text" name="music_title" maxlength="190" value="<?= e_attr($input['music_title']) ?>">
</label>
<label>
Interpret (optional)
<?= e(t('upload.artist')) ?>
<input type="text" name="music_artist" maxlength="190" value="<?= e_attr($input['music_artist']) ?>">
</label>
</div>
<label class="check">
<input type="checkbox" name="rights" value="1" required>
Ich habe die Rechte an Kür und Musik und darf sie im geschlossenen Beta-Hub teilen.
<?= e(t('upload.rights')) ?>
</label>
<div class="actions">
<button class="primary" type="submit"><?= $isRevision ? 'Revision veröffentlichen' : 'Kür veröffentlichen' ?></button>
<a class="button" href="<?= e(url($isRevision ? '/routines/' . (int) $routine['id'] : '/')) ?>">Abbrechen</a>
<button class="primary" type="submit"><?= e($isRevision ? t('upload.submit_revision') : t('upload.submit_new')) ?></button>
<a class="button" href="<?= e(url($isRevision ? '/routines/' . (int) $routine['id'] : '/')) ?>"><?= e(t('upload.cancel')) ?></a>
</div>
</form>
</section>