Adapt search result and product teasers to daytrips

This commit is contained in:
Björn Fromme
2018-10-02 12:06:46 +02:00
parent fa3779b40a
commit a550e97f75
12 changed files with 77 additions and 136 deletions
@@ -40,6 +40,7 @@ class NightsOptionsViewHelper extends AbstractViewHelper
parent::initializeArguments();
$this->registerArgument('options', 'array', 'The options');
$this->registerArgument('daytrip', 'bool', 'Is daytrip or not', false, false);
}
/**
@@ -54,6 +55,9 @@ class NightsOptionsViewHelper extends AbstractViewHelper
RenderingContextInterface $renderingContext
)
{
if ($arguments['daytrip']) {
return 'Tageweise buchbar';
}
$options = $arguments['options'];
if ($options === null) {
return '';
@@ -1,19 +1,19 @@
<template>
<div class="teaserbox teaserbox--landscape teaserbox--searchresult searchresult-item">
<div class="teaserbox__image">
<img class="teaserbox__flag" v-bind:src="item.country.flag" v-bind:alt="item.country.name"/>
<a v-bind:href="item.detailPageUri" rel="nofollow">
<img class="teaserbox__flag" :src="item.country.flag" :alt="item.country.name"/>
<a :href="item.detailPageUri" rel="nofollow">
<picture class="searchresult-item__image">
<source media="(max-width: 768px)" v-bind:srcset="item.hotel.images.resized.s[0].url + ' 220w'"/>
<source media="(max-width: 1200px)" v-bind:srcset="item.hotel.images.resized.l[0].url + ' 280w'"/>
<source media="(min-width: 1201px)" v-bind:srcset="item.hotel.images.resized.m[0].url + ' 260w'"/>
<img class="scale" v-bind:src="item.hotel.images.resized.s[0].url"
v-bind:title="item.hotel.images.resized.s[0].title"
v-bind:alt="item.hotel.images.resized.s[0].alt">
<source media="(max-width: 768px)" :srcset="item.hotel.images.resized.s[0].url + ' 220w'"/>
<source media="(max-width: 1200px)" :srcset="item.hotel.images.resized.l[0].url + ' 280w'"/>
<source media="(min-width: 1201px)" :srcset="item.hotel.images.resized.m[0].url + ' 260w'"/>
<img class="scale" :src="item.hotel.images.resized.s[0].url"
:title="item.hotel.images.resized.s[0].title"
:alt="item.hotel.images.resized.s[0].alt">
</picture>
</a>
<div class="concept-badge" v-bind:id="section.concept.code"
v-bind:class=" 'concept-badge--' + section.concept.code">{{ section.concept.name }}</div>
<div class="concept-badge" :id="section.concept.code"
:class=" 'concept-badge--' + section.concept.code">{{ section.concept.name }}</div>
</div>
<div class="teaserbox__main">
<div class="teaserbox__header">
@@ -44,17 +44,17 @@
<div class="teaserbox__aside__top">
<span class="searchresult-item__label">{{ item.dates.length > 1 ? 'Zeitraum' : 'Termin' }}</span>
<span class="searchresult-item__daterange">{{ dateRange }}</span>
<a v-bind:href="item.detailPageUri" rel="nofollow" v-if="item.dates.length">
<a :href="item.detailPageUri" rel="nofollow" v-if="item.dates.length && !item.daytrip">
<span class="searchresult-item__daterange">
<i class="fa fa-arrow-circle-right"></i> {{ item.dates.length }} Termin{{ item.dates.length > 1 ? 'e' : '' }}
</span>
</a>
<hr>
<span class="searchresult-item__label">{{ nightsOptions }}</span>
<span class="searchresult-item__label">{{ item.daytrip ? 'Tageweise buchbar' : nightsOptions }}</span>
</div>
<div class="teaserbox__aside__bottom">
<span class="searchresult-item__price">ab {{ item.minPrice }} </span>
<a v-bind:href="item.detailPageUri" class="button button--full searchresult-item__button" rel="nofollow">
<a :href="item.detailPageUri" class="button button--full searchresult-item__button" rel="nofollow">
Details &amp; Buchen
</a>
</div>
@@ -59,8 +59,8 @@
</div>
<hr>
<span class="product-teaser__description">
{ep:dateRange(dateFrom: teaser.minDateStart, dateTo: teaser.maxDateEnd, includeLabel: 0, format: 'd.m.y')} <f:if condition="{teaser.dates -> f:count()} > 1">({teaser.dates -> f:count()} Termine)</f:if><br>
{ep:nightsOptions(options: teaser.nights)}<f:if condition="{teaser.skipassIncluded}">, <strong>inkl. Skipass</strong></f:if>
{ep:dateRange(dateFrom: teaser.minDateStart, dateTo: teaser.maxDateEnd, includeLabel: 0, format: 'd.m.y')} <f:if condition="{teaser.dates -> f:count()} > 1 && !{teaser.daytrip}">({teaser.dates -> f:count()} Termine)</f:if><br>
{ep:nightsOptions(options: teaser.nights, daytrip: teaser.daytrip)}<f:if condition="{teaser.skipassIncluded}">, <strong>inkl. Skipass</strong></f:if>
</span>
<hr>
<div class="product-teaser__footer">
@@ -79,7 +79,7 @@
<div class="teaserbox__aside__top">
<span class="searchresult-item__label">{f:if(condition: '{teaser.dates -> f:count()} > 1', then: 'Zeitraum', else: 'Termin')}</span>
<span class="searchresult-item__daterange">{ep:dateRange(dateFrom: teaser.minDateStart, dateTo: teaser.maxDateEnd, includeLabel: 0)}</span>
<f:if condition="{teaser.dates -> f:count()} > 1">
<f:if condition="{teaser.dates -> f:count()} > 1 && !{teaser.daytrip}">
<a href="{uriLink}" title="Alle Termine {teaser.product.name}">
<span class="searchresult-item__daterange">
<i class="fa fa-arrow-circle-right"></i> {teaser.dates -> f:count()} Termin{f:if(condition: '{teaser.dates -> f:count()} > 1', then: 'e')}
@@ -87,7 +87,7 @@
</a>
</f:if>
<hr>
<span class="searchresult-item__label">{ep:nightsOptions(options: teaser.nights)}</span>
<span class="searchresult-item__label">{ep:nightsOptions(options: teaser.nights, daytrip: teaser.daytrip)}</span>
</div>
<div class="teaserbox__aside__bottom">
<span class="searchresult-item__price">ab {teaser.minPrice} €{f:if(condition: teaser.pseudoPrice, then: ' <s class="searchresult-item__pseudo-price">{teaser.pseudoPrice} €</s>')}</span>