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

<poi:collection.attributes.notAllEmpty
    arrays="{
        0: article.flatAttributes.properties,
        1: article.flatAttributes.crossCountryTechnique
    }"
    strings="{
        0: article.flatAttributes.equipment,
        1: article.description,
        2: article.flatAttributes.directions
    }"
    integers="{
        0: article.flatAttributes.conditionRating,
        1: article.flatAttributes.techniqueRating,
        2: article.flatAttributes.experienceRating,
        3: article.flatAttributes.landscapeRating
    }">

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

        <div class="mb-4">
            <table class="tb-table tb-table--with-dividers tb-table--mobile-two-columns">
                <tbody>
                <f:if condition="{article.flatAttributes.properties.hasContents}">
                    <tr>
                        <th>
                            <vh:translate
                                id="property.attribute.properties"
                                package="Newland.Toubiz.Poi.Neos"
                                source="Models/Article"/>

                        </th>
                        <td colspan="3">
                            <f:render
                                partial="PointOfInterests/Attribute"
                                arguments="{
                                    type: 'translationArray',
                                    source: 'Models/Article',
                                    path: 'property.attribute.properties.values',
                                    attribute: article.flatAttributes.properties
                                }"/>

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

                        </th>
                        <td colspan="3">
                            <f:render
                                partial="PointOfInterests/Attribute"
                                arguments="{
                                    type: 'translationArray',
                                    source: 'Models/Article',
                                    path: 'property.attribute.crossCountryTechnique.values',
                                    attribute: article.flatAttributes.crossCountryTechnique
                                }"/>

                        </td>
                    </tr>
                </f:if>
                <f:if condition="{article.flatAttributes.equipment -> vh:string.notEmpty(ignoreEmptyTags:true)}">
                    <tr>
                        <th>
                            <vh:translate
                                id="property.attribute.equipment"
                                package="Newland.Toubiz.Poi.Neos"
                                source="Models/Article"/>

                        </th>
                        <td colspan="3">
                            <f:render
                                partial="PointOfInterests/Attribute"
                                arguments="{
                                    type: 'text',
                                    attribute: article.flatAttributes.equipment
                                }"/>

                        </td>
                    </tr>
                </f:if>
                <f:if condition="{article.flatAttributes.conditionRating.intValue}>0||{article.flatAttributes.techniqueRating.intValue}>0">
                    <tr>
                        <f:if condition="{article.flatAttributes.conditionRating.intValue}>0">
                            <th>
                                <vh:translate
                                    id="property.attribute.conditionRating"
                                    package="Newland.Toubiz.Poi.Neos"
                                    source="Models/Article"/>

                            </th>
                            <td>
                                <f:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'tourRating',
                                        name: 'conditionRating',
                                        attribute: article.flatAttributes.conditionRating
                                    }"/>

                            </td>
                        </f:if>

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

                            </th>
                            <td>
                                <f:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'tourRating',
                                        name: 'techniqueRating',
                                        attribute: article.flatAttributes.techniqueRating
                                    }"/>

                            </td>
                        </f:if>
                    </tr>
                </f:if>
                <f:if condition="{article.flatAttributes.experienceRating.intValue}>0||{article.flatAttributes.landscapeRating.intValue}>0">
                    <tr>
                        <f:if condition="{article.flatAttributes.experienceRating.intValue}>0">
                            <th>
                                <vh:translate
                                    id="property.attribute.experienceRating"
                                    package="Newland.Toubiz.Poi.Neos"
                                    source="Models/Article"/>

                            </th>
                            <td>
                                <f:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'tourRating',
                                        name: 'experienceRating',
                                        attribute: article.flatAttributes.experienceRating
                                    }"/>

                            </td>
                        </f:if>

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

                            </th>
                            <td>
                                <f:render
                                    partial="PointOfInterests/Attribute"
                                    arguments="{
                                        type: 'tourRating',
                                        name: 'landscapeRating',
                                        attribute: article.flatAttributes.landscapeRating
                                    }"/>

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

                        </th>
                        <td colspan="3">
                            <div itemprop="directions">
                                {article.flatAttributes.directions -> f:format.raw()}
                            </div>
                        </td>
                    </tr>
                </f:if>
                </tbody>
            </table>
        </div>

        <poi:collection.attributes.notAllEmpty
            strings="{
                0: article.flatAttributes.bestSeason
            }">
            <div class="mb-4">
                <section class="tb-best-season">
                    <h5 id="tb-best-season__heading" class="tb-best-season__heading">
                        {vh:translate(id: 'property.attribute.bestSeason', package: 'Newland.Toubiz.Poi.Neos', source:
                        'Models/Article')}
                    </h5>

                    <ul class="tb-best-season__list">
                        <f:for each="{poi:collection.attributes.bestSeason(attributes: article.attributes)}" key="month"
                               as="is">
                            <f:if condition="{is}">
                                <f:then>
                                    <li class="tb-best-season__month tb-best-season__month--marked"
                                        aria-labelledby="tb-best-season__heading">

                                        {vh:translate(id: 'property.attribute.bestSeason.values.{month}', package:
                                        'Newland.Toubiz.Poi.Neos', source: 'Models/Article')}
                                    </li>
                                </f:then>
                                <f:else>
                                    <li class="tb-best-season__month">
                                        {vh:translate(id: 'property.attribute.bestSeason.values.{month}', package:
                                        'Newland.Toubiz.Poi.Neos', source: 'Models/Article')}
                                    </li>
                                </f:else>
                            </f:if>
                        </f:for>
                    </ul>
                </section>
            </div>
        </poi:collection.attributes.notAllEmpty>
        <f:render partial="PointOfInterests/Show/Content" arguments="{_all}"/>
    </div>
</poi:collection.attributes.notAllEmpty>
