72 lines
3.1 KiB
PHP
72 lines
3.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Programm-Seite der Stadionzeitung (Live-Seite, Sportfest-Ausgabe): das
|
||
|
|
* Tagesprogramm einer Veranstaltung, je Tag eine Gruppe (Wochentag + Datum),
|
||
|
|
* darunter Zeit | Titel (+ Zusatz). Kopf im Muster der Geschwister-Seiten.
|
||
|
|
*
|
||
|
|
* Quelle ist AUSSCHLIESSLICH data/veranstaltungen.json → programm[] der
|
||
|
|
* Veranstaltung, auf die die Ausgabe zeigt (`veranstaltung`-Feld, Slug). Dieselbe
|
||
|
|
* Liste rendert die Website-Detailseite über veranstaltung-programm.php — eine
|
||
|
|
* Quelle für Heft und Website, hier nur eine zweite Darstellung fürs A5-Blatt
|
||
|
|
* (cqi-Maße statt Website-Tokens). Bewusst live, kein Snapshot: chat-gepflegte
|
||
|
|
* Daten wie bei kontakt/aufruf, kein Sync räumt hier etwas weg.
|
||
|
|
*
|
||
|
|
* Props: $issue (Eintrag aus data/stadionzeitung.json)
|
||
|
|
*/
|
||
|
|
$issue = $issue ?? [];
|
||
|
|
$v = veranstaltung_find((string) ($issue['veranstaltung'] ?? ''));
|
||
|
|
$programm = is_array($v['programm'] ?? null) ? $v['programm'] : [];
|
||
|
|
if ($v === null || $programm === []) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
$zeitraum = german_date_range((string) ($v['date_start'] ?? ''), $v['date_end'] ?? null);
|
||
|
|
$sub = trim(implode(' · ', array_filter([$zeitraum, (string) ($v['location'] ?? '')])));
|
||
|
|
?>
|
||
|
|
<div class="stadionzeitung-programm">
|
||
|
|
<header class="stadionzeitung-page__head">
|
||
|
|
<p class="stadionzeitung-page__kicker"><?= e((string) ($v['title'] ?? 'Veranstaltung')) ?></p>
|
||
|
|
<h2 class="stadionzeitung-page__heading">Programm</h2>
|
||
|
|
<?php if ($sub !== ''): ?>
|
||
|
|
<p class="stadionzeitung-page__sub"><?= e($sub) ?></p>
|
||
|
|
<?php endif; ?>
|
||
|
|
</header>
|
||
|
|
<span class="stadionzeitung-page__rule" aria-hidden="true"></span>
|
||
|
|
<?php foreach ($programm as $tag): ?>
|
||
|
|
<?php
|
||
|
|
$tagIso = (string) ($tag['tag'] ?? '');
|
||
|
|
$weekday = $tagIso !== '' ? german_weekday($tagIso) : '';
|
||
|
|
$tagText = trim(($weekday !== '' ? $weekday . ', ' : '') . ($tagIso !== '' ? german_date($tagIso) : ''));
|
||
|
|
$punkte = is_array($tag['punkte'] ?? null) ? $tag['punkte'] : [];
|
||
|
|
if ($punkte === []) {
|
||
|
|
continue;
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
<section class="stadionzeitung-programm__tag">
|
||
|
|
<?php if ($tagText !== ''): ?>
|
||
|
|
<h3 class="stadionzeitung-programm__tag-titel"><time datetime="<?= e($tagIso) ?>"><?= e($tagText) ?></time></h3>
|
||
|
|
<?php endif; ?>
|
||
|
|
<ul class="stadionzeitung-programm__liste">
|
||
|
|
<?php foreach ($punkte as $punkt): ?>
|
||
|
|
<?php $zeit = trim((string) ($punkt['zeit'] ?? '')); ?>
|
||
|
|
<li class="stadionzeitung-programm__punkt">
|
||
|
|
<?php if ($zeit !== ''): ?>
|
||
|
|
<span class="stadionzeitung-programm__zeit"><time datetime="<?= e($tagIso !== '' ? $tagIso . 'T' . $zeit : $zeit) ?>"><?= e($zeit) ?></time></span>
|
||
|
|
<?php else: ?>
|
||
|
|
<span aria-hidden="true"></span>
|
||
|
|
<?php endif; ?>
|
||
|
|
<span class="stadionzeitung-programm__body">
|
||
|
|
<span class="stadionzeitung-programm__titel"><?= e((string) ($punkt['titel'] ?? '')) ?></span>
|
||
|
|
<?php if (!empty($punkt['text'])): ?>
|
||
|
|
<span class="stadionzeitung-programm__text"><?= e((string) $punkt['text']) ?></span>
|
||
|
|
<?php endif; ?>
|
||
|
|
</span>
|
||
|
|
</li>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</ul>
|
||
|
|
</section>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</div>
|