From b13b21f30f2938c4fdbd77671a33c8e875819141 Mon Sep 17 00:00:00 2001 From: torsten Date: Sat, 21 Nov 2026 13:37:06 +0100 Subject: [PATCH] =?UTF-8?q?Touren-Detailansicht:=20einheitliches=20Karten-?= =?UTF-8?q?Layout,=20b=C3=BCndige=20Fakten,=20mobil=20optimiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- motorradig/public/css/custom.css | 428 ++++++++++++++++++ motorradig/src/Controllers/TourController.php | 33 +- motorradig/src/Models/TourRoom.php | 17 + .../views/tour/partials/detail_card.php | 124 +++++ motorradig/views/tour/show.php | 353 ++++++--------- motorradig/views/tour/show_old.php | 170 ++----- 6 files changed, 776 insertions(+), 349 deletions(-) create mode 100644 motorradig/views/tour/partials/detail_card.php diff --git a/motorradig/public/css/custom.css b/motorradig/public/css/custom.css index 8e9fa32..e492716 100644 --- a/motorradig/public/css/custom.css +++ b/motorradig/public/css/custom.css @@ -783,6 +783,434 @@ p { } } +/* Einzel-Tourenansicht: einheitliche Karten, bündige Faktenzeilen */ +.tour-detail { + max-width: 1180px; + margin-top: 1.5rem; + margin-bottom: 3rem; +} + +.tour-detail-card { + background: #f8fafc; + border: 1px solid #e2e8f0; + border-radius: 16px; + box-shadow: 0 18px 40px rgba(15, 23, 42, .16); + padding: 1.5rem 1.6rem; +} + +.tour-detail-head { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + justify-content: space-between; + gap: .75rem; + padding-bottom: 1rem; + margin-bottom: 1.25rem; + border-bottom: 1px solid #e2e8f0; +} + +.tour-detail-heading { + min-width: 0; +} + +.tour-detail-title { + margin: 0; + color: #0f172a; + font-size: 1.55rem; + font-weight: 700; + line-height: 1.25; + overflow-wrap: anywhere; +} + +.tour-detail-sub { + margin: .3rem 0 0; + color: #64748b; + font-size: .92rem; +} + +.tour-status { + display: inline-flex; + align-items: center; + padding: .3rem .75rem; + border-radius: 999px; + font-size: .75rem; + font-weight: 700; + letter-spacing: .04em; + text-transform: uppercase; + white-space: nowrap; +} + +.tour-status.is-scheduled { + background: rgba(21, 128, 61, .14); + color: #15803d; +} + +.tour-status.is-past { + background: rgba(100, 116, 139, .18); + color: #475569; +} + +.tour-status.is-cancelled { + background: rgba(229, 72, 77, .16); + color: #c13034; +} + +.tour-facts { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); + gap: .9rem 2rem; + margin: 0 0 1.5rem; +} + +.tour-fact { + display: grid; + grid-template-columns: 9.75rem minmax(0, 1fr); + align-items: baseline; + gap: .35rem; + padding-bottom: .5rem; + border-bottom: 1px dashed #e2e8f0; +} + +.tour-fact dt { + margin: 0; + color: #64748b; + font-size: .74rem; + font-weight: 700; + letter-spacing: .06em; + text-transform: uppercase; +} + +.tour-fact dd { + margin: 0; + color: #0f172a; + font-size: .95rem; + overflow-wrap: anywhere; +} + +.tour-fact-muted { + color: #94a3b8; +} + +.tour-fact-ok { + color: #15803d; + font-weight: 600; +} + +.tour-section { + margin-bottom: 1.5rem; +} + +.tour-section-title { + margin: 0 0 .5rem; + color: #0f172a; + font-size: 1.05rem; + font-weight: 700; +} + +.tour-description { + margin: 0; + color: #1e293b; + font-size: .97rem; + line-height: 1.6; + overflow-wrap: anywhere; +} + +.tour-actions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: .6rem; + margin-top: 1.5rem; + padding-top: 1.25rem; + border-top: 1px solid #e2e8f0; +} + +.tour-actions .btn { + min-width: 12rem; +} + +.tour-action-form { + margin: 0; +} + +/* Seitenspalte */ +.tour-side-card { + background: rgba(8, 13, 20, .62); + border: 1px solid rgba(255, 255, 255, .14); + border-radius: 14px; + padding: 1.1rem 1.15rem; + margin-bottom: 1rem; + color: #e6edf6; +} + +.tour-side-card .btn-block + .btn-block { + margin-top: .5rem; +} + +.tour-side-title { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: .5rem; + margin: 0 0 .75rem; + color: #fff; + font-size: 1rem; + font-weight: 700; +} + +.tour-side-count { + color: rgba(255, 255, 255, .7); + font-size: .8rem; + font-weight: 600; +} + +.tour-side-empty { + margin: 0; + color: rgba(255, 255, 255, .7); + font-size: .88rem; +} + +.tour-side-actions .btn { + font-size: .9rem; +} + +.tour-side-card .btn-primary { + background: #4ea1ff; + border-color: #4ea1ff; + color: #071a30; + font-weight: 600; +} + +.tour-side-card .btn-primary:hover, +.tour-side-card .btn-primary:focus { + background: #6cb4ff; + border-color: #6cb4ff; + color: #071a30; +} + +.tour-side-card .btn-outline-light { + border-color: rgba(255, 255, 255, .45); + color: #e6edf6; +} + +.tour-side-card .btn-outline-light:hover, +.tour-side-card .btn-outline-light:focus { + background: rgba(255, 255, 255, .14); + border-color: rgba(255, 255, 255, .65); + color: #fff; +} + +.tour-person-list, +.tour-room-list { + list-style: none; + margin: 0; + padding: 0; +} + +.tour-person { + display: flex; + align-items: center; + justify-content: space-between; + gap: .5rem; + padding: .35rem 0; + border-bottom: 1px solid rgba(255, 255, 255, .08); + font-size: .9rem; +} + +.tour-person:last-child { + border-bottom: 0; +} + +.tour-person-name i { + margin-right: .35rem; + color: #4ea1ff; +} + +.tour-person-remove { + border: 0; + background: transparent; + color: rgba(255, 255, 255, .55); + cursor: pointer; + padding: 0 .25rem; + line-height: 1; +} + +.tour-person-remove:hover, +.tour-person-remove:focus { + color: #e5484d; +} + +.tour-room-group { + margin-top: .75rem; + padding-top: .6rem; + border-top: 1px solid rgba(255, 255, 255, .1); +} + +.tour-room-group:first-of-type { + margin-top: 0; + padding-top: 0; + border-top: 0; +} + +.tour-room-title { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: .5rem; + margin: 0 0 .25rem; + color: #fff; + font-size: .88rem; + font-weight: 600; +} + +.tour-room-meta { + color: rgba(255, 255, 255, .65); + font-size: .78rem; + font-weight: 500; +} + +/* Bildergalerie der Detailansicht */ +.tour-detail-gallery { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); + gap: .6rem; +} + +.tour-detail-gallery a { + display: block; + border-radius: 10px; + overflow: hidden; + background: #e2e8f0; +} + +.tour-detail-gallery img { + display: block; + width: 100%; + height: 100%; + aspect-ratio: 4 / 3; + object-fit: cover; +} + +/* Zimmerwahl-Modal */ +.tour-modal-content { + max-width: 26rem; + border-radius: 14px; + padding: 1.5rem; +} + +.tour-modal-title { + margin: 0 0 .35rem; + font-size: 1.2rem; + font-weight: 700; + color: #0f172a; +} + +.tour-modal-hint { + margin: 0 0 1rem; + color: #64748b; + font-size: .9rem; +} + +.tour-modal-rooms { + display: grid; + gap: .6rem; +} + +.tour-modal-room { + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + align-items: center; + gap: .15rem .75rem; + padding: .65rem .8rem; + border: 1px solid #e2e8f0; + border-radius: 10px; + background: #fff; +} + +.tour-modal-room-name { + color: #0f172a; + font-weight: 600; + font-size: .95rem; +} + +.tour-modal-room-meta { + grid-column: 1; + color: #64748b; + font-size: .78rem; +} + +.tour-modal-room .btn { + grid-column: 2; + grid-row: 1 / span 2; +} + +@media (max-width: 991.98px) { + .tour-detail { + margin-top: 1rem; + } + + .tour-detail aside { + margin-top: 1rem; + } + + .tour-side-card { + margin-top: .25rem; + } +} + +@media (max-width: 767.98px) { + .tour-detail-card { + padding: 1.1rem 1rem; + border-radius: 12px; + } + + .tour-detail-title { + font-size: 1.25rem; + } + + .tour-facts { + grid-template-columns: 1fr; + gap: .5rem; + } + + .tour-fact { + grid-template-columns: 1fr; + gap: .1rem; + padding-bottom: .45rem; + } + + .tour-fact dt { + font-size: .7rem; + } + + .tour-actions { + flex-direction: column; + align-items: stretch; + } + + .tour-actions .btn, + .tour-actions .tour-action-form, + .tour-actions .tour-action-form .btn { + width: 100%; + min-width: 0; + } +} + +@media (max-width: 575.98px) { + .tour-detail { + margin-top: .5rem; + margin-bottom: 2rem; + } + + .tour-detail-gallery { + grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); + } + + .tour-modal-content { + padding: 1.15rem; + } +} + /* Jahreskalender: Touren farblich markiert */ .tour-calendar-head { display: flex; diff --git a/motorradig/src/Controllers/TourController.php b/motorradig/src/Controllers/TourController.php index 8c8ac7b..4f3133b 100644 --- a/motorradig/src/Controllers/TourController.php +++ b/motorradig/src/Controllers/TourController.php @@ -431,6 +431,7 @@ class TourController $tourDays = $tour->durationDays(); $tourEnd = $tour->endDate(); + $tourPeriod = $tour->periodLabel(); // Vergangene Tour if ($tourEnd !== null && $tourEnd < today()) { @@ -441,12 +442,15 @@ class TourController view('tour.show_old', [ 'tour' => $tour, 'days' => $tourDays, - 'users' => $users, - 'guide' => $guide, - 'tourImages' => $tourImages, - 'canManage' => $canManage, - 'canChat' => $canChat, - 'chatUnread' => $chatUnread, + 'period' => $tourPeriod, + 'users' => $users, + 'current' => $current, + 'guide' => $guide, + 'tourImages' => $tourImages, + 'canManage' => $canManage, + 'canChat' => $canChat, + 'chatUnread' => $chatUnread, + 'roomOptions' => TourRoom::forTour((int) $tour->id), ]); return; @@ -461,13 +465,16 @@ class TourController view('tour.show', [ 'tour' => $tour, 'days' => $tourDays, - 'users' => $users, - 'guide' => $guide, - 'tourImages' => $tourImages, - 'rooms' => $rooms, - 'canManage' => $canManage, - 'canChat' => $canChat, - 'chatUnread' => $chatUnread, + 'period' => $tourPeriod, + 'users' => $users, + 'current' => $current, + 'guide' => $guide, + 'tourImages' => $tourImages, + 'rooms' => $rooms, + 'roomOptions' => TourRoom::forTour((int) $tour->id), + 'canManage' => $canManage, + 'canChat' => $canChat, + 'chatUnread' => $chatUnread, ]); } diff --git a/motorradig/src/Models/TourRoom.php b/motorradig/src/Models/TourRoom.php index 4bfb7fb..c8691d2 100644 --- a/motorradig/src/Models/TourRoom.php +++ b/motorradig/src/Models/TourRoom.php @@ -28,6 +28,23 @@ class TourRoom extends Model return $row !== null && (int) $row['booked'] < (int) $row['capacity']; } + /** Alle Zimmer einer Tour (auch ohne Buchungen), inkl. freier Plätze. */ + public static function forTour(int $tourId): array + { + if ($tourId <= 0) { + return []; + } + + return db()->fetchAll( + 'SELECT tr.id, tr.name, tr.capacity, + (SELECT COUNT(*) FROM `bookings` b WHERE b.tour_id = tr.tour_id AND b.room_id = tr.id) AS booked + FROM `tour_rooms` tr + WHERE tr.tour_id = ? + ORDER BY tr.id', + [$tourId] + ); + } + public static function findForTour(int $roomId, int $tourId): ?array { if ($roomId <= 0 || $tourId <= 0) { diff --git a/motorradig/views/tour/partials/detail_card.php b/motorradig/views/tour/partials/detail_card.php new file mode 100644 index 0000000..98ca54f --- /dev/null +++ b/motorradig/views/tour/partials/detail_card.php @@ -0,0 +1,124 @@ +start); +$isPastTour = !empty($isPast); +$isCancelledTour = (bool) $tour->is_cancelled; +$statusClass = $isCancelledTour ? 'is-cancelled' : ($isPastTour ? 'is-past' : 'is-scheduled'); +$statusLabel = $isCancelledTour ? 'Abgesagt' : ($isPastTour ? 'Vorbei' : 'Findet statt'); +$takesPart = $current !== null && \App\Models\Tour::hasParticipant((int) $tour->id, (int) $current->id); +?> +
+
+
+

name) ?>

