feat: keep travel info visible event without date

This commit is contained in:
Björn Fromme
2024-12-04 12:19:48 +01:00
parent fd73cd412c
commit f473d7df33
2 changed files with 43 additions and 46 deletions
@@ -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);
@@ -44,9 +44,11 @@
{travelinfo.headline}
</h1>
{travelinfo.introText -> f:format.html()}
<p>
{date.product.name} {date.dateStart -> f:format.date(format: 'd.m.Y')} - {date.dateEnd -> f:format.date(format: 'd.m.Y')}
</p>
<f:if condition="{date}">
<p>
{date.product.name} {date.dateStart -> f:format.date(format: 'd.m.Y')} - {date.dateEnd -> f:format.date(format: 'd.m.Y')}
</p>
</f:if>
</div>
</div>
<div class="container -mt-24 mb-16">
@@ -60,38 +62,40 @@
</div>
</div>
<div class="lg:w-3/4 pt-8 lg:pt-0 lg:px-8 text-white" data-rte-content>
<f:if condition="{travelinfo.hideAddress}">
<f:else>
<h3 class="text-white">
Adresse
</h3>
<p>
{date.hotel.name}
<br>
{date.hotel.address -> f:format.nl2br()}
</p>
</f:else>
</f:if>
<f:if condition="{date.pickups -> f:count()} > 0">
<f:if condition="{date.pickups -> f:count()} <= 3">
<f:then>
<f:render section="Pickups" arguments="{_all}"/>
</f:then>
<f:if condition="{date}">
<f:if condition="{travelinfo.hideAddress}">
<f:else>
<div data-controller="autocollapse" data-autocollapse-height-value="400" data-autocollapse-offset-value="64" class="pb-4">
<div class="relative pb-12" data-autocollapse-target="container">
<f:render section="Pickups" arguments="{_all}"/>
<div class="absolute left-0 bottom-0 w-full h-12 bg-white flex items-center">
<button type="button"
data-autocollapse-target="button"
data-action="autocollapse#toggle"
class="hidden text-ep-primary w-10 h-10 ml-2 group toggle-more">
<f:render section="Icon" arguments="{icon: 'toggle'}" />
</button>
<h3 class="text-white">
Adresse
</h3>
<p>
{date.hotel.name}
<br>
{date.hotel.address -> f:format.nl2br()}
</p>
</f:else>
</f:if>
<f:if condition="{date.pickups -> f:count()} > 0">
<f:if condition="{date.pickups -> f:count()} <= 3">
<f:then>
<f:render section="Pickups" arguments="{_all}"/>
</f:then>
<f:else>
<div data-controller="autocollapse" data-autocollapse-height-value="400" data-autocollapse-offset-value="64" class="pb-4">
<div class="relative pb-12" data-autocollapse-target="container">
<f:render section="Pickups" arguments="{_all}"/>
<div class="absolute left-0 bottom-0 w-full h-12 bg-white flex items-center">
<button type="button"
data-autocollapse-target="button"
data-action="autocollapse#toggle"
class="hidden text-ep-primary w-10 h-10 ml-2 group toggle-more">
<f:render section="Icon" arguments="{icon: 'toggle'}" />
</button>
</div>
</div>
</div>
</div>
</f:else>
</f:else>
</f:if>
</f:if>
</f:if>
<f:if condition="{travelinfo.selfArrangedText}">
@@ -196,10 +200,12 @@
<h2 class="headline--primary">
{teaser.title}
</h2>
<f:if condition="{teaser.category} == food">
<p>
{date.board}
</p>
<f:if condition="{date}">
<f:if condition="{teaser.category} == food">
<p>
{date.board}
</p>
</f:if>
</f:if>
{teaser.bodytext -> f:format.html()}
</div>