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

<poi:collection.attributes.notAllEmpty
    strings="{
        0: article.flatAttributes.priceSegment,
        1: article.flatAttributes.kitchenStyle,
        2: article.flatAttributes.habitsAndAllergies,
        3: article.flatAttributes.ambiance,
        4: article.flatAttributes.acceptedPayments,
        5: article.flatAttributes.spokenLanguages
    }">

    <div
        id="target-enhancement-target-info"
        class="tb-tab-navigation__target is-target"
        data-target-enhancement-subject>

        <div class="mb-4">
            <table class="tb-table">

                <f:if condition="{article.flatAttributes.priceSegment.hasContents}">
                    <tr>
                        <th>
                            <vh:translate
                                id="property.attribute.priceSegment"
                                package="Newland.Toubiz.Poi.Neos"
                                source="Models/Article" />

                        </th>
                        <td>
                            <span itemprop="priceRange">
                                <vh:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'translationArray',
                                        attribute: article.flatAttributes.priceSegment,
                                        source: 'Models/Article',
                                        path: 'property.attribute.priceSegment.values'
                                    }" />

                            </span>
                        </td>
                    </tr>
                </f:if>
                <poi:openingTimes.kitchenTimes openingTimes="{article.openingTimes}" as="kitchenTimes">
                    <f:if condition="{kitchenTimes}">
                        <tr>
                            <th>
                                <vh:translate
                                    id="property.openingTimes.kitchen"
                                    package="Newland.Toubiz.Poi.Neos"
                                    source="Models/Article" />

                            </th>
                            <td>
                                <span itemprop="openingTimes">
                                    <f:for each="{kitchenTimes}" as="kitchenTime">
                                        <f:if condition="{kitchenTime.from} && {kitchenTime.to}">
                                            <f:then>
                                                von {kitchenTime.from -> f:format.date(format: 'H:i')} bis {kitchenTime.to -> f:format.date(format: 'H:i')} Uhr
                                            </f:then>
                                            <f:comment>
                                            <!-- Do not introduce additional whitespace directly after this if statement-->
                                            </f:comment>
                                        </f:if> {kitchenTime.comment}<br />
                                    </f:for>
                                </span>
                            </td>
                        </tr>
                    </f:if>
                </poi:openingTimes.kitchenTimes>
                <f:if condition="{article.flatAttributes.kitchenStyle.hasContents}">
                    <tr>
                        <th>
                            <vh:translate
                                id="property.attribute.kitchenStyle"
                                package="Newland.Toubiz.Poi.Neos"
                                source="Models/Article" />

                        </th>
                        <td>
                            <span itemprop="servesCuisine">
                                <vh:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'translationArray',
                                        attribute: article.flatAttributes.kitchenStyle,
                                        source: 'Models/Article',
                                        path: 'property.attribute.kitchenStyle.values'
                                    }" />

                            </span>
                        </td>
                    </tr>
                </f:if>
                <f:if condition="{article.flatAttributes.habitsAndAllergies.hasContents}">
                    <tr>
                        <th>
                            <vh:translate
                                id="property.attribute.habitsAndAllergies"
                                package="Newland.Toubiz.Poi.Neos"
                                source="Models/Article" />

                        </th>
                        <td>
                            <span itemprop="servesCuisine">
                                <vh:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'translationArray',
                                        attribute: article.flatAttributes.habitsAndAllergies,
                                        source: 'Models/Article',
                                        path: 'property.attribute.habitsAndAllergies.values'
                                    }" />

                            </span>
                        </td>
                    </tr>
                </f:if>
                <f:if condition="{article.flatAttributes.ambiance.hasContents}">
                    <tr>
                        <th>
                            <vh:translate
                                id="property.attribute.ambiance"
                                package="Newland.Toubiz.Poi.Neos"
                                source="Models/Article" />

                        </th>
                        <td>
                            <span itemprop="servesCuisine">
                                <vh:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'text',
                                        attribute: article.flatAttributes.ambiance
                                    }" />

                            </span>
                        </td>
                    </tr>
                </f:if>
                <f:if condition="{article.flatAttributes.acceptedPayments.hasContents}">
                    <tr>
                        <th>
                            <vh:translate
                                id="property.attribute.acceptedPayments"
                                package="Newland.Toubiz.Poi.Neos"
                                source="Models/Article" />

                        </th>
                        <td>
                            <span itemprop="paymentAccepted">
                                <vh:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'text',
                                        attribute: article.flatAttributes.acceptedPayments
                                    }" />

                            </span>
                        </td>
                    </tr>
                </f:if>
                <f:if condition="{article.flatAttributes.spokenLanguages.hasContents}">
                    <tr>
                        <th>
                            <vh:translate
                                id="property.attribute.spokenLanguages"
                                package="Newland.Toubiz.Poi.Neos"
                                source="Models/Article" />

                        </th>
                        <td>
                            <vh:render
                                partial="PointOfInterests/Attribute"
                                arguments="{
                                    type: 'text',
                                    attribute: article.flatAttributes.spokenLanguages
                                }" />

                        </td>
                    </tr>
                </f:if>
            </table>
        </div>
    </div>
</poi:collection.attributes.notAllEmpty>
