Turnen: schlichte Gruppen als Bodenreihe direkt ins Bento (groupsInDash)
Neue opt-in-Prop groupsInDash in group-schedule zieht schlichte Gruppen (ohne intro/details) als volle Bodenreihe MIT ins Dashboard-Bento, ohne eigene Sektion und ohne "Unsere Gruppen"-Ueberschrift. Trampolin nutzt das, damit Hinweis, Trainingsort, Kontakt und die drei Gruppen-Karten ein zusammenhaengender Block sind statt einer losgeloesten Kartenreihe darunter. Wiederverwendung von .group-list--grid/.group-card, Karten-Markup DRY in renderSimpleCard. Wettkampfturnen/Kinderturnen bleiben unberuehrt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXDvgRDHQ9iGjs4KCXykEj
This commit is contained in:
@@ -36,6 +36,12 @@ declare(strict_types=1);
|
|||||||
* $layout 'tabs' (Default) | 'stacked' — greift nur bei beschreibenden Gruppen.
|
* $layout 'tabs' (Default) | 'stacked' — greift nur bei beschreibenden Gruppen.
|
||||||
* 'stacked' zeigt alle Karten offen untereinander (wenige Gruppen),
|
* 'stacked' zeigt alle Karten offen untereinander (wenige Gruppen),
|
||||||
* 'tabs' ordnet viele textreiche Gruppen (Kinderturnen).
|
* 'tabs' ordnet viele textreiche Gruppen (Kinderturnen).
|
||||||
|
* $groupsInDash bool (optional) — nur für SCHLICHTE Gruppen (ohne intro/details): zieht die
|
||||||
|
* Gruppen-Karten als volle Bodenreihe MIT INS Bento-Dashboard, ohne eigene Sektion
|
||||||
|
* und ohne „Unsere Gruppen"-Überschrift. Für Disziplinen mit wenigen kurzen Gruppen
|
||||||
|
* (Trampolin), damit das Dashboard ein zusammenhängender Block bleibt statt einer
|
||||||
|
* losgelösten Kartenreihe darunter. Bei beschreibenden Gruppen (Wettkampfturnen,
|
||||||
|
* Kinderturnen) wirkungslos — die brauchen Platz und ihre eigene Sektion.
|
||||||
* $anchor string (optional, Default 'training')
|
* $anchor string (optional, Default 'training')
|
||||||
*
|
*
|
||||||
* Eine Gruppe → Trainingszeiten landen als Bento-Kachel im Dashboard.
|
* Eine Gruppe → Trainingszeiten landen als Bento-Kachel im Dashboard.
|
||||||
@@ -54,6 +60,7 @@ $noticeTitle = $noticeTitle ?? '';
|
|||||||
$noticeTone = $noticeTone ?? 'info';
|
$noticeTone = $noticeTone ?? 'info';
|
||||||
$noticeIcon = $noticeIcon ?? 'info-circle';
|
$noticeIcon = $noticeIcon ?? 'info-circle';
|
||||||
$footnote = $footnote ?? '';
|
$footnote = $footnote ?? '';
|
||||||
|
$groupsInDash = !empty($groupsInDash);
|
||||||
$groups = $groups ?? [];
|
$groups = $groups ?? [];
|
||||||
$location = $location ?? [];
|
$location = $location ?? [];
|
||||||
|
|
||||||
@@ -74,6 +81,9 @@ foreach ($groups as $g) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Schlichte Gruppen direkt ins Dashboard ziehen (nur wenn mehrere und keine „reich").
|
||||||
|
$groupsInline = $groupsInDash && !$single && !$rich;
|
||||||
|
|
||||||
$hasVenue = !empty($location['venue']);
|
$hasVenue = !empty($location['venue']);
|
||||||
$mapsQuery = $hasVenue ? rawurlencode(trim(
|
$mapsQuery = $hasVenue ? rawurlencode(trim(
|
||||||
($location['venue'] ?? '') . ', '
|
($location['venue'] ?? '') . ', '
|
||||||
@@ -160,12 +170,39 @@ $renderCardBody = static function (array $g) use ($renderSession): void {
|
|||||||
<?php
|
<?php
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schlichte Gruppen-Karte (Name + Trainingszeiten). Als Closure, weil sie an zwei Stellen
|
||||||
|
* gebraucht wird: im Raster der eigenen Gruppen-Sektion und — bei $groupsInline — als Kachel
|
||||||
|
* direkt im Bento-Dashboard.
|
||||||
|
*/
|
||||||
|
$renderSimpleCard = static function (array $g) use ($renderSession): void {
|
||||||
|
?>
|
||||||
|
<article class="group-card">
|
||||||
|
<div class="group-card__body">
|
||||||
|
<div class="group-card__header">
|
||||||
|
<h3 class="group-card__name"><?= e($g['name']) ?></h3>
|
||||||
|
<?php if (!empty($g['level'])): ?>
|
||||||
|
<p class="group-card__level"><?= e($g['level']) ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php if (!empty($g['sessions'])): ?>
|
||||||
|
<div class="group-card__schedule">
|
||||||
|
<ul class="schedule-list">
|
||||||
|
<?php foreach ($g['sessions'] as $s): $renderSession($s); endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</article>
|
||||||
|
<?php
|
||||||
|
};
|
||||||
|
|
||||||
$soleSessions = $single ? ($groups[0]['sessions'] ?? []) : [];
|
$soleSessions = $single ? ($groups[0]['sessions'] ?? []) : [];
|
||||||
$soleNote = $single ? ($groups[0]['note'] ?? '') : '';
|
$soleNote = $single ? ($groups[0]['note'] ?? '') : '';
|
||||||
?>
|
?>
|
||||||
<section class="section turnen-dash-section" id="<?= e($anchor) ?>">
|
<section class="section turnen-dash-section" id="<?= e($anchor) ?>">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="turnen-dash<?= $single ? ' turnen-dash--single' : '' ?><?= $notice !== '' ? ' turnen-dash--notice' : '' ?>">
|
<div class="turnen-dash<?= $single ? ' turnen-dash--single' : '' ?><?= $notice !== '' ? ' turnen-dash--notice' : '' ?><?= $groupsInline ? ' turnen-dash--groups' : '' ?>">
|
||||||
<?php if ($notice !== ''): ?>
|
<?php if ($notice !== ''): ?>
|
||||||
<?php component('notice', [
|
<?php component('notice', [
|
||||||
'title' => $noticeTitle,
|
'title' => $noticeTitle,
|
||||||
@@ -222,11 +259,19 @@ $soleNote = $single ? ($groups[0]['note'] ?? '') : '';
|
|||||||
<span class="bento__deco" aria-hidden="true"><?= icon('geo-alt') ?></span>
|
<span class="bento__deco" aria-hidden="true"><?= icon('geo-alt') ?></span>
|
||||||
</article>
|
</article>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php if ($groupsInline): ?>
|
||||||
|
<div class="turnen-dash__groups group-list--grid">
|
||||||
|
<?php foreach ($groups as $g): $renderSimpleCard($g); endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php if ($groupsInline && $footnote !== ''): ?>
|
||||||
|
<p class="group-list__footnote text-muted"><?= e($footnote) ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<?php if (!$single): ?>
|
<?php if (!$single && !$groupsInline): ?>
|
||||||
<section class="section group-list-section<?= $groupsTitleHidden ? ' group-list-section--tight' : '' ?>" id="gruppen">
|
<section class="section group-list-section<?= $groupsTitleHidden ? ' group-list-section--tight' : '' ?>" id="gruppen">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2 class="group-list__title<?= $groupsTitleHidden ? ' visually-hidden' : '' ?>"><?= e($groupsTitle) ?></h2>
|
<h2 class="group-list__title<?= $groupsTitleHidden ? ' visually-hidden' : '' ?>"><?= e($groupsTitle) ?></h2>
|
||||||
@@ -265,25 +310,7 @@ $soleNote = $single ? ($groups[0]['note'] ?? '') : '';
|
|||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="group-list group-list--grid">
|
<div class="group-list group-list--grid">
|
||||||
<?php foreach ($groups as $g): ?>
|
<?php foreach ($groups as $g): $renderSimpleCard($g); endforeach; ?>
|
||||||
<article class="group-card">
|
|
||||||
<div class="group-card__body">
|
|
||||||
<div class="group-card__header">
|
|
||||||
<h3 class="group-card__name"><?= e($g['name']) ?></h3>
|
|
||||||
<?php if (!empty($g['level'])): ?>
|
|
||||||
<p class="group-card__level"><?= e($g['level']) ?></p>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php if (!empty($g['sessions'])): ?>
|
|
||||||
<div class="group-card__schedule">
|
|
||||||
<ul class="schedule-list">
|
|
||||||
<?php foreach ($g['sessions'] as $s): $renderSession($s); endforeach; ?>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</article>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($footnote !== ''): ?>
|
<?php if ($footnote !== ''): ?>
|
||||||
|
|||||||
@@ -31,5 +31,6 @@ component('group-schedule', [
|
|||||||
'noticeTone' => $d['notice_tone'] ?? 'info',
|
'noticeTone' => $d['notice_tone'] ?? 'info',
|
||||||
'noticeIcon' => $d['notice_icon'] ?? 'info-circle',
|
'noticeIcon' => $d['notice_icon'] ?? 'info-circle',
|
||||||
'groups' => $d['groups'] ?? [],
|
'groups' => $d['groups'] ?? [],
|
||||||
|
'groupsInDash' => true,
|
||||||
'footnote' => $d['footnote'] ?? '',
|
'footnote' => $d['footnote'] ?? '',
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -2676,6 +2676,24 @@
|
|||||||
/* Nur die Position im Bento-Raster — Fläche, Farbe und Innenaufbau kommen von .notice. */
|
/* Nur die Position im Bento-Raster — Fläche, Farbe und Innenaufbau kommen von .notice. */
|
||||||
.turnen-dash__notice { grid-area: notice; }
|
.turnen-dash__notice { grid-area: notice; }
|
||||||
|
|
||||||
|
/* Schlichte Gruppen als volle Bodenreihe MIT im Dashboard ($groupsInDash, z. B. Trampolin):
|
||||||
|
ein zusammenhängender Block statt einer losgelösten Kartenreihe darunter. Selektor als
|
||||||
|
.turnen-dash.turnen-dash--groups (nicht nur .turnen-dash--groups), damit die Spezifität die
|
||||||
|
:not(--single)-Regeln oben trifft — gleiche Klassenzahl, gewinnt durch spätere Position. */
|
||||||
|
.turnen-dash.turnen-dash--groups {
|
||||||
|
grid-template-areas:
|
||||||
|
"venue venue lead"
|
||||||
|
"groups groups groups";
|
||||||
|
}
|
||||||
|
.turnen-dash.turnen-dash--notice.turnen-dash--groups {
|
||||||
|
grid-template-areas:
|
||||||
|
"notice notice notice"
|
||||||
|
"venue venue lead"
|
||||||
|
"groups groups groups";
|
||||||
|
}
|
||||||
|
/* Die Reihe spannt alle drei Spalten; das interne Kartenraster liefert .group-list--grid. */
|
||||||
|
.turnen-dash__groups { grid-area: groups; }
|
||||||
|
|
||||||
/* Trainingsort: Adresse links, Route-Button rechts (wie team-bento__venue). */
|
/* Trainingsort: Adresse links, Route-Button rechts (wie team-bento__venue). */
|
||||||
.turnen-dash__venue {
|
.turnen-dash__venue {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -2750,6 +2768,19 @@
|
|||||||
"lead"
|
"lead"
|
||||||
"venue";
|
"venue";
|
||||||
}
|
}
|
||||||
|
.turnen-dash.turnen-dash--groups {
|
||||||
|
grid-template-areas:
|
||||||
|
"venue"
|
||||||
|
"lead"
|
||||||
|
"groups";
|
||||||
|
}
|
||||||
|
.turnen-dash.turnen-dash--notice.turnen-dash--groups {
|
||||||
|
grid-template-areas:
|
||||||
|
"notice"
|
||||||
|
"venue"
|
||||||
|
"lead"
|
||||||
|
"groups";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* === notice === */
|
/* === notice === */
|
||||||
|
|||||||
Reference in New Issue
Block a user