{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<div class="tb-teaser__text">
    <p class="tb-teaser__topline">
        <strong>{article.categoriesSorted.0.title}</strong>
        <f:if condition="{article.mainAddress.city}">
            • <span>{article.mainAddress.city}</span>
        </f:if>
    </p>

    <h3 class="tb-teaser__title">{article.name}</h3>

    <div class="tb-teaser__rating">
        <f:if condition="{article.starClassifications} || {article.averageRating} > 0">
            <f:then>
                <vh:render
                    partial="PointOfInterests/Attribute"
                    arguments="{
                        type: 'starRating',
                        starClassifications: article.starClassifications,
                        starValue: article.starValue
                    }" />

            </f:then>
        </f:if>
    </div>
    <div class="tb-teaser__price">
        <f:if condition="{article.flatAttributes.minimumBasePrice.0}">
            <p>
                <strong class="font-bold">
                    <vh:translate
                        id="price.word.todayFrom"
                        package="Newland.Toubiz.Poi.Neos"
                        source="Views/Teaser" />

                    <vh:render
                        section="Currency"
                        arguments="{
                            currency: article.flatAttributes.minimumBasePrice.0.currency,
                            value: article.flatAttributes.minimumBasePrice.0.value
                        }"
                    />
                </strong>

                {article.flatAttributes.minimumBasePrice.0.unit}
            </p>
        </f:if>
    </div>
</div>

<f:section name="Currency">
    <f:switch expression="{currency}">
        <f:case value="CHF">
            <f:format.currency currencySign="CHF" decimalSeparator="." thousandsSeparator="'" prependCurrency="TRUE">{value}</f:format.currency>
        </f:case>

        <f:case value="EUR">
            <f:format.currency currencySign="€">{value}</f:format.currency>
        </f:case>

        <f:defaultCase>
            <f:format.currency currencySign="{currency}">{value}</f:format.currency>
        </f:defaultCase>
    </f:switch>
</f:section>
