{namespace poi=Newland\Toubiz\Poi\Neos\ViewHelpers}
{namespace vh=Newland\NeosViewHelpers\ViewHelpers}
{namespace common=Newland\Toubiz\Common\Neos\ViewHelpers}


<f:if condition="{article.awards}">
    <vh:render partial="PointOfInterests/Show/Awards" arguments="{_all}" />
</f:if>

<f:if condition="{article.isCity}">
    <f:then>
        <f:if condition="{article.cityData.facts}">
            <span itemprop="additionalProperty" itemscope itemtype="http://schema.org/PropertyValue">
                <h2 class="mt-0 mb-2 text-xl">
                    {vh:translate(id: 'facts.header', package: 'Newland.Toubiz.Poi.Neos', source: 'Views/Show')}
                </h2>
                <meta itemprop="name" content="facts">
                <div class="mb-4 text-gray-900 leading-normal text-base" itemprop="value">
                    {article.cityData.facts -> f:format.raw()}
                </div>
            </span>
        </f:if>
    </f:then>
    <f:else if="!{article.toubizLegacyTour}">
        <vh:render
            partial="PointOfInterests/Show/Content/Address"
            arguments="{
                article: article,
                sectionHeadline: '{vh:translate(id: \'contact.header\',
                package: \'Newland.Toubiz.Poi.Neos\',
                source: \'Views/Show\')}'
            }" />

        <vh:render partial="PointOfInterests/Show/Content/BookingLink" arguments="{_all}" />
        <vh:render partial="PointOfInterests/Show/Content/RoutePlanner" arguments="{_all}" />
        <vh:render partial="PointOfInterests/Show/Content/SocialIcons" arguments="{_all}" />
    </f:else>
</f:if>

<f:if condition="{article.files} || {article.outdoorActiveTour}">
    <div class="mb-8">
        <h2 class="mt-0 mb-2 text-xl">
            {vh:translate(id: 'downloads.header', package: 'Newland.Toubiz.Poi.Neos', source: 'Views/Show')}
        </h2>

        <ul class="tb-downloads">

            <f:for each="{article.files}" as="file">
                <f:variable name="defaultLabel">
                    {vh:translate(id: 'tour.{file.name}', package: 'Newland.Toubiz.Poi.Neos', source: 'Models/Article')}
                </f:variable>

                <vh:render
                    partial="DownloadItem"
                    arguments="{
                        url: file.sourceUri,
                        label: '{f:if(condition: article.toubizLegacyTour, then: defaultLabel, else: file.name)}'
                    }"
                />
            </f:for>

            <f:if condition="{article.outdoorActiveTour}">
                <li class="tb-downloads__item">
                    <button class="tb-downloads__link" id="oax-openPdfGuide"
                            data-outdooractive-pdf-download="{article.outdooractiveId}">
                        <span class="tb-downloads__icon-wrapper">
                            <svg class="c-icon" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"
                                 fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round"
                                 stroke-miterlimit="1.414"><path
                                d="M10 9.252l2.738-2.737a.999.999 0 1 1 1.414 1.414l-4.419 4.418a.995.995 0 0 1-.733.32.995.995 0 0 1-.733-.32L3.849 7.929a.999.999 0 1 1 1.414-1.414L8 9.252V1a1 1 0 0 1 2 0v8.252zm6 2.415a1 1 0 0 1 2 0v3.556a2.787 2.787 0 0 1-2.778 2.778H2.773A2.797 2.797 0 0 1 0 15.223v-3.556a1 1 0 0 1 2 0v3.551a.793.793 0 0 0 .778.783h12.444a.787.787 0 0 0 .778-.778v-3.556z"
                                fill-rule="nonzero"></path></svg>
                        </span>
                        <span class="tb-downloads__text">
                            {vh:translate(id: 'downloads.pdfDownload', package: 'Newland.Toubiz.Poi.Neos', source:
                            'Views/Show')}
                        </span>
                    </button>
                </li>

                <vh:render
                    partial="DownloadItem"
                    arguments="{
                        url: '{poi:uri.outdoorActive.gpx(article: article)}',
                        label: '{vh:translate(id: \'outdoorActive.gpx\', package: \'Newland.Toubiz.Poi.Neos\', source: \'Models/Article\')}'
                    }" />

                <vh:render
                    partial="DownloadItem"
                    arguments="{
                        url: '{poi:uri.outdoorActive.kml(article: article)}',
                        label: '{vh:translate(id: \'outdoorActive.kml\', package: \'Newland.Toubiz.Poi.Neos\', source: \'Models/Article\')}'
                    }" />

            </f:if>
        </ul>
    </div>
</f:if>

<f:if condition="{article.flatAttributes.decorations}">
    <div class="mb-8">
        <h2 class="mt-0 mb-2 text-xl">
            {vh:translate(id: 'decorations.header', package: 'Newland.Toubiz.Poi.Neos', source: 'Models/Article')}
        </h2>

        <ul class="tb-tour-decorations">
            <f:if condition="{article.flatAttributes.decorations.awardQualityHike}">
                <li class="tb-tour-decorations__item">
                    <img
                    class="tb-tour-decorations__image"
                    src="{f:uri.resource(path: 'Images/Decorations/award-quality-hike.svg', package: 'Newland.Toubiz.Poi.Neos')}"
                    alt="" />

                    <p>{vh:translate(id: 'decorations.awardQualityHike', package: 'Newland.Toubiz.Poi.Neos', source: 'Models/Article')}</p>
                </li>
            </f:if>

            <f:if condition="{article.flatAttributes.decorations.awardPremiumHike}">
                <li class="tb-tour-decorations__item">
                    <img
                    class="tb-tour-decorations__image"
                    src="{f:uri.resource(path: 'Images/Decorations/award-premium-hike.svg', package: 'Newland.Toubiz.Poi.Neos')}"
                    alt="" />

                    <p>{vh:translate(id: 'decorations.awardPremiumHike', package: 'Newland.Toubiz.Poi.Neos', source: 'Models/Article')}</p>
                </li>
            </f:if>
        </ul>
    </div>
</f:if>
<f:if condition="{article.flatAttributes.additionalInformation}">
    <div class="mb-8">
        <h2 class="mt-0 mb-2 text-xl">
            {vh:translate(id: 'property.attribute.additionalInformation', package: 'Newland.Toubiz.Poi.Neos', source:
            'Models/Article')}
        </h2>

        <vh:render
            partial="PointOfInterests/Attribute"
            arguments="{
                type: 'text',
                name: 'additionalInformation',
                attribute: article.flatAttributes.additionalInformation
            }" />
    </div>
</f:if>
<f:if condition="{article.toubizLegacyTour}">
    <vh:render
        partial="PointOfInterests/Show/Content/Address"
        arguments="{
            article: article,
            sectionHeadline: '{vh:translate(id: \'property.attribute.additionalInformation\',
            package: \'Newland.Toubiz.Poi.Neos\',
            source: \'Models/Article\')}'
        }" />
</f:if>
<f:if
    condition="{vh:collection.includesValue(collection: configuration.displayOptions.show.hide, value: 'source')} == false">
    <div class="mb-8">
        <common:slot.render
            slot="detailSourceInformation"
            context="{ article: article }"
        />
    </div>
</f:if>
