65 lines
2.8 KiB
PHP
65 lines
2.8 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Schmaler Kopf einer Detailseite (statt hero): Rückweg, h1, optionaler
|
||
|
|
* Entwurf-Badge, Meta-Zeile. Props:
|
||
|
|
* $back array{href, label} — Rückweg auf die Übersicht (Pflicht)
|
||
|
|
* $title string — die h1 der Seite (Pflicht)
|
||
|
|
* $badge string (optional) — Auszeichnung neben dem Titel, z. B. 'Entwurf'
|
||
|
|
* $date_iso string (optional) — für <time datetime>
|
||
|
|
* $date_text string (optional) — sichtbares Datum (german_date()/german_date_range())
|
||
|
|
* $location string (optional) — Ort, erscheint mit Nadel-Icon hinter dem Datum
|
||
|
|
*
|
||
|
|
* Gemeinsam genutzt von der Veranstaltungs- und der News-Artikel-Seite. Beide
|
||
|
|
* haben bewusst KEINEN hero: ein Archiv-Eintrag hat kein eigenes Titelbild, und
|
||
|
|
* beim News-Artikel trägt der Aufmacher im Artikelkörper das Bild (Blog-Optik)
|
||
|
|
* statt eines cover-beschnittenen Hintergrunds.
|
||
|
|
*
|
||
|
|
* Der Kopf der Stadionzeitungs-Ausgabe (.stadionzeitung-issue-head) bleibt
|
||
|
|
* bewusst eine eigene Fassung und wird hier NICHT mitbedient: er ist
|
||
|
|
* Viewer-Chrome, kein Artikelkopf — Drei-Zonen-Grid, Titel als <p> (die
|
||
|
|
* Seitenbilder tragen die Ausgabe), Druck-Knopf, zwei Badge-Varianten und zwei
|
||
|
|
* eigene @media-print-Regeln. Ihn in dieselbe Komponente zu zwingen, hieße eine
|
||
|
|
* Prop-Matrix für zwei Layouts zu bauen.
|
||
|
|
*/
|
||
|
|
$back = $back ?? [];
|
||
|
|
$title = (string) ($title ?? '');
|
||
|
|
$badge = (string) ($badge ?? '');
|
||
|
|
$dateIso = (string) ($date_iso ?? '');
|
||
|
|
$dateText = (string) ($date_text ?? '');
|
||
|
|
$location = (string) ($location ?? '');
|
||
|
|
$hasMeta = $dateText !== '' || $location !== '';
|
||
|
|
?>
|
||
|
|
<header class="detail-head">
|
||
|
|
<div class="container detail-head__inner">
|
||
|
|
<?php if (!empty($back['href'])): ?>
|
||
|
|
<a class="detail-head__back" href="<?= e($back['href']) ?>">
|
||
|
|
<?= icon('chevron-left') ?> <?= e($back['label'] ?? 'Zurück') ?>
|
||
|
|
</a>
|
||
|
|
<?php endif; ?>
|
||
|
|
<h1 class="detail-head__title">
|
||
|
|
<?= e($title) ?>
|
||
|
|
<?php if ($badge !== ''): ?>
|
||
|
|
<span class="detail-head__badge"><?= e($badge) ?></span>
|
||
|
|
<?php endif; ?>
|
||
|
|
</h1>
|
||
|
|
<?php if ($hasMeta): ?>
|
||
|
|
<p class="detail-head__meta">
|
||
|
|
<?php if ($dateText !== ''): ?>
|
||
|
|
<time<?= $dateIso !== '' ? ' datetime="' . e($dateIso) . '"' : '' ?>><?= e($dateText) ?></time>
|
||
|
|
<?php endif; ?>
|
||
|
|
<?php if ($location !== ''): ?>
|
||
|
|
<?php if ($dateText !== ''): ?>
|
||
|
|
<span class="detail-head__sep" aria-hidden="true">·</span>
|
||
|
|
<?php endif; ?>
|
||
|
|
<?php /* Icon und Ort in EINEM span, sonst bricht die Zeile am Handy zwischen
|
||
|
|
Nadel und Ortsname um. */ ?>
|
||
|
|
<span class="detail-head__ort"><?= icon('geo-alt') ?> <?= e($location) ?></span>
|
||
|
|
<?php endif; ?>
|
||
|
|
</p>
|
||
|
|
<?php endif; ?>
|
||
|
|
</div>
|
||
|
|
</header>
|