src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/teaser/room-details-table.html.twig line 1

Open in your IDE?
  1. {#
  2. /**
  3.  * @var \Pimcore\Templating\PhpEngine this
  4.  * @var \Pimcore\Templating\PhpEngine view
  5.  * @var \Pimcore\Templating\GlobalVariables app
  6.  *
  7.  * @var \Pimcore\Model\DataObject\DemiAccommodationService service
  8.  * @var \Elements\Demi\Model\AccommodationProduct accommodationProduct
  9.  */
  10. #}
  11. <table class="table table-sm table-striped">
  12.     <tbody>
  13.     {% if service is instanceof("\\Pimcore\\Model\\DataObject\\DemiAccommodationService") and service.getSize() > 0 %}
  14.         <tr>
  15.             <th class="font-default">{{ 'demi.detail.room.size' | trans }}</th>
  16.             <td class="font-medium">{{ service.getSize() }}
  17.                 m²
  18.             </td>
  19.         </tr>
  20.     {% endif %}
  21.     {% if accommodationProduct.getAdultsMin() is not null and accommodationProduct.getChildrenMax() is not null %}
  22.         <tr>
  23.             <th class="font-default">{{ 'demi.detail.room.occupancy' | trans }}</th>
  24.             <td class="font-medium">
  25.                 {% set adults = accommodationProduct.getAdultsMin() %}
  26.                 {% if accommodationProduct.getAdultsMax() != adults %}
  27.                     {% set adultsStr = adults ~ " - " ~ accommodationProduct.getAdultsMax() ~ " " ~ 'demi.detail.room.occupancy.adults' | trans %}
  28.                 {% else %}
  29.                     {% set adultsStr = adults ~ " " ~ (adults > 1 ? 'demi.detail.room.occupancy.adults' : 'demi.detail.room.occupancy.adult') | trans %}
  30.                 {% endif %}
  31.                 {% set children = accommodationProduct.getChildrenMax() %}
  32.                 {% if accommodationProduct.getChildrenMin() != children %}
  33.                     {% set childrenStr = accommodationProduct.getChildrenMin() ~ " - " ~ accommodationProduct.getChildrenMax() ~ " " ~ 'demi.detail.room.occupancy.children' | trans %}
  34.                 {% else %}
  35.                     {% set childrenStr = accommodationProduct.getChildrenMin() ~ " " ~(accommodationProduct.getChildrenMin() > 1 ? 'demi.detail.room.occupancy.children' : 'demi.detail.room.occupancy.child') | trans  %}
  36.                 {% endif %}
  37.                 {{ adultsStr }}
  38.                 {% if children > 0 %}
  39.                     , {{ childrenStr }}
  40.                 {% endif %}
  41.             </td>
  42.         </tr>
  43.     {% endif %}
  44.     {% if service is instanceof("\\Pimcore\\Model\\DataObject\\DemiAccommodationService") and service.getRooms() > 0 %}
  45.         <tr>
  46.             <th class="font-default">{{ 'demi.detail.room.amount-rooms' | trans }}</th>
  47.             <td class="font-medium">{{ service.getRooms() }}</td>
  48.         </tr>
  49.     {% endif %}
  50.     {% if service is instanceof("\\Pimcore\\Model\\DataObject\\DemiAccommodationService") and service.getBedrooms() > 0 %}
  51.         <tr>
  52.             <th class="font-default">{{ 'demi.detail.room.amount-bedrooms' | trans }}</th>
  53.             <td class="font-medium">{{ service.getBedrooms() }}</td>
  54.         </tr>
  55.     {% endif %}
  56.     </tbody>
  57. </table>