{# @var tour \Pimcore\Model\DataObject\AlpsteinTour #}
{% extends "Layout/default.html.twig" %}
{% do pimcore_placeholder('disableWeatherSlide').set(true) %}
{% set detailUrl = linkGenerator().generate(tour) %}
{% if not detailUrl is same as(app.request.pathInfo) %}
{% do elements_robots().setNoIndex(true) %}
{% endif %}
{% do pimcore_placeholder( 'addBreadcrumb' ).set({
'parentId': document.id,
'url': detailUrl,
'label': tour.name
}) %}
{% do elements_head_title().setTitle(tour.metaTitle ?: tour.name, true) %}
{% do elements_opengraph().setDescription(tour.metaDescription ?: tour.shortText) %}
{% do elements_canonical(detailUrl) %}
{% do elements_head_title(tour.metaTitle ?: tour.name, true) %}
{% do elements_head_meta(tour.metaDescription ?: chooseDescription(tour.shortText, tour.longText), true) %}
{% if tour.primaryImage %}
{% do elements_opengraph().addImage(tour.primaryImage.thumbnail('hero').getPath()) %}
{% endif %}
{% block content %}
{{ jld_root(tour, true, true) }}
{% set heroImage = null %}
{% set heroImageAlt = tour.category[0].name ~ ' ' ~ tour.name ~ ' - Touren-Impression #1' %}
{% if tour.primaryImage %}
{% set heroImage = tour.primaryImage %}
{% elseif tour.images and tour.images[0] %}
{% set heroImage = tour.images[0] %}
{% endif %}
{% if heroImage and heroImage.metadata is iterable %}
{% for metadata in heroImage.metadata %}
{% if metadata['name'] == 'alt' %}
{% set heroImageAlt = metadata['data'] %}
{% endif %}
{% endfor %}
{% endif %}
{{ include('Includes/hero.html.twig', {'image': heroImage, 'alt': heroImageAlt}) }}
{{ include('Navigation/breadcrumb.html.twig') }}
{#
open: badge-success
partially-open: badge-info
closed: badge-danger
#}
{% set additionalBadges = getClosureStatesForTour(tour) %}
{% set badgeAddon = '' %}
{% if tour.publicTransportFriendly %}
{% set badgeAddon = badgeAddon ~ ('<span class="icon icon-traffic" aria-label="mit Bus erreichbar" data-toggle="tooltip" data-original-title="' ~ 'tour.mit Bus erreichbar'|trans ~ '"></span>') %}
{% endif %}
{% if additionalBadges is not empty %}
{% set badgeAddon = badgeAddon ~ _self.closureBadges(additionalBadges) %}
{% endif %}
{% 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 %}
{{ include('Includes/main-title-block-splitted.html.twig', {
additionalBadges: additionalBadges,
headline: tour.name,
badge: badge,
badgeAddon: badgeAddon,
description: tour.shortText,
expand: tour.longText
}) }}
<section class="container container-sm content-block">
{{ include('Tour/detail/tourProperties.html.twig') }}
{{ include('Tour/detail/tourSeasons.html.twig') }}
{{ include('Tour/detail/tourDetails.html.twig') }}
</section>
{{ include('Tour/detail/map.html.twig') }}
{{ include('Tour/detail/tourTabbing.html.twig') }}
{{ include('Tour/detail/tourGallery.html.twig') }}
{% set weatherStation = getWeatherStationByAlpsteinTour(tour) %}
{% if weatherStation %}
{{ include('Includes/weather-slide.html.twig', {'weatherStation': weatherStation}) }}
{% endif %}
{{ include('Includes/demiNearbySlide.html.twig', {
image: tour.imageTeaserOverrideAccomodation ?: siteConfig.textSlideImageDefault,
headline: 'tour-detail.Unterkünfte in der Nähe'|trans,
id: tour.id,
lat: tour.startingPoint.latitude,
lng: tour.startingPoint.longitude,
btnText: 'tour.detail.Weiter zur Suche'|trans
}) }}
{% if recommendations is defined and recommendations is not empty %}
{{ include('Tour/detail/recommendations.html.twig', {'tours': recommendations}) }}
{% endif %}
{% endblock %}
{% block javascripts %}
{% if not app.request.get('onlyInlineCss') %}
{{ include('Layout/includes/encore.html.twig', {
'staticDebugMode': staticDebugMode,
'file': 'js/tour'
}) }}
{% endif %}
{% endblock %}
{% macro closureBadges(additionalBadges) %}
{% for additionalBadge in additionalBadges %}
<div class="tour-detail__status">
<span class="tour-detail__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-detail__status-text">#}
{# {{ additionalBadge.text }}#}
{# </span>#}
</div>
{% endfor %}
{% endmacro %}