39 lines
2.0 KiB
PHP
39 lines
2.0 KiB
PHP
|
|
<?php
|
|||
|
|
|
|||
|
|
declare(strict_types=1);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Kompakte Spielzeile für die Matchcenter-Seitenspalte (kicker-Stil): Datum oben,
|
|||
|
|
* darunter Heim über Gast (Wappen + Name, lange Namen werden mit … gekürzt), rechts
|
|||
|
|
* das Ergebnis bzw. — bei anstehenden Spielen — die Anstoßzeit. Heim steht immer
|
|||
|
|
* oben/links. Props: $match (Eintrag aus data/matchcenter.json).
|
|||
|
|
*/
|
|||
|
|
$m = $match;
|
|||
|
|
$hasResult = isset($m['goals_home'], $m['goals_away']);
|
|||
|
|
$isHome = !empty($m['is_home']);
|
|||
|
|
?>
|
|||
|
|
<li class="match-row">
|
|||
|
|
<?php if (!empty($m['date_display'])): ?>
|
|||
|
|
<span class="match-row__date"><?= e($m['date_display']) ?></span>
|
|||
|
|
<?php endif; ?>
|
|||
|
|
<div class="match-row__teams">
|
|||
|
|
<span class="match-row__team<?= $isHome ? ' is-own' : '' ?>">
|
|||
|
|
<?php component('crest', ['src' => $m['home_crest'] ?? null, 'name' => $m['home'] ?? '']); ?>
|
|||
|
|
<span class="match-row__name" title="<?= e($m['home'] ?? '') ?>"><?= e($m['home'] ?? '') ?></span>
|
|||
|
|
</span>
|
|||
|
|
<span class="match-row__team<?= !$isHome ? ' is-own' : '' ?>">
|
|||
|
|
<?php component('crest', ['src' => $m['away_crest'] ?? null, 'name' => $m['away'] ?? '']); ?>
|
|||
|
|
<span class="match-row__name" title="<?= e($m['away'] ?? '') ?>"><?= e($m['away'] ?? '') ?></span>
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<span class="match-row__outcome">
|
|||
|
|
<?php if ($hasResult): ?>
|
|||
|
|
<span class="match-row__score"><?= (int) $m['goals_home'] ?>:<?= (int) $m['goals_away'] ?></span>
|
|||
|
|
<?php elseif (!empty($m['time_display'])): ?>
|
|||
|
|
<span class="match-row__time"><?= e($m['time_display']) ?></span>
|
|||
|
|
<?php else: ?>
|
|||
|
|
<span class="match-row__time" aria-hidden="true">–</span>
|
|||
|
|
<?php endif; ?>
|
|||
|
|
</span>
|
|||
|
|
</li>
|