{#
/**
* @var \Pimcore\Templating\PhpEngine this
* @var \Pimcore\Templating\PhpEngine view
* @var \Pimcore\Templating\GlobalVariables app
*
* @var \Pimcore\Model\DataObject\DemiAccommodationService service
* @var \Elements\Demi\Model\AccommodationProduct accommodationProduct
*/
#}
<table class="table table-sm table-striped">
<tbody>
{% if service is instanceof("\\Pimcore\\Model\\DataObject\\DemiAccommodationService") and service.getSize() > 0 %}
<tr>
<th class="font-default">{{ 'demi.detail.room.size' | trans }}</th>
<td class="font-medium">{{ service.getSize() }}
m²
</td>
</tr>
{% endif %}
{% if accommodationProduct.getAdultsMin() is not null and accommodationProduct.getChildrenMax() is not null %}
<tr>
<th class="font-default">{{ 'demi.detail.room.occupancy' | trans }}</th>
<td class="font-medium">
{% set adults = accommodationProduct.getAdultsMin() %}
{% if accommodationProduct.getAdultsMax() != adults %}
{% set adultsStr = adults ~ " - " ~ accommodationProduct.getAdultsMax() ~ " " ~ 'demi.detail.room.occupancy.adults' | trans %}
{% else %}
{% set adultsStr = adults ~ " " ~ (adults > 1 ? 'demi.detail.room.occupancy.adults' : 'demi.detail.room.occupancy.adult') | trans %}
{% endif %}
{% set children = accommodationProduct.getChildrenMax() %}
{% if accommodationProduct.getChildrenMin() != children %}
{% set childrenStr = accommodationProduct.getChildrenMin() ~ " - " ~ accommodationProduct.getChildrenMax() ~ " " ~ 'demi.detail.room.occupancy.children' | trans %}
{% else %}
{% set childrenStr = accommodationProduct.getChildrenMin() ~ " " ~(accommodationProduct.getChildrenMin() > 1 ? 'demi.detail.room.occupancy.children' : 'demi.detail.room.occupancy.child') | trans %}
{% endif %}
{{ adultsStr }}
{% if children > 0 %}
, {{ childrenStr }}
{% endif %}
</td>
</tr>
{% endif %}
{% if service is instanceof("\\Pimcore\\Model\\DataObject\\DemiAccommodationService") and service.getRooms() > 0 %}
<tr>
<th class="font-default">{{ 'demi.detail.room.amount-rooms' | trans }}</th>
<td class="font-medium">{{ service.getRooms() }}</td>
</tr>
{% endif %}
{% if service is instanceof("\\Pimcore\\Model\\DataObject\\DemiAccommodationService") and service.getBedrooms() > 0 %}
<tr>
<th class="font-default">{{ 'demi.detail.room.amount-bedrooms' | trans }}</th>
<td class="font-medium">{{ service.getBedrooms() }}</td>
</tr>
{% endif %}
</tbody>
</table>