Files
tsv08kulmbach-website/app/components/faq-contact.php
fs a101b0c3ec Stadionzeitung, Veranstaltungen, News-Artikel, Lightbox und Anzeigen-Verteilung
Stadionzeitung: Live-Seiten (Tabellen, Ergebnisse, Vorschau, Termine, News,
Kontakt, Historie, Sportheim, Partner, Momente, Impressum), automatisches Cover,
Swipe-Viewer mit Vollbildmodus und die Druckfassung als Falt-Heft. Anzeigen
kommen jetzt aus dem Bestand und werden gleichmäßig verteilt, nie mehr als zwei
hintereinander (vorher vier Blöcke à fünf). Die Doppelseiten-Regel rechnet das
Skript selbst, statt sie von Hand zu prüfen.

Veranstaltungen: Bereich /veranstaltungen mit Detailseite pro Fest, Lebenszyklus
über das Datum (Ankündigung vor dem Fest, Rückblick danach), Galerie mit
Lightbox. veranstaltungen.json ist dritte Termin-Quelle, damit ein Fest nie
doppelt gepflegt wird.

News-Artikel als dritte dynamische Prefix-Route, gemeinsamer detail-head.

Behobene Fehler:
- Wappen-Kontexte setzten Zeilen-Layout auf .crest statt auf die Zeile; das
  Wappen wurde zum Grid, Vereinsname und Tore rutschten darunter zusammen
  (Ergebnis-Rückblick, Vorschau, Cover).
- --header-h (60px) unterschätzt die Kopfleiste um 32px (Logo 72px + 20px
  Versatz): neues abgeleitetes --header-space, sonst klebten Zurück-Links
  unter dem Logo.
- base_url in der Produktions-Config ohne www, während .htaccess auf www
  umleitet; preflight prüft das jetzt.
- .lightbox brauchte display:none mit (0,2,0), sonst lag das Overlay offen.

Neue Werkzeuge: bin/anzeige-add.php (Anzeigen-Bestand), bin/veranstaltung-bilder.php
(Plakate und Galerien, Alt-Texte folgen der Quelldatei), bin/qr.php (Druck-QR mit
Warnung, wenn base_url nicht auf die echte Domain zeigt).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NzeVVgMCrzCDJAKeLEdKr7
2026-07-31 14:55:27 +02:00

77 lines
3.3 KiB
PHP

<?php
declare(strict_types=1);
/**
* Kombi-Sektion: FAQ (2/3) + einzelner Ansprechpartner (1/3) nebeneinander.
* Sinnvoll, wenn es pro Mannschaft nur einen Kontakt gibt. Props:
* $faq array [{q, a}]
* $persons array — ein oder mehrere Ansprechpartner (person-card). Leer → FAQ volle Breite.
* Bei mehreren: Mini-Slider (ohne JS alle Karten gestapelt sichtbar).
* $faqTitle string (optional, Default 'Häufige Fragen')
* $faqIntro string (optional) — gedämpfte Subline unter der Überschrift
* $contactTitle string (optional, Default 'Dein Ansprechpartner')
* $anchor string (optional, Default 'kontakt')
* Natives <details>/<summary> (ohne JS bedienbar); FAQPage-Schema liefert die Seite.
*/
$faqTitle = $faqTitle ?? 'Häufige Fragen';
$faqIntro = $faqIntro ?? '';
$contactTitle = $contactTitle ?? 'Dein Ansprechpartner';
$anchor = $anchor ?? 'kontakt';
$faq = array_values(array_filter(
$faq ?? [],
static fn (array $i): bool => !empty($i['q']) && !empty($i['a'])
));
$persons = array_values(array_filter($persons ?? [], static fn ($p): bool => !empty($p)));
$hasPerson = $persons !== [];
$isSlider = count($persons) > 1;
if ($faq === [] && !$hasPerson) {
return;
}
?>
<section class="section faq-contact<?= $hasPerson ? '' : ' faq-contact--solo' ?>" id="<?= e($anchor) ?>">
<div class="container">
<h2 class="faq-contact__title"><?= e($faqTitle) ?></h2>
<?php if ($faqIntro !== ''): ?>
<p class="faq-contact__intro text-muted"><?= e($faqIntro) ?></p>
<?php endif; ?>
<div class="faq-contact__inner">
<div class="faq-contact__main">
<div class="faq__list">
<?php foreach ($faq as $item): ?>
<details class="faq__item">
<summary class="faq__q"><span><?= e($item['q']) ?></span><?= icon('chevron-down', 'faq__chevron') ?></summary>
<div class="faq__a"><p><?= inline_links_html($item['a']) ?></p></div>
</details>
<?php endforeach; ?>
</div>
</div>
<?php if ($hasPerson): ?>
<aside class="faq-contact__aside">
<?php if ($contactTitle !== ''): ?>
<h2><?= e($contactTitle) ?></h2>
<?php endif; ?>
<?php if ($isSlider): ?>
<div class="contact-slider" data-contact-slider>
<ul class="contact-slider__track">
<?php foreach ($persons as $p): ?>
<li class="contact-slider__slide" data-contact-slide>
<?php component('person-card', ['person' => $p]); ?>
</li>
<?php endforeach; ?>
</ul>
<div class="contact-slider__dots">
<?php foreach ($persons as $i => $p): ?>
<button type="button" class="contact-slider__dot tap-target" data-contact-dot<?= $i === 0 ? ' aria-current="true"' : '' ?> aria-label="Ansprechpartner <?= $i + 1 ?>: <?= e($p['name']) ?>"></button>
<?php endforeach; ?>
</div>
</div>
<?php else: ?>
<?php component('person-card', ['person' => $persons[0]]); ?>
<?php endif; ?>
</aside>
<?php endif; ?>
</div>
</div>
</section>