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.
93 lines
5 KiB
PHP
93 lines
5 KiB
PHP
<?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('/')) ?>"><?= 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']) ?>
|
||
· <?= e(t('routine.revision', ['revision' => (int) ($routine['revision'] ?? 0)])) ?>
|
||
· <?= e(fmt_dt($routine['updated_at'])) ?>
|
||
<?php if ($routine['status'] !== 'published'): ?>
|
||
· <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')) ?>"><?= e(t('routine.download')) ?></a>
|
||
<?php endif; ?>
|
||
<?php if ($audioName !== ''): ?>
|
||
<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"><?= 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"><?= 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"><?= 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']))) ?>"><?= e(t('routine.open_admin')) ?></a>
|
||
<?php endif; ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
|
||
<?php if (!empty($routine['description'])): ?>
|
||
<section class="panel">
|
||
<h2><?= e(t('routine.description')) ?></h2>
|
||
<p class="preline"><?= e($routine['description']) ?></p>
|
||
</section>
|
||
<?php endif; ?>
|
||
|
||
<?php if ($audioName !== ''): ?>
|
||
<section class="panel">
|
||
<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><?= e(t('routine.details')) ?></h2>
|
||
<dl class="facts">
|
||
<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><?= e(t('routine.checksums')) ?></h2>
|
||
<div class="hash">
|
||
<span><?= e(t('routine.breadcrumb_current')) ?></span>
|
||
<code><?= e($routine['routine_sha256'] ?? '–') ?></code>
|
||
</div>
|
||
<?php if ($audioName !== ''): ?>
|
||
<div class="hash">
|
||
<span><?= e(t('routine.music')) ?></span>
|
||
<code><?= e($routine['audio_sha256'] ?? '–') ?></code>
|
||
</div>
|
||
<?php endif; ?>
|
||
<p class="muted small"><?= e(t('routine.checksum_hint')) ?></p>
|
||
</section>
|
||
</article>
|