{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<f:if condition="{article.media -> f:count()} < 3">
    <f:if condition="{article.media -> f:count()} > 0">
        <div class="mb-8">
            <figure
                role="group"
                class="tb-gallery-preview tb-gallery-preview--single-image"
                data-toubiz-gallery>

                <div class="tb-gallery-preview__main">
                    <vh:render
                        partial="PointOfInterests/Show/GalleryItem"
                        arguments="{item: article.mediaSorted.0, caption: TRUE}" />

                </div>
                <div data-toubiz-gallery-item-container>
                    <f:for each="{vh:collection.slice(collection: article.media, offset: 1)}" as="item">
                        <span itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
                            <a
                                data-toubiz-gallery-item
                                href="{item.uri}"
                                itemprop="image url"
                            ></a>
                        </span>
                    </f:for>
                </div>
                <button
                    data-toubiz-gallery-open
                    class="tb-gallery-preview__button">

                    <span class="tb-gallery-preview__flex-wrapper">
                        <svg class="c-icon" aria-hidden="true">
                            <use xlink:href="#tb-poi-icon-expand-gallery" />
                        </svg>

                        <span>
                            {article.media -> f:count()}
                            <f:if condition="{article.media -> f:count()} > 1">
                                <f:then>
                                    {f:translate(id: 'gallery.images', package: 'Newland.Toubiz.Poi.Neos', source: 'Views/Show')}
                                </f:then>
                                <f:else>
                                    {f:translate(id: 'gallery.image', package: 'Newland.Toubiz.Poi.Neos', source: 'Views/Show')}
                                </f:else>
                            </f:if>
                        </span>
                    </span>
                </button>

                <f:if condition="{article.flatAttributes.panorama} || {article.flatAttributes.flight3d}">
                    <vh:render
                        partial="PointOfInterests/Show/GalleryLabels"
                        arguments="{_all}" />
                </f:if>
            </figure>
        </div>
    </f:if>
</f:if>

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

    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Content" arguments="{_all}" />
    </div>
    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Attributes/Attraction" arguments="{_all}" />
    </div>
    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Content/Map" arguments="{_all}" />
    </div>
</f:if>

<f:if condition="{article.isGastronomy}">
    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Attributes/Gastronomy" arguments="{_all}" />
    </div>
    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Content" arguments="{_all}" />
    </div>
    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Content/Map" arguments="{_all}" />
    </div>
</f:if>

<f:if condition="{article.isDirectMarketer}">
    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Content" arguments="{_all}" />
    </div>
    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Attributes/DirectMarketer" arguments="{_all}" />
    </div>
    <div class="mb-8">
        <vh:render partial="PointOfInterests/Show/Content/Map" arguments="{_all}" />
    </div>
</f:if>

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

<f:if condition="{article.isCity}">
    <f:if condition="{vh:collection.includesValue(collection: configuration.displayOptions.show.hide, value: 'spaTownAttributes')} == false">
        <vh:render partial="PointOfInterests/Show/Attributes/SpaTown" arguments="{_all}" />
    </f:if>

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