feat: offered courses in travelinfo
This commit is contained in:
@@ -65,10 +65,8 @@ class TravelinfoController extends ActionController
|
||||
|
||||
/** @var Date $date */
|
||||
$date = $this->dateRepository->findForProductAndDate($product, $travelDate)->getFirst();
|
||||
$hasCourses = null !== $date && 0 < count($date->getServicesGeneral('KUR'));
|
||||
|
||||
$this->view->assign('travelinfo', $travelinfo);
|
||||
$this->view->assign('date', $date);
|
||||
$this->view->assign('hasCourses', $hasCourses);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -496,6 +496,11 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
$this->coursesIncluded = $coursesIncluded;
|
||||
}
|
||||
|
||||
public function getActiveCoursesForTravelinfo()
|
||||
{
|
||||
return $this->getServicesGeneral('KUR');
|
||||
}
|
||||
|
||||
public function getGuide()
|
||||
{
|
||||
return unserialize($this->guide);
|
||||
|
||||
@@ -117,16 +117,7 @@
|
||||
</div>
|
||||
<div class="container px-4 lg:px-24 flex flex-col space-y-16 pb-16">
|
||||
<f:for each="{travelinfo.teasers}" as="teaser">
|
||||
<f:if condition="{teaser.category} == 'course'">
|
||||
<f:then>
|
||||
<f:if condition="{hasCourses}">
|
||||
<f:render section="Teaser" arguments="{_all}"/>
|
||||
</f:if>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:render section="Teaser" arguments="{_all}"/>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:render section="Teaser" arguments="{_all}"/>
|
||||
</f:for>
|
||||
</div>
|
||||
<div id="goodtoknow" class="bg-ep-primary-bg">
|
||||
@@ -208,11 +199,32 @@
|
||||
{teaser.title}
|
||||
</h2>
|
||||
<f:if condition="{date}">
|
||||
<f:if condition="{teaser.category} == food">
|
||||
<f:if condition="{teaser.category} == 'food'">
|
||||
<p>
|
||||
{date.board}
|
||||
</p>
|
||||
</f:if>
|
||||
<f:if condition="{teaser.category} == 'course'">
|
||||
<f:if condition="{date.activeCoursesForTravelinfo -> f:count()} > 0">
|
||||
<f:then>
|
||||
<p>
|
||||
<strong>Es finden folgende Kurse statt:</strong>
|
||||
</p>
|
||||
<ul>
|
||||
<f:for as="course" each="{date.activeCoursesForTravelinfo}">
|
||||
<li>
|
||||
{course.label}
|
||||
</li>
|
||||
</f:for>
|
||||
</ul>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<p>
|
||||
Es finden keine Kurse über E&P Reisen statt.
|
||||
</p>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:if>
|
||||
</f:if>
|
||||
{teaser.bodytext -> f:format.html()}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user