Matchcenter: Tabelle vor dem 1. Spieltag + Testspiele kennzeichnen
Die Tabelle der Frauenmannschaft sah kaputt aus (zehn Mannschaften auf Platz 1, alle grün als Aufstiegszone, überall 0), obwohl sie korrekt war: die Liga startet erst am 06.09., und das einzige Ergebnis war ein Freundschaftsspiel. Beides kommt so vom BFV — vor dem ersten Spieltag liefert die API jeder Mannschaft Rang 1 und dieselbe Zone. league-table erkennt das jetzt an der Summe der gespielten Spiele: Rangspalte zeigt „–", Zonenfarben und Legende entfallen, darüber steht der Hinweis, dass ab dem 1. Spieltag gewertet wird. Tabellen mit laufender Saison (Kreisklasse) bleiben unverändert. Spielzeilen tragen zusätzlich „Freundschaftsspiel" (match_competition_label), damit sichtbar ist, warum ein Testspiel-Ergebnis nicht in der Tabelle steht. Ligaspiele bleiben unbeschriftet — die Sektion nennt die Liga schon. Enthält außerdem den Rahmen um den Tabellen-Scroller (table-scroll-frame), der im Arbeitsstand lag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,24 @@ $hasPromo = in_array('promotion', $zones, true);
|
|||||||
$hasPromoPlayoff = in_array('promotion-playoff', $zones, true);
|
$hasPromoPlayoff = in_array('promotion-playoff', $zones, true);
|
||||||
$hasRelegPlayoff = in_array('relegation-playoff', $zones, true);
|
$hasRelegPlayoff = in_array('relegation-playoff', $zones, true);
|
||||||
$hasReleg = in_array('relegation', $zones, true);
|
$hasReleg = in_array('relegation', $zones, true);
|
||||||
|
|
||||||
|
// Vor dem 1. Spieltag liefert der BFV für JEDE Mannschaft Platz 1 und dieselbe
|
||||||
|
// Auf-/Abstiegszone. Beides ist dann bedeutungslos und lässt die Tabelle kaputt
|
||||||
|
// aussehen (zehn Erste, alles grün) — deshalb Ränge und Zonen unterdrücken und
|
||||||
|
// stattdessen sagen, dass noch nichts gewertet ist. Testspiele zählen hier nicht
|
||||||
|
// mit, ein Freundschaftsspiel-Ergebnis ändert die Tabelle also zu Recht nicht.
|
||||||
|
$notStarted = array_sum(array_map(
|
||||||
|
static fn (array $r): int => (int) ($r['played'] ?? 0),
|
||||||
|
$table
|
||||||
|
)) === 0;
|
||||||
|
if ($notStarted) {
|
||||||
|
$hasPromo = $hasPromoPlayoff = $hasRelegPlayoff = $hasReleg = false;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
<?php if ($notStarted): ?>
|
||||||
|
<p class="league-table__note">Die Liga hat noch nicht begonnen – gewertet wird ab dem 1. Spieltag.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
<div class="table-scroll-frame">
|
||||||
<div class="table-scroll" role="region" aria-label="<?= e($caption) ?>" tabindex="0">
|
<div class="table-scroll" role="region" aria-label="<?= e($caption) ?>" tabindex="0">
|
||||||
<table class="league-table">
|
<table class="league-table">
|
||||||
<caption class="visually-hidden"><?= e($caption) ?></caption>
|
<caption class="visually-hidden"><?= e($caption) ?></caption>
|
||||||
@@ -42,13 +59,13 @@ $hasReleg = in_array('relegation', $zones, true);
|
|||||||
if (!empty($row['is_own_club'])) {
|
if (!empty($row['is_own_club'])) {
|
||||||
$trClass[] = 'is-own';
|
$trClass[] = 'is-own';
|
||||||
}
|
}
|
||||||
if (!empty($row['zone'])) {
|
if (!$notStarted && !empty($row['zone'])) {
|
||||||
$trClass[] = 'zone-' . e($row['zone']);
|
$trClass[] = 'zone-' . e($row['zone']);
|
||||||
}
|
}
|
||||||
$diff = (int) ($row['goal_diff'] ?? 0);
|
$diff = (int) ($row['goal_diff'] ?? 0);
|
||||||
?>
|
?>
|
||||||
<tr<?= $trClass !== [] ? ' class="' . implode(' ', $trClass) . '"' : '' ?>>
|
<tr<?= $trClass !== [] ? ' class="' . implode(' ', $trClass) . '"' : '' ?>>
|
||||||
<td class="league-table__rank"><?= (int) ($row['rank'] ?? 0) ?></td>
|
<td class="league-table__rank"><?= $notStarted ? '–' : (int) ($row['rank'] ?? 0) ?></td>
|
||||||
<th scope="row" class="league-table__club">
|
<th scope="row" class="league-table__club">
|
||||||
<?php component('crest', ['src' => $row['crest'] ?? null, 'name' => $row['club'] ?? '']); ?>
|
<?php component('crest', ['src' => $row['crest'] ?? null, 'name' => $row['club'] ?? '']); ?>
|
||||||
<span class="league-table__name" title="<?= e($row['club'] ?? '') ?>"><?= e($row['club'] ?? '') ?></span>
|
<span class="league-table__name" title="<?= e($row['club'] ?? '') ?>"><?= e($row['club'] ?? '') ?></span>
|
||||||
@@ -64,6 +81,7 @@ $hasReleg = in_array('relegation', $zones, true);
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<?php if ($hasPromo || $hasPromoPlayoff || $hasRelegPlayoff || $hasReleg): ?>
|
<?php if ($hasPromo || $hasPromoPlayoff || $hasRelegPlayoff || $hasReleg): ?>
|
||||||
<ul class="league-table__legend">
|
<ul class="league-table__legend">
|
||||||
<?php if ($hasPromo): ?>
|
<?php if ($hasPromo): ?>
|
||||||
|
|||||||
@@ -34,7 +34,11 @@ $isPrevious = (bool) ($is_previous ?? false);
|
|||||||
<h3 class="visually-hidden">Nächste Spiele</h3>
|
<h3 class="visually-hidden">Nächste Spiele</h3>
|
||||||
<ul class="match-list">
|
<ul class="match-list">
|
||||||
<?php foreach ($next as $m): ?>
|
<?php foreach ($next as $m): ?>
|
||||||
<?php component('match-row', ['match' => $m]); ?>
|
<?php component('match-row', [
|
||||||
|
'match' => $m,
|
||||||
|
// Kennzeichnet Testspiele — sie zählen nicht in der Tabelle.
|
||||||
|
'meta' => match_competition_label((string) ($m['competition'] ?? '')),
|
||||||
|
]); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@@ -42,7 +46,11 @@ $isPrevious = (bool) ($is_previous ?? false);
|
|||||||
<h3 class="visually-hidden">Letzte Ergebnisse</h3>
|
<h3 class="visually-hidden">Letzte Ergebnisse</h3>
|
||||||
<ul class="match-list">
|
<ul class="match-list">
|
||||||
<?php foreach ($results as $m): ?>
|
<?php foreach ($results as $m): ?>
|
||||||
<?php component('match-row', ['match' => $m]); ?>
|
<?php component('match-row', [
|
||||||
|
'match' => $m,
|
||||||
|
// Kennzeichnet Testspiele — sie zählen nicht in der Tabelle.
|
||||||
|
'meta' => match_competition_label((string) ($m['competition'] ?? '')),
|
||||||
|
]); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
@@ -4083,6 +4083,13 @@ a.match-row__link:hover {
|
|||||||
border-left-color: var(--clr-error);
|
border-left-color: var(--clr-error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Hinweis über der Tabelle, solange die Liga noch keinen Spieltag gewertet hat. */
|
||||||
|
.league-table__note {
|
||||||
|
margin-bottom: 0.85rem;
|
||||||
|
font-size: var(--fs-400);
|
||||||
|
color: var(--clr-text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
.league-table__legend {
|
.league-table__legend {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|||||||
Reference in New Issue
Block a user