templates/pages/_includes/partials/_offer_popup.html.twig line 1

Open in your IDE?
  1. {# Popup d'offre spéciale qui s'affiche au survol de div.offer #}
  2. {# Usage: include ce template dans une boucle for offer, juste après <div class="offer"> #}
  3. {% set media = crea_media_get_media(['banner'], offer) %}
  4. {% if offer is defined %}
  5. <div class="popup popup--offer" style="position: fixed; top: -9999px; left: -9999px; opacity: 0; visibility: hidden;">
  6. <button type="button" class="popup__close" data-popup-close aria-label="{{ 'list.cruise_card.close_offer'|trans }}">
  7. {{ getLucidIcon('x') }}
  8. </button>
  9. {% if media.cdnUrl is defined and media.cdnUrl is not empty %}
  10. <div class="popup__image">
  11. <img src="{{ media.cdnUrl|default('/img/placeholder-company.svg') }}" alt="{{ offer.displayedName|default('snippets.offers.special_offer'|trans) }}">
  12. {% if offer.offerCategory.icon is defined and offer.offerCategory.icon is not empty %}
  13. <div class="popup__icon" style="background-color: {{ offer.offerCategory.colorFill|default('#000000') }}; color: {{ offer.offerCategory.colorFont|default('#FFFFFF') }};">
  14. {{ getLucidIcon(offer.offerCategory.icon) }}
  15. </div>
  16. {% endif %}
  17. </div>
  18. {% endif %}
  19. {% set popupTitle = offer.displayedName|default(offer.name|default('')) %}
  20. {% set popupShort = offer.shortDescription|default('') %}
  21. {% set popupDescription = offer.description|default('') %}
  22. {% set popupConditions = offer.conditions|default('') %}
  23. {% set titleColor = offer.offerCategory.colorFont|default('') %}
  24. {% if titleColor is empty or titleColor|lower in ['#fff', '#ffffff', 'white'] %}
  25. {% set titleColor = 'inherit' %}
  26. {% endif %}
  27. <div class="popup__content">
  28. {% if popupTitle is not empty %}
  29. <div class="popup__title" style="color: {{ titleColor }}">
  30. {{ popupTitle|raw }}
  31. </div>
  32. {% endif %}
  33. {% if popupShort is not empty %}
  34. <div class="popup__short-description">
  35. {{ popupShort|raw }}
  36. </div>
  37. {% endif %}
  38. {% if popupDescription is not empty %}
  39. <div class="popup__description">
  40. {{ popupDescription|raw }}
  41. </div>
  42. {% endif %}
  43. {% if popupConditions is not empty %}
  44. <div class="popup__cgu color-price-tags-primary">
  45. {{ popupConditions|raw }}
  46. </div>
  47. {% endif %}
  48. </div>
  49. </div>
  50. {% endif %}