+

+ + · + Tag +

+
+ + +
+ +
+
+
Start
+
start) ?>
+
+ +
+
Ende
+
+ end_date)): ?> + end_date) ?> + + eintägig + +
+
+ +
+
Tour Guide
+
name : 'unbekannt') ?>
+
+ +
+
Anmeldeschluss
+
deadline) ?>
+
+ +
+
Max. Teilnehmer
+
max_participants ?>
+
+ +
+
Deine Teilnahme
+
+ + – + + Du fährst mit + + noch nicht angemeldet + +
+
+
+ +
+

Beschreibung

+

beschreibung), false) ?>

+
+ + +
+

Bericht

+

+
+ + + +
+

Bilder

+ +
+ + +
+ + + + + +
+ + +
+ + + + Zur Tourübersicht + +
+
diff --git a/motorradig/views/tour/show.php b/motorradig/views/tour/show.php index bf5dd28..ef64aad 100644 --- a/motorradig/views/tour/show.php +++ b/motorradig/views/tour/show.php @@ -1,238 +1,161 @@ is_cancelled + && !\App\Models\Tour::hasParticipant((int) $tour->id, (int) $current->id) + && \App\Models\Tour::hasSpace((int) $tour->id); - $current = auth_check() ? user() : null; - - $groups = []; - foreach ($rooms as $room) { - $roomId = (int) ($room->room_id ?? 0); - $key = $roomId > 0 ? (string) $roomId : 'ungebucht'; - if (!isset($groups[$key])) { - $groups[$key] = [ - 'name' => $room->room_name, - 'id' => $room->room_id, - 'free_slots' => $room->free_slots, - 'users' => [], - ]; - } - $groups[$key]['users'][] = $room; - } +$showJoinButton = $canJoin; +$showGallery = true; +$isPast = false; ?> - -
-
-
-
-
name) ?>
- -
-
- - -
- - -
- -
- - -
- -
- - - - Tag - -
- -
- - -
- -
- - -
- -
- - -
- - id, (int) $current->id)): ?> - - - - - - - - - - - -
- - is_cancelled ? 'checked' : '' ?> onclick="return false;"> -
- -
- -
- - - -
Bearbeiten
-
- - Ok - - id, (int) $current->id) && Tour::hasSpace((int) $tour->id)): ?> - - -
- - - -
-
+
+
+
+
-
- -
- -
- +
+ + + + diff --git a/motorradig/views/tour/show_old.php b/motorradig/views/tour/show_old.php index 8104711..6cd797f 100644 --- a/motorradig/views/tour/show_old.php +++ b/motorradig/views/tour/show_old.php @@ -1,131 +1,59 @@ bericht ?? ''); ?> - -
-
-
-
-
name) ?>
- -
-
- - -
- - -
- -
- - - end_date)): ?> - - bis end_date) ?> ( Tage) - - -
- -
- - -
- -
- - -
- - id, (int) $current->id)): ?> - - - - - - - - - - - -
- - -
- -
- - -
- - -
Bearbeiten
- - Ok -
-
-
+
+
+
+
-
- -
- -
- +
+ + + +
+

Tour-Chat

+ + Chat-Archiv ansehen + +
+ + +
+

Organisation

+ +
+ +