src/Aqarmap/Bundle/ListingBundle/Resources/views/Listing/listingSlider.html.twig line 1

Open in your IDE?
  1. {% set isEnabledCTAslide = isEnabledFeature('web.slider.lead.cta') and not isMobile %}
  2. {% set isEnabledListingVideo = listing.videoUrl is not empty %}
  3. {% set sliderCounterContainer = "<label class='count-text' id='sliderCounter'></label>" %}
  4. {% set listingOwner = listing.user %}
  5. {% set isListingOwnerLogoDefined = listingOwner is defined and listingOwner.logo %}
  6. {% set hasListingOwnerLogo = isEnabledFeature('web.listing.customer.logo.on.photo') and isListingOwnerLogoDefined %}
  7. {% set iconSize = 24 %}
  8. {% if isListingSliderDisabledTest %}
  9.     {% if hasListingOwnerLogo %}
  10.         {% set photoPath = generatePhotoWithLogo(listing.mainPhoto.file, listingOwner.logo)|thumbnail('slider-photo-watermarked-logo-large') %}
  11.         {% set photoPathWebp = generatePhotoWithLogo(listing.mainPhoto.file, listingOwner.logo)|thumbnail('slider-photo-watermarked-logo-large-webp') %}
  12.     {% else %}
  13.         {% set photoPath = custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('slider-photo-watermarked-large') %}
  14.         {% set photoPathWebp = custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('slider-photo-watermarked-large-webp') %}
  15.     {% endif %}
  16.     <div class="embed-responsive embed-responsive-4by3">
  17.         <div class="embed-responsive-item">
  18.             <picture>
  19.                 <source srcset="{{ photoPathWebp }}" type="image/webp">
  20.                 <source srcset="{{ photoPath }}" type="image/jpg">
  21.                 <img itemprop="photo"
  22.                     fetchpriority="high"
  23.                     class="img-responsive w-100 h-100"
  24.                     width="100" height="100"
  25.                 />
  26.             </picture>
  27.         </div>
  28.     </div>
  29. {% else %}
  30.     <div id="ListingImageSlider">
  31.         <div class="listing-photo-slider listing-photo-slider__cloning-container embed-responsive embed-responsive-4by3">
  32.             <div class="owl-buttons listing-photo-slider__owl-buttons">
  33.                 <button class="owl-prev owl-carousel-prev owl-buttons__circled">
  34.                     <i class="fa fa-chevron-left"></i>
  35.                 </button>
  36.                 <button class="owl-next owl-carousel-next owl-buttons__circled">
  37.                     <i class="fa fa-chevron-right"></i>
  38.                 </button>
  39.                 <div class="zoom-buttons-container">
  40.                     <button class="zoom-buttons-container__button" id="zoom-in" onclick="imageSlider.zoomin()">
  41.                         <img src="{{ asset('images/zoomin.svg') }}" width="{{ iconSize }}" height="{{ iconSize }}">
  42.                     </button>
  43.                     <button class="zoom-buttons-container__button" id="zoom-out" onclick="imageSlider.zoomout()">
  44.                         <img src="{{ asset('images/zoomout.svg') }}" width="{{ iconSize }}" height="{{ iconSize }}">
  45.                     </button>
  46.                 </div>
  47.             </div>
  48.             <div class="embed-responsive-item listing-photo-slider__container" id="sliderWrapper">
  49.                 <div class="owl-carousel owl-image-carousel owl-theme">
  50.                     {% for photo in listing.photosForSlider %}
  51.                         {% set isDisabledLazyLoadImgIndex = loop.index == 1 %}
  52.                         <div class="item" data-dot="{{ sliderCounterContainer }}">
  53.                             {% if hasListingOwnerLogo %}
  54.                                 {% set photoPath = generatePhotoWithLogo(photo.file, listingOwner.logo)|thumbnail('slider-photo-watermarked-logo-large') %}
  55.                                 {% set photoPathWebp = generatePhotoWithLogo(photo.file, listingOwner.logo)|thumbnail('slider-photo-watermarked-logo-large-webp') %}
  56.                             {% else %}
  57.                                 {% set photoPath = custom_vich_uploader_asset(photo.file, 'file')|thumbnail('slider-photo-watermarked-large') %}
  58.                                 {% set photoPathWebp = custom_vich_uploader_asset(photo.file, 'file')|thumbnail('slider-photo-watermarked-large-webp') %}
  59.                             {% endif %}
  60.                             {% if isDisabledLazyLoadImgIndex %}
  61.                                 <picture>
  62.                                     <source srcset="{{ photoPathWebp }}" type="image/webp">
  63.                                     <source srcset="{{ photoPath }}" type="image/jpg">
  64.                                     <img itemprop="photo"
  65.                                         fetchpriority="high"
  66.                                         class="img-responsive"
  67.                                         alt="{{ photo.caption }}"
  68.                                         onclick="imageSlider.openListingSlider()"
  69.                                         ng-click="setIsMobileSliderOpen('true')"
  70.                                     />
  71.                                 </picture>
  72.                             {% else %}
  73.                                 <picture>
  74.                                     <source data-srcset="{{ photoPathWebp }}" type="image/webp">
  75.                                     <source data-srcset="{{ photoPath }}" type="image/jpg">
  76.                                     <img itemprop="photo"
  77.                                         src="/images/placeholder.svg"
  78.                                         class="img-responsive lazyload"
  79.                                         alt="{{ photo.caption }}"
  80.                                         fetchpriority="low"
  81.                                         onclick="imageSlider.openListingSlider()"
  82.                                         ng-click="setIsMobileSliderOpen('true')"
  83.                                     />
  84.                                 </picture>
  85.                             {% endif %}
  86.                         </div>
  87.                         {% if loop.last %}
  88.                             {% if isEnabledListingVideo %}
  89.                                 <div class="item item-video" data-dot="{{ sliderCounterContainer }}">
  90.                                     {% set youtubeId = getYoutubeVideoCode(listing.videoUrl|raw) %}
  91.                                     <a class="owl-video" href="https://www.youtube.com/embed/{{youtubeId}}"></a>
  92.                                 </div>
  93.                             {% endif %}
  94.                             {% if isEnabledCTAslide %}
  95.                                 <div class="item" data-dot="{{ sliderCounterContainer }}">
  96.                                     <picture>
  97.                                         <source data-srcset="{{ photoPathWebp }}" type="image/webp">
  98.                                         <source data-srcset="{{ photoPath }}" type="image/jpg">
  99.                                         <img itemprop="photo"
  100.                                             src="/images/placeholder.svg"
  101.                                             class="img-responsive lazyload"
  102.                                             alt="{{ photo.caption }}"
  103.                                             fetchpriority="low"
  104.                                         />
  105.                                     </picture>
  106.                                 </div>
  107.                             {% endif %}
  108.                         {% endif %}
  109.                     {% endfor %}
  110.                 </div>
  111.                 {% if isEnabledCTAslide %}
  112.                     <div class="cta-buttons" id="sliderCTA">
  113.                         {% include '@AqarmapListingBundle/Listing/ctaSliderView.html.twig' %}
  114.                     </div>
  115.                 {% endif %}
  116.             </div>
  117.         </div>
  118.     </div>
  119.     <div class="mobileSlider">
  120.         <div id="listingSliderModal" class="modal listing-slider-modal" role="dialog">
  121.             <div class="modal-header modal-lg border-0 position-absolute w-100">
  122.                 <div>
  123.                     <button onclick="imageSlider.closeListingSlider()" type="button" class="close-modal" ng-click="setIsMobileSliderOpen('false')">
  124.                         <img src="{{ asset('images/close.svg') }}" width="{{ iconSize }}" height="{{ iconSize }}">
  125.                     </button>
  126.                 </div>
  127.             </div>
  128.             <div class="modal-body p-0">
  129.                 <div class="modal-slider-container d-flex align-items-center">
  130.                     <div id="fullScreenImageSlider" class="listing-photo-slider__full-screen-container">
  131.                     </div>
  132.                 </div>
  133.             </div>
  134.         </div>
  135.     </div>
  136. {% endif %}