Tourenplan: gemeinsames Listen-Partial, neuer Seitenkopf und Jahres-Pillen

This commit is contained in:
torsten 2026-11-22 10:22:42 +01:00
parent 74925aa513
commit 3e8c5322bc
4 changed files with 401 additions and 110 deletions

View file

@ -644,14 +644,14 @@ p {
border-color: #1d5bc4;
}
/* Alte Touren: Jahres-Pillen und Gruppierung */
/* Tourenplan: Seitenkopf, Jahres-Pillen und Gruppierung */
.tour-years {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: .5rem;
max-width: 760px;
margin: 1.25rem auto 2rem;
max-width: 860px;
margin: .5rem auto 1.75rem;
}
.tour-year-pill {
@ -687,16 +687,132 @@ p {
box-shadow: 0 8px 20px rgba(78, 161, 255, .35);
}
.tour-years-empty {
margin-top: 2rem;
.tour-page {
max-width: 960px;
margin-top: 1.5rem;
margin-bottom: 3rem;
color: #e2e8f0;
}
.tour-page-head {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
justify-content: space-between;
gap: 1rem 1.5rem;
margin-bottom: 1.5rem;
padding-bottom: 1.25rem;
border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.tour-page-heading {
min-width: 0;
}
.tour-page-kicker {
margin: 0 0 .35rem;
color: #7fb2ff;
font-size: .72rem;
font-weight: 700;
letter-spacing: .16em;
text-transform: uppercase;
}
.tour-page-title {
margin: 0;
color: #f8fafc;
font-size: 1.85rem;
font-weight: 800;
letter-spacing: -.01em;
}
.tour-page-lead {
margin: .4rem 0 0;
color: #9fb3cd;
font-size: .95rem;
}
.tour-page-actions {
display: flex;
flex-wrap: wrap;
gap: .5rem;
}
.tour-page-actions .btn {
display: inline-flex;
align-items: center;
gap: .45rem;
padding: .48rem .95rem;
border-radius: 999px;
font-size: .86rem;
font-weight: 600;
line-height: 1.35;
}
.tour-page-actions .btn i {
font-size: .9em;
}
.tour-page-actions .btn-outline-light {
border-color: rgba(255, 255, 255, .45);
color: #e6edf6;
}
.tour-page-actions .btn-outline-light:hover,
.tour-page-actions .btn-outline-light:focus {
background: rgba(255, 255, 255, .14);
border-color: rgba(255, 255, 255, .65);
color: #fff;
}
.tour-page-actions .btn-primary {
background: #4ea1ff;
border-color: #4ea1ff;
color: #071a30;
}
.tour-page-actions .btn-primary:hover,
.tour-page-actions .btn-primary:focus {
background: #6cb4ff;
border-color: #6cb4ff;
color: #071a30;
}
.tour-alert {
border-radius: 12px;
font-size: .9rem;
}
.tour-empty {
margin-top: 1.5rem;
padding: 2.25rem 1.25rem;
border: 1px dashed rgba(255, 255, 255, .18);
border-radius: 16px;
background: rgba(13, 17, 23, .55);
color: #9fb3cd;
text-align: center;
}
.tour-empty i {
display: block;
margin-bottom: .6rem;
font-size: 1.6rem;
color: #4ea1ff;
}
.tour-empty p {
margin: 0;
}
.tour-year-group {
max-width: 760px;
max-width: 860px;
margin: 0 auto 2rem;
}
.tour-year-heading {
display: flex;
align-items: baseline;
gap: .55rem;
margin: 0 0 .85rem;
color: #fff;
font-size: 1.35rem;
@ -704,83 +820,199 @@ p {
letter-spacing: .02em;
}
.tour-year-count {
color: #9fb3cd;
font-size: .82rem;
font-weight: 600;
letter-spacing: .01em;
}
.tour-list {
display: grid;
gap: .6rem;
margin: 0;
padding: 0;
list-style: none;
text-align: left;
}
.tour-list-item {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: .65rem 1rem;
background: rgba(13, 17, 23, .72);
border-color: rgba(255, 255, 255, .14);
color: #fff;
gap: 1rem;
padding: .95rem 1.15rem;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 14px;
color: #0f172a;
box-shadow: 0 8px 20px rgba(3, 10, 24, .16);
transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tour-list-item:hover,
.tour-list-item:focus-within {
transform: translateY(-2px);
border-color: #4ea1ff;
box-shadow: 0 14px 30px rgba(3, 10, 24, .26);
}
.tour-list-item:focus-within {
outline: 2px solid #4ea1ff;
outline-offset: 2px;
}
.tour-list-item.is-cancelled {
background: #fdf3f3;
border-color: #f1c9cc;
}
.tour-list-link {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: .35rem .6rem;
color: #fff;
position: absolute;
inset: 0;
z-index: 1;
border-radius: 14px;
color: inherit;
text-decoration: none;
}
.tour-list-link:hover,
.tour-list-link:focus {
color: #9cc9ff;
text-decoration: none;
outline: none;
}
.tour-list-body {
display: grid;
gap: .18rem;
min-width: 0;
}
.tour-list-period {
color: #2563eb;
font-size: .78rem;
font-weight: 700;
letter-spacing: .04em;
text-transform: uppercase;
font-variant-numeric: tabular-nums;
}
.tour-list-title {
font-weight: 600;
color: #0f172a;
font-size: 1.02rem;
font-weight: 700;
line-height: 1.3;
}
.tour-list-item:hover .tour-list-title {
color: #1d4ed8;
}
.tour-list-meta {
color: rgba(255, 255, 255, .72);
display: flex;
flex-wrap: wrap;
gap: .15rem 1rem;
margin-top: .1rem;
color: #64748b;
font-size: .82rem;
font-variant-numeric: tabular-nums;
}
.tour-meta-item {
display: inline-flex;
align-items: center;
gap: .35rem;
}
.tour-meta-item i {
color: #94a3b8;
font-size: .85em;
}
.tour-meta-link {
position: relative;
z-index: 2;
color: #2563eb;
font-weight: 600;
text-decoration: none;
}
.tour-meta-link:hover,
.tour-meta-link:focus {
color: #1d4ed8;
text-decoration: underline;
}
.tour-meta-item.is-joined {
color: #15803d;
font-weight: 600;
}
.tour-meta-item.is-joined i {
color: #15803d;
}
.tour-list-actions {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: .7rem;
}
.tour-gallery-link {
color: #9cc9ff;
text-decoration: none;
}
.tour-gallery-link:hover,
.tour-gallery-link:focus {
color: #fff;
text-decoration: underline;
}
.tour-list-actions .badge {
gap: .75rem;
flex-shrink: 0;
}
.tour-list-chevron {
color: #94a3b8;
font-size: .8rem;
transition: transform .15s ease, color .15s ease;
}
.tour-list-item:hover .tour-list-chevron {
color: #2563eb;
transform: translateX(2px);
}
@media (max-width: 575.98px) {
.tour-year-pill {
min-width: 3.7rem;
padding: .4rem .9rem;
}
.tour-page-head {
align-items: flex-start;
}
.tour-page-title {
font-size: 1.55rem;
}
.tour-list-item {
align-items: flex-start;
padding: .85rem .9rem;
}
.tour-list-title {
font-size: .97rem;
}
.tour-list-actions {
flex-direction: column;
align-items: flex-end;
gap: .5rem;
}
.tour-list-chevron {
display: none;
}
}
@media (prefers-reduced-motion: reduce) {
.tour-year-pill {
.tour-year-pill,
.tour-list-item,
.tour-list-chevron {
transition: none;
}
.tour-list-item:hover {
transform: none;
}
}
/* Einzel-Tourenansicht: einheitliche Karten, bündige Faktenzeilen */

View file

@ -1,6 +1,4 @@
<?php
use App\Models\Tour;
$current = auth_check() ? user() : null;
$selectedYear = $selectedYear ?? null;
$years = $years ?? [];
@ -10,24 +8,45 @@
$flashError = flash_pull('error');
?>
<div class="container text-center text-light mt-5">
<h1 class="text-center">Tourenplan: aktuelle Touren</h1>
<div class="container tour-page">
<header class="tour-page-head">
<div class="tour-page-heading">
<p class="tour-page-kicker">Tourenplan</p>
<h1 class="tour-page-title">Aktuelle Touren</h1>
<p class="tour-page-lead">Termine, freie Plätze und Anmeldung auf einen Blick.</p>
</div>
<nav class="tour-page-actions" aria-label="Touren-Aktionen">
<a class="btn btn-outline-light" href="/tour/index_old">
<i class="fas fa-history" aria-hidden="true"></i>Abgeschlossene Touren
</a>
<a class="btn btn-outline-light" href="/tour/kalender">
<i class="fas fa-calendar-alt" aria-hidden="true"></i>Jahreskalender
</a>
<a class="btn btn-outline-light" href="/img_storage/pdf/Tourenplan.pdf">
<i class="fas fa-file-pdf" aria-hidden="true"></i>Tourenplan (PDF)
</a>
<?php if ($current !== null && $current->canCreateTours()): ?>
<a class="btn btn-primary" href="/tour/create">
<i class="fas fa-plus" aria-hidden="true"></i>Neue Tour
</a>
<?php endif; ?>
</nav>
</header>
<?php if ($flashStatus !== null): ?>
<div class="alert alert-success" role="alert"><?= e($flashStatus) ?></div>
<div class="alert alert-success tour-alert" role="alert"><?= e($flashStatus) ?></div>
<?php endif; ?>
<?php if ($flashError !== null): ?>
<div class="alert alert-danger" role="alert"><?= e($flashError) ?></div>
<div class="alert alert-danger tour-alert" role="alert"><?= e($flashError) ?></div>
<?php endif; ?>
<div class="container text-primary mb-3">
<span class="offset-1 col-4 float-left mb-3"><a class="btn btn-success" href="/tour/index_old" class="text-center text-light"><h3>Abgeschlossene Touren</h3></a></span>
<span class="offset-1"><a href="/img_storage/pdf/Tourenplan.pdf" class="btn btn-success"><h3>Download</h3></a></span>
</div>
<?php if ($years === []): ?>
<p class="tour-years-empty">Es sind aktuell keine Touren geplant.</p>
<div class="tour-empty">
<i class="fas fa-route" aria-hidden="true"></i>
<p>Es sind aktuell keine Touren geplant.</p>
</div>
<?php else: ?>
<nav class="tour-years" aria-label="Aktuelle Touren nach Jahr">
<a class="tour-year-pill<?= $selectedYear === null ? ' is-active' : '' ?>"
@ -41,39 +60,18 @@
</nav>
<?php foreach ($visibleYears as $year): ?>
<?php $yearLabel = ((int) $year === 0) ? 'Ohne Datum' : (string) $year; ?>
<?php
$yearLabel = ((int) $year === 0) ? 'Ohne Datum' : (string) $year;
$tours = $toursByYear[$year] ?? [];
?>
<section class="tour-year-group" aria-labelledby="tour-year-<?= e($year) ?>">
<h2 class="tour-year-heading" id="tour-year-<?= e($year) ?>"><?= e($yearLabel) ?></h2>
<h2 class="tour-year-heading" id="tour-year-<?= e($year) ?>">
<span><?= e($yearLabel) ?></span>
<span class="tour-year-count"><?= count($tours) ?> <?= count($tours) === 1 ? 'Tour' : 'Touren' ?></span>
</h2>
<ul class="list-group tour-list">
<?php foreach ($toursByYear[$year] ?? [] as $tour): ?>
<li class="list-group-item tour-list-item">
<a class="tour-list-link" href="/tour/<?= e($tour->id) ?>">
<span class="tour-list-title"><?= e($tour->periodLabel()) ?> - <?= e($tour->name) ?></span>
<span class="tour-list-meta">[<?= e($participantCount[$tour->id] ?? 0) ?>/<?= e($tour->max_participants) ?>]</span>
</a>
<span class="tour-list-actions">
<?php if ($current && Tour::hasParticipant((int) $tour->id, (int) $current->id)): ?>
<i class="fas fa-biking" title="Du hast teilgenommen" aria-label="Du hast teilgenommen"></i>
<?php endif; ?>
<span class="badge <?= $tour->is_cancelled ? 'badge-danger' : 'badge-success' ?> badge-pill"><?= $tour->is_cancelled ? 'STORNIERT' : 'FINDET STATT' ?></span>
</span>
</li>
<?php endforeach; ?>
</ul>
<?php require __DIR__ . '/partials/list.php'; ?>
</section>
<?php endforeach; ?>
<?php endif; ?>
<div class="container text-primary">
<a href="/tour/kalender" class="btn btn-success col-3 mt-2"><h3>Jahreskalender</h3></a>
</div>
<?php if ($current && $current->canCreateTours()): ?>
<div class="container text-primary">
<a href="/tour/create" class="btn btn-danger col-3 mt-2 "><h3>Neue Tour anlegen</h3></a>
</div>
<?php endif; ?>
</div>

View file

@ -1,6 +1,4 @@
<?php
use App\Models\Tour;
$current = auth_check() ? user() : null;
$selectedYear = $selectedYear ?? null;
$years = $years ?? [];
@ -8,15 +6,29 @@
$visibleYears = $visibleYears ?? ($selectedYear === null ? $years : [$selectedYear]);
?>
<div class="container text-center text-light mt-5">
<h1 class="text-center">Tourenplan: alte Touren</h1>
<div class="container tour-page">
<header class="tour-page-head">
<div class="tour-page-heading">
<p class="tour-page-kicker">Tourenplan</p>
<h1 class="tour-page-title">Abgeschlossene Touren</h1>
<p class="tour-page-lead">Rückblick auf alle gefahrenen Touren mit Bildern und Teilnehmern.</p>
</div>
<div class="container text-primary mb-3">
<span class="offset-1 col-4 float-left mb-3"><a class="btn btn-success" href="/tour" class="text-center text-light"><h3>Aktuelle Touren</h3></a></span>
</div>
<nav class="tour-page-actions" aria-label="Touren-Aktionen">
<a class="btn btn-outline-light" href="/tour">
<i class="fas fa-route" aria-hidden="true"></i>Aktuelle Touren
</a>
<a class="btn btn-outline-light" href="/tour/kalender">
<i class="fas fa-calendar-alt" aria-hidden="true"></i>Jahreskalender
</a>
</nav>
</header>
<?php if ($years === []): ?>
<p class="tour-years-empty">Es sind noch keine abgeschlossenen Touren vorhanden.</p>
<div class="tour-empty">
<i class="fas fa-history" aria-hidden="true"></i>
<p>Es sind noch keine abgeschlossenen Touren vorhanden.</p>
</div>
<?php else: ?>
<nav class="tour-years" aria-label="Alte Touren nach Jahr">
<a class="tour-year-pill<?= $selectedYear === null ? ' is-active' : '' ?>"
@ -30,30 +42,18 @@
</nav>
<?php foreach ($visibleYears as $year): ?>
<?php $yearLabel = ((int) $year === 0) ? 'Ohne Datum' : (string) $year; ?>
<?php
$yearLabel = ((int) $year === 0) ? 'Ohne Datum' : (string) $year;
$tours = $toursByYear[$year] ?? [];
$isPastList = true;
?>
<section class="tour-year-group" aria-labelledby="tour-year-<?= e($year) ?>">
<h2 class="tour-year-heading" id="tour-year-<?= e($year) ?>"><?= e($yearLabel) ?></h2>
<h2 class="tour-year-heading" id="tour-year-<?= e($year) ?>">
<span><?= e($yearLabel) ?></span>
<span class="tour-year-count"><?= count($tours) ?> <?= count($tours) === 1 ? 'Tour' : 'Touren' ?></span>
</h2>
<ul class="list-group tour-list">
<?php foreach ($toursByYear[$year] ?? [] as $tour): ?>
<li class="list-group-item tour-list-item">
<a class="tour-list-link" href="/tour/<?= e($tour->id) ?>">
<span class="tour-list-title"><?= e($tour->periodLabel()) ?> - <?= e($tour->name) ?></span>
<span class="tour-list-meta">[<?= e($participantCount[$tour->id] ?? 0) ?>/<?= e($tour->max_participants) ?>]</span>
</a>
<span class="tour-list-actions">
<a class="tour-gallery-link" href="/tour/gallery/<?= e($tour->id) ?>">( <?= e($imagecountPerTour[$tour->id] ?? 0) ?> Bilder)</a>
<?php if ($current && Tour::hasParticipant((int) $tour->id, (int) $current->id)): ?>
<i class="fas fa-biking" title="Du hast teilgenommen" aria-label="Du hast teilgenommen"></i>
<?php endif; ?>
<span class="badge <?= $tour->is_cancelled ? 'badge-danger' : 'badge-success' ?> badge-pill"><?= $tour->is_cancelled ? 'STORNIERT' : 'FINDET STATT' ?></span>
</span>
</li>
<?php endforeach; ?>
</ul>
<?php require __DIR__ . '/partials/list.php'; ?>
</section>
<?php endforeach; ?>
<?php endif; ?>

View file

@ -0,0 +1,61 @@
<?php
/**
* Gemeinsame Tourenliste für aktuelle und abgeschlossene Touren.
*
* Erwartet: $tours, $participantCount, $current
* Optional: $imagecountPerTour (Array tourId => Anzahl), $isPastList (bool)
*/
use App\Models\Tour;
$participantCount = $participantCount ?? [];
$current = $current ?? null;
$imagecountPerTour = $imagecountPerTour ?? null;
$isPastList = !empty($isPastList);
?>
<ul class="tour-list">
<?php foreach ($tours as $tour): ?>
<?php
$tourId = (int) $tour->id;
$joined = $current !== null && Tour::hasParticipant($tourId, (int) $current->id);
$statusClass = $tour->is_cancelled ? 'is-cancelled' : ($isPastList ? 'is-past' : 'is-scheduled');
$statusLabel = $tour->is_cancelled ? 'Abgesagt' : ($isPastList ? 'Vorbei' : 'Findet statt');
$imageCount = $imagecountPerTour !== null ? (int) ($imagecountPerTour[$tourId] ?? 0) : null;
$period = $tour->periodLabel();
$taken = (int) ($participantCount[$tourId] ?? 0);
$seats = (int) $tour->max_participants;
$takenLabel = $seats > 0 ? $taken . ' / ' . $seats . ' Plätze' : $taken . ' Teilnehmer';
?>
<li class="tour-list-item<?= $tour->is_cancelled ? ' is-cancelled' : '' ?>">
<a class="tour-list-link" href="/tour/<?= e($tourId) ?>">
<span class="sr-only"><?= e($period) ?>: <?= e($tour->name) ?> öffnen</span>
</a>
<span class="tour-list-body">
<span class="tour-list-period"><?= e($period) ?></span>
<span class="tour-list-title"><?= e($tour->name) ?></span>
<span class="tour-list-meta">
<span class="tour-meta-item">
<i class="fas fa-users" aria-hidden="true"></i>
<?= e($takenLabel) ?>
</span>
<?php if ($imageCount !== null): ?>
<a class="tour-meta-item tour-meta-link" href="/tour/gallery/<?= e($tourId) ?>">
<i class="fas fa-images" aria-hidden="true"></i>
<?= e($imageCount) ?> Bilder
</a>
<?php endif; ?>
<?php if ($joined): ?>
<span class="tour-meta-item is-joined">
<i class="fas fa-biking" aria-hidden="true"></i>Du bist dabei
</span>
<?php endif; ?>
</span>
</span>
<span class="tour-list-actions">
<span class="tour-status <?= $statusClass ?>"><?= e($statusLabel) ?></span>
<i class="fas fa-chevron-right tour-list-chevron" aria-hidden="true"></i>
</span>
</li>
<?php endforeach; ?>
</ul>