From f473d7df3380050980fffa4ba8ca79b33d047d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 4 Dec 2024 12:19:48 +0100 Subject: [PATCH] feat: keep travel info visible event without date --- .../Controller/TravelinfoController.php | 11 +-- .../Private/Templates/Travelinfo/Index.html | 78 ++++++++++--------- 2 files changed, 43 insertions(+), 46 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/TravelinfoController.php b/public/typo3conf/ext/ep_products/Classes/Controller/TravelinfoController.php index 8f03cdf6..1367dc85 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/TravelinfoController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/TravelinfoController.php @@ -61,16 +61,7 @@ class TravelinfoController extends ActionController /** @var Date $date */ $date = $this->dateRepository->findForProductAndDate($product, $travelDate)->getFirst(); - - if (null === $date) { - $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction( - $GLOBALS['TYPO3_REQUEST'], - 'Reiseinformationen nicht gefunden' - ); - throw new ImmediateResponseException($response, 1731071856); - } - - $hasCourses = 0 < count($date->getServicesGeneral('KUR')); + $hasCourses = null !== $date && 0 < count($date->getServicesGeneral('KUR')); $this->view->assign('travelinfo', $travelinfo); $this->view->assign('date', $date); diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html index 39011450..3067f835 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html @@ -44,9 +44,11 @@ {travelinfo.headline} {travelinfo.introText -> f:format.html()} -

- {date.product.name} {date.dateStart -> f:format.date(format: 'd.m.Y')} - {date.dateEnd -> f:format.date(format: 'd.m.Y')} -

+ +

+ {date.product.name} {date.dateStart -> f:format.date(format: 'd.m.Y')} - {date.dateEnd -> f:format.date(format: 'd.m.Y')} +

+
@@ -60,38 +62,40 @@
- - -

- Adresse -

-

- {date.hotel.name} -
- {date.hotel.address -> f:format.nl2br()} -

-
-
- - - - - + + -
-
- -
- +

+ Adresse +

+

+ {date.hotel.name} +
+ {date.hotel.address -> f:format.nl2br()} +

+ + + + + + + + +
+
+ +
+ +
-
- + + @@ -196,10 +200,12 @@

{teaser.title}

- -

- {date.board} -

+ + +

+ {date.board} +

+
{teaser.bodytext -> f:format.html()}