{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<div class="tb-header">
    <div class="tb-header__topline">
        <f:if condition="{article.flatAttributes.cureLabel}">
            <span>
                <f:translate id="attribute.cureLabel" package="Newland.Toubiz.Poi.Neos" source="Views/Cities"/>
            </span>
        </f:if>

        <f:if condition="{article.flatAttributes.labels.top}">
            <span class="tb-badge">
                <f:translate
                    id="property.attribute.labels.top"
                    package="Newland.Toubiz.Poi.Neos"
                    source="Views/Teaser"/>

            </span>
        </f:if>
        <span class="uppercase font-bold">
            <f:if condition="{article.isGastronomy}">
                <f:then>
                    <f:for each="{article.categoriesSorted}" as="category" iteration="iterator">
                        <f:if condition="{category.title}">
                            {category.title}{f:if(condition: '!{iterator.isLast}', then: ' • ')}
                        </f:if>
                    </f:for>
                </f:then>
                <f:else>
                    {article.categoriesSorted.0.title}
                </f:else>
            </f:if>
        </span>

        <f:if condition="{article.flatAttributes.gastronomyStyle}">
            <span>|&nbsp;
                <f:for each="{article.flatAttributes.gastronomyStyle}" as="gastronomyStyle" iteration="iterator">
                    {gastronomyStyle}{f:if(condition: '!{iterator.isLast}', then: ' • ')}
                </f:for>
            </span>
        </f:if>
    </div>

    <h1 itemprop="name">{article.name}</h1>
    <f:if condition="{article.mainAddress || article.openingTimes}">
        <div class="tb-header__subline">
            <f:if condition="{article.isCity}">
                <f:then>
                    <f:if condition="{article.cityData.claim}">
                        <span itemprop="additionalProperty" itemscope itemtype="http://schema.org/PropertyValue">
                            <meta itemprop="name" content="claim">
                            <p><strong itemprop="value">{article.cityData.claim}</strong></p>
                        </span>
                    </f:if>
                </f:then>
                <f:else>
                    <f:if condition="{article.mainAddress} && !{article.mainAddress.empty}">
                        <p
                            class="tb-header__location"
                            itemprop="{f:if(condition: article.isTour, then: 'location', else: 'address')}"
                            itemscope
                            itemtype="http://schema.org/PostalAddress">

                            <svg class="c-icon text-primary" aria-hidden="true">
                                <use xlink:href="#icon-location"/>
                            </svg>

                            <f:if condition="{article.mainAddress.street}">
                                <span itemprop="streetAddress">{article.mainAddress.street}</span>,
                            </f:if>
                            <span itemprop="postalCode">{article.mainAddress.zip}</span>
                            <span temprop="addressLocality">{article.mainAddress.city}</span>
                        </p>
                    </f:if>
                </f:else>
            </f:if>

            <f:if condition="{article.openingTimes}">
                <vh:render
                    partial="PointOfInterests/OpeningTimes"
                    arguments="{ article: article, displayTable: 1 }"/>

            </f:if>

            <f:if condition="{article.flatAttributes.status} || {article.flatAttributes.currentInfo}">
                <div class="mt-4">
                    <vh:render
                        partial="PointOfInterests/Show/Tour/Status"
                        arguments="{status: article.flatAttributes.status.data.0, info: article.flatAttributes.currentInfo.data.0}"/>
                </div>
            </f:if>
        </div>
    </f:if>
</div>
