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.
66 lines
2.7 KiB
PHP
66 lines
2.7 KiB
PHP
<?php /** @var array $errors */ ?>
|
|
<?php /** @var array $input */ ?>
|
|
<?php /** @var array|null $routine */ ?>
|
|
<?php $isRevision = $routine !== null; ?>
|
|
<section class="auth-card wide">
|
|
<h1><?= e($isRevision ? t('upload.title_revision') : t('upload.title_new')) ?></h1>
|
|
<?php if ($isRevision): ?>
|
|
<p class="muted"><?= e(t('upload.revision_lede', ['title' => $routine['title']])) ?></p>
|
|
<?php else: ?>
|
|
<p class="muted"><?= e(t('upload.lede')) ?></p>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($errors): ?>
|
|
<div class="flash flash-error">
|
|
<ul class="plain">
|
|
<?php foreach ($errors as $error): ?>
|
|
<li><?= e($error) ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<form method="post" enctype="multipart/form-data"
|
|
action="<?= e(url($isRevision ? '/routines/' . (int) $routine['id'] . '/revise' : '/upload')) ?>"
|
|
class="stack">
|
|
<?= csrf_field() ?>
|
|
<div class="grid-2">
|
|
<label>
|
|
<?= e(t('upload.routine_file')) ?>
|
|
<input type="file" name="routine" accept=".json,application/json" required>
|
|
<span class="hint"><?= e(t('upload.routine_hint', ['max' => human_bytes((int) config('app.max_routine_bytes', 8 * 1024 * 1024))])) ?></span>
|
|
</label>
|
|
<label>
|
|
<?= e(t('upload.audio_file')) ?>
|
|
<input type="file" name="audio" accept=".mp3,.ogg,.wav,.m4a,.aac,audio/*">
|
|
<span class="hint"><?= e(t('upload.audio_hint')) ?></span>
|
|
</label>
|
|
</div>
|
|
|
|
<label>
|
|
<?= e(t('upload.description')) ?>
|
|
<textarea name="description" rows="4" maxlength="2000"><?= e($input['description']) ?></textarea>
|
|
</label>
|
|
|
|
<div class="grid-2">
|
|
<label>
|
|
<?= e(t('upload.music_title')) ?>
|
|
<input type="text" name="music_title" maxlength="190" value="<?= e_attr($input['music_title']) ?>">
|
|
</label>
|
|
<label>
|
|
<?= 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>
|
|
<?= e(t('upload.rights')) ?>
|
|
</label>
|
|
|
|
<div class="actions">
|
|
<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>
|