{# @var \Pimcore\Model\DataObject\AlpsteinTour tour #}
{% set additionalBadges = getClosureStatesForTour(tour) %}
<section class="tour-teaser teaser-animation">
<div class="tour-teaser__info-wrapper d-flex">
{% if tour.publicTransportFriendly %}
<div class="tour-teaser__arrival">
<span class="tour-teaser__arrival-icon icon icon-traffic" aria-label="mit Bus erreichbar"
data-toggle="tooltip" data-original-title="{{ 'tour.mit Bus erreichbar'|trans }}"></span>
{# <span class="tour-teaser__arrival-text">#}
{# {{ 'tour.mit Bus erreichbar'|trans }}#}
{# </span>#}
</div>
{% endif %}
{% if additionalBadges is defined %}
<div class="tour-teaser__status-wrapper {{ additionalBadges|length > 1 ? 'd-flex w-100 justify-content-end' }}" >
{% for additionalBadge in additionalBadges %}
<div class="tour-teaser__status">
<span class="tour-teaser__status-icon icon icon-path-{{ additionalBadge.icon }} text-{{ additionalBadge.color }}" aria-label="{{ additionalBadge.text }}"
data-toggle="tooltip" data-custom-tooltip-class="tour-status__tooltip" data-original-title="{{ additionalBadge.title|default(additionalBadge.text) }}">
</span>
{# <span class="tour-teaser__status-text">#}
{# {{ additionalBadge.text }}#}
{# </span>#}
</div>
{% endfor %}
</div>
</div>
{% endif %}
<div class="embed-responsive embed-responsive-7by9">
{% set teaserImage = null %}
{% if tour.primaryImage %}
{% set teaserImage = tour.primaryImage %}
{% elseif tour.images and tour.images[0] %}
{% set teaserImage = tour.images[0] %}
{% endif %}
{% if teaserImage %}
{% set description = getImageDescription(teaserImage, true) %}
{{ teaserImage.thumbnail('tour-teaser').html({
imgAttributes: {
class: 'js-lazy-img embed-responsive-item teaser-animation__img'
},
lowQualityPlaceholder: true,
title: description|default(''),
alt: description|default('')
})|raw }}
{% endif %}
</div>
<div class="tour-teaser__content d-flex flex-column justify-content-end">
<div class="vertical-gutter--2">
{% set location = getTourLocation(tour) %}
{% if location %}
<span class="badge badge-white mr-md-2 mr-1 vertical-gutter__item">{{ location }}</span>
{% endif %}
{% if tour.ratingDifficulty %}
{% if tour.ratingDifficulty == 3 %}
{% set levelColor = 'dark' %}
{% elseif tour.ratingDifficulty == 2 %}
{% set levelColor = 'info' %}
{% elseif tour.ratingDifficulty == 1 %}
{% set levelColor = 'success' %}
{% endif %}
<span class="badge badge-{{ levelColor }} mr-2 vertical-gutter__item">{{ ('tour.difficulty' ~ tour.ratingDifficulty)|trans }}</span>
{% endif %}
{#
open: badge-success
partially-open: badge-info
closed: badge-danger
#}
{% set badge = [] %}
{% if tour.openedState %}
{% if tour.openedState == 'open' %}
{% set badge = {
'color': 'success',
'text': 'tour.Geöffnet'|trans
} %}
{% elseif tour.openedState == 'partially-open' %}
{% set badge = {
'color': 'info',
'text': 'tour.Teilweise geöffnet'|trans
} %}
{% elseif tour.openedState == 'closed' %}
{% set badge = {
'color': 'danger',
'text': 'tour.Geschlossen'|trans
} %}
{% endif %}
{% endif %}
{% if badge is not empty %}
<span class="badge badge-{{ badge.color }} mr-2 vertical-gutter__item">
{{ badge.text }}
</span>
{% endif %}
</div>
<div class="row row-gutter--3 pt-2">
<div class="col-auto">
<span
class="font-default-bold">{{ 'tour.Strecke'|trans }}</span> {{ (tour.length / 1000)|number_format(1, ',', '.') }}
km
</div>
<div class="col-auto">
{% set duration = tour.timeMin %}
{% set hour = (duration/60)|round(0, 'floor') %}
{% set minutes = duration % 60 %}
{% if minutes < 10 %}
{% set minutes = 0 ~ minutes %}
{% endif %}
<span class="font-default-bold">{{ 'tour.Dauer'|trans }}</span> {{ hour }}:{{ minutes }} h
</div>
</div>
{% set description = getImageDescription(tour.primaryImage) %}
<h3 class="tour-teaser__content__title font-default-bold mb-0"><a
href="{{ linkGenerator().generate(tour, {relative: true, canoncial: false}) }}"
class="stretch-link__link" title="{{ description|default('') }}">{{ tour.name }}</a></h3>
</div>
</section>