51 lines
2.4 KiB
PHP
51 lines
2.4 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Vorschau-Seite der Stadionzeitung (Live-Seite) — das nächste Spiel jeder
|
||
|
|
* Mannschaft NACH dem Spieltag der Ausgabe (berechnet bzw. eingefroren in
|
||
|
|
* stadionzeitung_build_snapshot(), app/helpers.php). Aufbau je Spiel wie die
|
||
|
|
* „VORSCHAU"-Seite der Canva-Vorlage: Meta-Zeile (Mannschaft · Liga), darunter
|
||
|
|
* die Begegnung mit Wappen, rechts Datum/Anstoß.
|
||
|
|
*
|
||
|
|
* Props: $items stadionzeitung_live_data()['vorschau'] — je Team:
|
||
|
|
* team_name/league/match (Matchcenter-Rohform).
|
||
|
|
*/
|
||
|
|
$items = $items ?? [];
|
||
|
|
|
||
|
|
// Bewusst OHNE CTA-Fuß (Felix, 29.07.2026): mit drei Mannschaften füllt die
|
||
|
|
// Liste die Seite — das Matchcenter-Ticket wohnt auf der Ergebnis-Seite.
|
||
|
|
?>
|
||
|
|
<div class="stadionzeitung-vorschau">
|
||
|
|
<header class="stadionzeitung-page__head">
|
||
|
|
<p class="stadionzeitung-page__kicker">Vorschau</p>
|
||
|
|
<h2 class="stadionzeitung-page__heading">Kommende Spiele</h2>
|
||
|
|
</header>
|
||
|
|
<span class="stadionzeitung-page__rule" aria-hidden="true"></span>
|
||
|
|
<?php if ($items === []): ?>
|
||
|
|
<p class="text-muted">Aktuell stehen keine weiteren Spiele fest.</p>
|
||
|
|
<?php endif; ?>
|
||
|
|
<?php foreach ($items as $item): ?>
|
||
|
|
<?php
|
||
|
|
$match = $item['match'] ?? [];
|
||
|
|
$when = array_filter([
|
||
|
|
trim((string) ($match['date_display'] ?? '')),
|
||
|
|
trim((string) ($match['time_display'] ?? '')),
|
||
|
|
]);
|
||
|
|
$place = !empty($match['is_home']) ? 'im Katzbachtal' : 'auswärts';
|
||
|
|
?>
|
||
|
|
<section class="stadionzeitung-vorschau__match">
|
||
|
|
<p class="stadionzeitung-vorschau__meta"><?= e(trim(implode(' · ', array_filter([(string) ($item['team_name'] ?? ''), (string) ($item['league'] ?? '')])))) ?></p>
|
||
|
|
<?php foreach ([['club' => $match['home'] ?? '', 'crest' => $match['home_crest'] ?? null],
|
||
|
|
['club' => $match['away'] ?? '', 'crest' => $match['away_crest'] ?? null]] as $side): ?>
|
||
|
|
<div class="stadionzeitung-vorschau__row<?= str_contains((string) $side['club'], 'TSV 08 Kulmbach') ? ' stadionzeitung-vorschau__row--own' : '' ?>">
|
||
|
|
<?php component('crest', ['src' => $side['crest'], 'name' => (string) $side['club']]); ?>
|
||
|
|
<span class="stadionzeitung-vorschau__club"><?= e((string) $side['club']) ?></span>
|
||
|
|
</div>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
<p class="stadionzeitung-vorschau__when"><?= e(implode(' · ', $when)) ?><?= $when !== [] ? ' · ' : '' ?><?= e($place) ?></p>
|
||
|
|
</section>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</div>
|