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

<poi:collection.attributes.notAllEmpty
    arrays="{
        0: article.flatAttributes.prices,
        1: article.flatAttributes.discountCard
    }"
    strings="{
        0: article.flatAttributes.freeEntrance,
        1: article.flatAttributes.priceInformation
    }">

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

        <f:if condition="{article.flatAttributes.freeEntrance} || {article.flatAttributes.prices}">
            <f:if condition="{article.flatAttributes.freeEntrance.hasContents}">
                <meta itemprop="isAccessibleForFree" content="true"/>
                <vh:translate
                    id="property.attribute.freeEntrance"
                    package="Newland.Toubiz.Poi.Neos"
                    source="Models/Article"/>.
            </f:if>

            <f:if condition="{article.flatAttributes.prices}">
                <table class="tb-table">
                    <f:for each="{article.priceTable}" as="row" iteration="iterator">
                        <tr>
                            <f:if condition="{iterator.isFirst}">
                                <f:then>
                                    <f:for each="{row}" as="column">
                                        <th>{column}</th>
                                    </f:for>
                                </f:then>
                                <f:else>
                                    <f:for each="{row}" as="column">
                                        <td>{column}</td>
                                    </f:for>
                                </f:else>
                            </f:if>
                        </tr>
                    </f:for>
                </table>
            </f:if>
        </f:if>

        <f:if condition="{article.flatAttributes.priceInformation}">
            {article.flatAttributes.priceInformation -> f:format.raw()}
        </f:if>

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

                    </th>
                    <td>
                        <ul class="tb-badges-list">
                            <f:for each="{article.flatAttributes.discountCards}" as="discountCard">
                                <li class="tb-badge">
                                    {discountCard}
                                </li>
                            </f:for>
                        </ul>
                    </td>
                </tr>
            </f:if>
        </table>
    </div>
</poi:collection.attributes.notAllEmpty>
