src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/teaser/offer-teaser.desktop.html.twig line 1

Open in your IDE?
  1. {% set serviceProvider = destinationPackage is defined ? demi_getServiceProviderForPackage(destinationPackage) : null %}
  2. {% set trackingServiceProvider = trackingServiceProvider is defined ? trackingServiceProvider : null %}
  3. {% set destinationPackage = destinationPackage is defined ? destinationPackage : null %}
  4. {#
  5. //for gallery
  6. // no search date - no date for images
  7. #}
  8. {%  set fromDate = searchParam is not defined or searchParam.isNoDate() ? null : demi_getSearchFrom() %}
  9. {% set imageGalleryId = "id_" ~ id %}
  10. {% set lightboxTopBarUrl = demi_demiUrl({'path': document.getFullPath()}, "demi_lightbox_topbar_content") %}
  11. {% set gallerySrcUrl = demi_demiUrl({
  12.     'path': 'demi',
  13.     'objectId': id,
  14.     'thumbnail': 'demi-desktop-gallery',
  15.     'thumbSmall': 'demi-desktop-gallery-small',
  16.     'dateFrom': fromDate is not null ? fromDate.getTimestamp() : ''
  17. }, "demi_images") %}
  18. {%  set firstImageUrl = demi_demiUrl({
  19.     'path': 'demi',
  20.     'objectId': id,
  21.     'thumbnail': 'demi-desktop-offer-list-teaser',
  22.     'dateFrom': fromDate is not null ? fromDate.getTimestamp() : ''
  23. }, "demi_image") %}
  24. <section class="card bordered h-100 isClickable js-tracking js-tracking--detail-link-click js-tracking--impression  {% if destinationPackage is not null and  destinationPackage.getClassName() == 'demiPackage' %} card--package {% endif %}"
  25.          {%  if accommodation is defined and accommodation is not null %}
  26.          data-tracking-name="{{ demi_impressionName(accommodation) }}"
  27.          data-tracking-id="{{ accommodation.getId() }}"
  28.          data-tracking-category="{{ demi_impressionCategory(serviceProvider is not null ? serviceProvider : trackingServiceProvider ,destinationPackage,searchParam,null,destinationPackage) }}"
  29.          data-tracking-position="{{ position }}"
  30.          data-tracking-brand="{{ demi_impressionBrand(serviceProvider is not null ? serviceProvider : trackingServiceProvider) }}"
  31.          data-tracking-list="{{ constant('Elements\\Bundle\\DemiFrontendBundle\\Service\\Tracking::LIST_LIST') }} {{ constant('Elements\\Bundle\\DemiFrontendBundle\\Service\\Tracking::LIST_PACKAGE_ACCODETAIL') }}"
  32.          {% endif %}
  33.          data-tracking-price="{{ price | number_format(2, '.', '') }}"
  34. >
  35.     <div class="card-body d-flex flex-column">
  36.         <script type="text/javascript" data-cookieconsent="ignore">
  37.             _config.lightbox = true;
  38.             _config.lazyImg = true;
  39.         </script>
  40.         {% if img is defined and img is not null %}
  41.             <div class="embed-responsive embed-responsive-3by2">
  42.                     {{ img.getThumbnail('demi-desktop-offer-list-teaser').getHtml({'imgAttributes': {"class":"embed-responsive-item"}})|raw }}
  43.                {% if useGal and accommodation is defined and accommodation is not null %}
  44.                 <button type="button" class="btn-show-gallery btn-no-styling js-lightbox-group-dyn"
  45.                         aria-label="{{ 'demi.detail.open-gallery'|trans }}"
  46.                         title="{{ 'demi.detail.open-gallery'|trans }}"
  47.                         data-lightbox-id="{{ imageGalleryId }}"
  48.                         data-lightbox-src-url="{{ gallerySrcUrl }}"
  49.                         data-lightbox-topbar-content-url="{{ lightboxTopBarUrl }}?ajax=1&id={{ accommodation.getId() }}{% if destinationPackage is not null and destinationPackage.getClassName() == 'demiPackage' %} &tid={{ id }}{% else %}&pid={{ id }}{% endif %}"
  50.                         data-lightbox-topbar-wrapper="#lightboxTopBar"
  51.                         data-sub-html="{{ demi_getNameAndCopyrightForImage(img) }}">
  52.                     <span class="js-lightbox-group-dyn__icon demi-icon demi-icon-search btn-show-gallery__icon" aria-hidden="true"></span>
  53.                     <span class="js-lightbox-group-dyn__loading" hidden>
  54.                             <span class="text-center d-block">
  55.                             <span class="circle-spinner circle-spinner--white"
  56.                                   aria-label="{{ 'demi.content-loading'|trans }}"
  57.                                   title="{{ 'demi.content-loading'|trans }}"></span>
  58.                             </span>
  59.                         </span>
  60.                 </button>
  61.                 {% endif %}
  62.             </div>
  63.         {% endif %}
  64.         <h4 class="text-primary mb-1 mt-3">
  65.             <a href="{{ href }}">{{ title }}</a>
  66.         </h4>
  67.         {% if text is defined %}
  68.         <div class="mb-2">
  69.             {{ text|raw }}
  70.         </div>
  71.         {% endif %}
  72.         <div class="mb-2 mt-auto"><hr class="hr--border-gray m-0"></div>
  73.         <div class="row  align-items-center">
  74.             <div class="col">
  75.                 {% if priceInfo is defined %}
  76.                     <div class="small text-muted">
  77.                         {{ priceInfo | raw }}
  78.                     </div>
  79.                 {% endif %}
  80.                 {% if specialPrice is defined %}
  81.                     <div class="small text-muted">
  82.                         {{ specialPrice | raw }}
  83.                     </div>
  84.                 {% endif %}
  85.             </div>
  86.             {%  if price > 0 %}
  87.             <div class="col col-auto">
  88.                 <a href="{{ href }}" class="btn btn-success">{{ 'demi.price-from-short'|trans }} <strong class="fz17 price">{{ demi_paymentGetPriceObject(price, serviceProvider) }}</strong></a>
  89.             </div>
  90.             {% endif %}
  91.         </div>
  92.     </div>
  93. </section>