src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/teaser/room-details.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. #}
  8. {% set package = package is defined ? package : null %}
  9. <div id="detail-{{ id }}" class="collapse" aria-expanded="false" data-parent="#room-row-collapse-parent-{{ id }}">
  10.     {% if pimcore_device().isPhone() %}
  11.         <hr class="m-0">
  12.     {% endif %}
  13.     <div class="{{ pimcore_device().isPhone() ? 'card-body' : 'room-selection-box border-top-0' }}">
  14.         <div class="{{ pimcore_device().isPhone() ? '' : 'row' }}">
  15.             <div class="{{ pimcore_device().isPhone() ? '' : 'col-6' }}">
  16.                 {% if not pimcore_device().isPhone() %}
  17.                     <h4 class="text-primary">{{ "demi.detail.room-details" | trans }}</h4>
  18.                 {% endif %}
  19.                 {% set service = accommodationProduct.getService() %}
  20.                 {% if availabilityIsChecked or pimcore_device().isPhone() and (moreRoomRows is not defined or moreRoomRows is null) %}
  21.                     {{ include("@ElementsDemiFrontend/Includes/teaser/room-details-table.html.twig", {
  22.                         "accommodationProduct" : accommodationProduct,
  23.                         'service' : service
  24.                     }) }}
  25.                 {% endif %}
  26.                 {% set productText = accommodationProduct.getDescription(null, app.request.getLocale(), dateFrom) %}
  27.                 {% if productText is empty %}
  28.                     {% set productText = accommodationProduct.getDescription(null, demi_core_configuration("getFallbackLanguage", {}), dateFrom) %}
  29.                 {% endif %}
  30.                 {% set serviceText = service ? service.getDescription(null, app.request.getLocale(), dateFrom) : null %}
  31.                 {% if serviceText is empty %}
  32.                     {% set serviceText = service ? service.getDescription(null, demi_core_configuration("getFallbackLanguage", {}), dateFrom) : null %}
  33.                 {% endif %}
  34.                 {% set facilities = demi_prepareFacilityArrayFromService(service) %}
  35.                 <div class="wysiwyg mt-2">
  36.                     <p>{{ serviceText|raw }}</p>
  37.                     <p>{{ productText|raw }}</p>
  38.                 </div>
  39.                 {% for groupname, facilitynames in facilities %}
  40.                     <div class="wysiwyg">
  41.                         <h5 class="text-primary mt-3">{{ groupname }}</h5>
  42.                         <p>{{ facilitynames | join(", ") }}</p>
  43.                     </div>
  44.                 {% endfor %}
  45.             </div>
  46.             {% if pimcore_device().isPhone() and images | length > 1 %}
  47.                 {% set galleryString = 'demi.detail.room.image-gallery-button' | trans %}
  48.                 {% set galleryString =  galleryString | replace({'[AMOUNT_IMAGES]': images | length}) %}
  49.                 <div class="mt-2">
  50.                     <button type="button" class="btn btn-primary js-overlay__toggle js-tracking--click-piwik"
  51.                             data-target="#{{ id }}-imgs-overlay"
  52.                             data-tracking-category="Gallery"
  53.                             data-tracking-action="open">
  54.                         {{ galleryString }}
  55.                     </button>
  56.                 </div>
  57.             {% else %}
  58.                 {% set galleryString = 'demi.detail.images-gallery-button' | trans %}
  59.                 {% set galleryString = galleryString | replace({'[AMOUNT_IMAGES]': ''}) %}
  60.                 {% set lightboxTopBarUrl = url('demi_lightbox_topbar_content', {
  61.                     'path' : document.getFullPath() | trim('/' , 'left')
  62.                 }) %}
  63.                 <div class="col-6" {{ images | length is same as 1 ? 'hidden' : '' }}>
  64.                     <h4 class="text-primary">{{ galleryString }}</h4>
  65.                     <div class="row row--gutter-width-1 row--vertical-gutter-1 js-lightbox-group" id="{{ id }}-lightbox"
  66.                          data-lightbox-topbar-wrapper="#lightboxTopBar"
  67.                          data-lightbox-topbar-content-url="{{ lightboxTopBarUrl }}?id={{ accommodation.getId() }}{{ accommodationProduct.getPackageMaster() ? '&pid=' ~ accommodationProduct.getPackageMaster().getId() : '' }}{{ package is instanceof ("\\Elements\\Demi\\Model\\Package") ? '&tid=' ~ package.getId() : '' }}">
  68.                         {% for image in images %}
  69.                             <div class="col-6">
  70.                             {% if image %}
  71.                                 <a href="{{ image.getThumbnail('demi-desktop-gallery-overlay') }}"
  72.                                    aria-label="{{ "demi.detail.open-gallery" | trans }}"
  73.                                    class="embed-responsive embed-responsive-3by2 js-lightbox-group__item"
  74.                                    data-lightbox-thumb="{{ image.getThumbnail('demi-desktop-gallery-small') }}"
  75.                                    data-sub-html="{{ demi_getNameAndCopyrightForImage(image) }}">
  76.                                     <img class="embed-responsive-item js-lazy-img js-lazy-img--img"
  77.                                          data-src="{{ image.getThumbnail('demi-desktop-room-details') }}"
  78.                                          alt="{{ image.getMetadata('alt') }}" title="{{ image.getMetadata('title') }}">
  79.                                     <div class="btn-show-gallery btn-no-styling"
  80.                                          title="{{ "demi.detail.open-gallery" | trans }}">
  81.                                         <span class="demi-icon demi-icon-search btn-show-gallery__icon"
  82.                                               aria-hidden="true"></span>
  83.                                     </div>
  84.                                 </a>
  85.                             {% endif %}
  86.                             </div>
  87.                         {% endfor %}
  88.                     </div>
  89.                 </div>
  90.             {% endif %}
  91.         </div>
  92.     </div>
  93. </div>