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

<poi:link.article
    article="{article}"
    class="tb-teaser"
    additionalAttributes="{
        itemscope: 'itemscope',
        itemtype: 'http://schema.org/FoodEstablishment',
        itemid: 'urn:uuid:{article.persistenceObjectIdentifier}'
    }">

    <vh:render section="content" arguments="{_all}" />
</poi:link.article>

<f:section name="content">
    <vh:render partial="PointOfInterests/Teaser/Common/Image" arguments="{_all}"/>

    <div class="tb-teaser__text">
        <vh:render partial="PointOfInterests/Teaser/Common/Topline" arguments="{_all}"/>
        <f:if condition="{article.openingTimes}">
            <vh:render partial="PointOfInterests/OpeningTimes"
                      arguments="{article: article, displayTable: 0}"/>
        </f:if>
        <f:if condition="{article.flatAttributes.gastronomyStyle}">
            <ul class="tb-teaser__characteristics">
                <f:for each="{vh:collection.slice(collection: article.flatAttributes.gastronomyStyle, offset: 0, length: 2)}"
                       as="item">

                    <li class="tb-teaser__characteristics-item" itemprop="servesCuisine">{item}</li>
                </f:for>
            </ul>
        </f:if>
    </div>

    <f:if condition="{article.starClassification} > 0 || {article.averageRating} > 0">
        <f:then>
            <vh:render
                partial="PointOfInterests/Attribute"
                arguments="{
                    type: 'teaserRating',
                    name: 'teaserRating',
                    starClassification: article.starClassification,
                    averageRating: article.averageRating,
                    numberOfRatings: article.numberOfRatings
                }" />

        </f:then>
    </f:if>
</f:section>
