{namespace neos=Neos\Neos\ViewHelpers}
{namespace nvh=Newland\NeosViewHelpers\ViewHelpers}
{namespace poi=Newland\Toubiz\Poi\Neos\ViewHelpers}
{namespace components=Newland\NeosCommon\ViewHelpers}

<f:layout name="Default"/>

<f:section name="Content">
    <f:if condition="{article}">
        <f:then>
            <f:if condition="{article.isAttraction}">
                <f:then>
                    <article
                        itemscope
                        itemtype="http://schema.org/TouristAttraction"
                        itemid="urn:uid:{article.persistenceObjectIdentifier}">

                        <nvh:render section="InnerContent" arguments="{_all}"/>
                    </article>
                </f:then>

                <f:else if="{article.isGastronomy}">
                    <article
                        itemscope
                        itemtype="http://schema.org/FoodEstablishment"
                        itemid="urn:uid:{article.persistenceObjectIdentifier}">

                        <nvh:render section="InnerContent" arguments="{_all}"/>
                    </article>
                </f:else>

                <f:else if="{article.isTour}">
                    <article
                        itemscope
                        itemtype="http://schema.org/TravelAction"
                        itemid="urn:uid:{article.persistenceObjectIdentifier}">

                        <nvh:render section="InnerContent" arguments="{_all}"/>
                    </article>
                </f:else>

                <f:else if="{article.isDirectMarketer}">
                    <article
                        itemscope
                        itemtype="http://schema.org/Store"
                        itemid="urn:uid:{article.persistenceObjectIdentifier}">

                        <nvh:render section="InnerContent" arguments="{_all}"/>
                    </article>
                </f:else>

                <f:else if="{article.isOffer}">
                    <article
                        itemscope
                        itemtype="http://schema.org/Offer"
                        itemid="urn:uid:{article.persistenceObjectIdentifier}">

                        <nvh:render section="InnerContent" arguments="{_all}"/>
                    </article>
                </f:else>

                <f:else if="{article.isCity}">
                    <article
                        itemscope
                        itemtype="http://schema.org/City"
                        itemid="urn:uid:{article.persistenceObjectIdentifier}">

                        <nvh:render section="CityInnerContent" arguments="{_all}"/>
                    </article>
                </f:else>

                <f:else>
                    <article
                        itemscope
                        itemtype="http://schema.org/Place"
                        itemid="urn:uid:{article.persistenceObjectIdentifier}">

                        <nvh:render section="InnerContent" arguments="{_all}"/>
                    </article>
                </f:else>
            </f:if>
        </f:then>
        <f:else>
            <f:if condition="{neos:rendering.inBackend(node: node)}">
                <p>No article selected.</p>
            </f:if>
        </f:else>
    </f:if>
</f:section>

<f:section name="InnerContent">
    <meta itemprop="mainEntityOfPage" content="{url}"/>
    <header class="mb-8">
        <nvh:render partial="PointOfInterests/Show/Header" arguments="{_all}"/>
    </header>

    <f:if condition="{article.mediaSorted -> f:count()} > 2">
        <components:gallery
            wrapperClass="mb-10"
            images="{article.mediaSorted}"
            flight3dUri="{article.flatAttributes.flight3d}"
            panoramaUri="{article.flatAttributes.panorama}"
        />
    </f:if>

    <div class="mb-20">
        <div class="tb-layout-detail">
            <section class="tb-layout-detail__main">
                <nvh:render partial="PointOfInterests/Show/Main" arguments="{_all}"/>
            </section>

            <section class="tb-layout-detail__sidebar-last">
                <nvh:render partial="PointOfInterests/Show/Aside" arguments="{_all}"/>
            </section>
        </div>
    </div>

    <div>
        <nvh:render partial="PointOfInterests/Show/Appendix" arguments="{_all}"/>
    </div>
</f:section>

<f:section name="CityInnerContent">
    <meta itemprop="mainEntityOfPage" content="{url}"/>

    <header class="mb-8">
        <nvh:render partial="PointOfInterests/Show/Header" arguments="{_all}"/>
    </header>

    <f:if condition="{article.mediaSorted -> f:count()} > 2 && !{insertGalleryAfterLinks}">
        <components:gallery
            wrapperClass="mb-10"
            images="{article.mediaSorted}"
        />
    </f:if>

    <div class="mb-12">
        <div class="tb-layout-detail">
            <section class="tb-layout-detail__main">
                <nvh:render partial="PointOfInterests/Show/Main" arguments="{_all}"/>
            </section>

            <section class="tb-layout-detail__sidebar-last">
                <nvh:render partial="PointOfInterests/Show/Aside" arguments="{_all}"/>
            </section>
        </div>
    </div>

    <div>
        <nvh:render partial="PointOfInterests/Show/Appendix" arguments="{_all}"/>
    </div>
</f:section>
