templates/front/heroes/hero-edito.html.twig line 1

Open in your IDE?
  1. {% set breadcrumbTheme = 'reg' %}
  2. {% set isPicto = false %}
  3. {% set mainClass = '' %}
  4. {% if page.type == 'study' %}
  5.     {% set contentType = 'Étude' %}
  6. {% elseif page.type == 'activity-report' %}
  7.     {% set contentType = 'Rapport d\'activité' %}
  8. {% elseif page.type == 'thematic-brochure' %}
  9.     {% set contentType = 'Plaquette thématique' %}
  10.     {% set breadcrumbTheme = 'orange-dark' %}
  11.     {% set bgColor = true %}
  12.     {% set isPicto = true %}
  13.     {% set roundColor = 'bg-orange-hover' %}
  14.     {% set mainClass = 'hero-edito--picto hero-edito--bg bg-orange' %}
  15. {% elseif page.type == 'practical-guide' or page.type == 'faq' %}
  16.     {% set contentType = 'Note adhérent' %}
  17.     {% set breadcrumbTheme = 'white' %}
  18.     {% set bgColor = true %}
  19.     {% set isPicto = true %}
  20.     {% set roundColor = 'bg-violet-darker' %}
  21.     {% set mainClass = 'hero-edito--picto hero-edito--bg bg-violet-dark' %}
  22. {% elseif page.type == 'btob-news' %}
  23.     {% set contentType = 'BtoB news' %}
  24. {% elseif page.type == 'barometer-activity' %}
  25.     {% set contentType = 'Baromètre d\'activité' %}
  26. {% elseif page.type == 'article' %}
  27.     {% set contentType = 'Actualité' %}
  28.     {% set mainClass = 'hero-edito--news' %}
  29. {% elseif page.type == 'event' %}
  30.     {% set breadcrumbTheme = 'white' %}
  31.     {% set bgColor = true %}
  32.     {% set mainClass = 'hero-edito--bg bg-violet hero-edito--event' %}
  33.     {% set contentType = 'événement' %}
  34. {% elseif page.type == 'agenda' %}
  35.     {% set breadcrumbTheme = 'white' %}
  36.     {% set bgColor = true %}
  37.     {% set mainClass = 'hero-edito--bg bg-violet hero-edito--event' %}
  38.     {% set contentType = 'Agenda CGF' %}
  39. {% endif %}
  40. {% set isPublication = page.template == 'publication' %}
  41. {% set isNewsEvent = page.template == 'news' %}
  42. <div class="hero-edito {{ mainClass }}">
  43.     <div class="fluid-grid relative">
  44.         <div class="row">
  45.             <div class="col-12 lg-col-6 lg:py-13 {{ isPublication or isNewsEvent ? 'hero-edito__side-left' ~ page.type == 'event' or page.type == 'agenda' ? ' hero-edito__side-left--bg' : '' : '' }}">
  46.                 {% include 'front/partials/breadcrumb.html.twig' with {theme: breadcrumbTheme } %}
  47.                 <div class="{{ isPublication or isNewsEvent ? 'mt-8 md:mt-16' : 'mt-6 md:mt-12 lg:mt-20' }}">
  48.                     {# tags #}
  49.                     {% if contentType is defined %}
  50.                         <ul class="hero-edito__tags">
  51.                             <li><span class="tag">{{ contentType }}</span></li>
  52.                             {% if page.type == 'faq' %}
  53.                                 <li><span class="tag tag--orange">Communication</span></li>
  54.                             {% endif %}
  55.                             {% for tag in page.tags %}
  56.                             <li><span class="tag tag--orange">{{ tag }}</span></li>
  57.                             {% endfor %}
  58.                             {% if properties.isMemberOnly %}
  59.                             <li>
  60.                                 <span class="tag tag--adherent">
  61.                                     <svg width="10" height="13" class="mr-1 icon--violet">
  62.                                         <use href="#icon-lock" xlink:href="#icon-lock"></use>
  63.                                     </svg>
  64.                                     Adhérent
  65.                                 </span>
  66.                             </li>
  67.                             {% endif %}
  68.                         </ul>
  69.                     {% endif %}
  70.                     {% if page.title is defined and page.title is not null %}
  71.                     <h1 class="title {{ page.type in ['agenda', 'event'] ? 'title--M-bis' : 'title--XL' }} font-weight-semibold {{ bgColor is defined ? 'text-white' : 'text-violet' }}">
  72.                         {{ page.title | remove_brackets | trim }}
  73.                     </h1>
  74.                     {% endif %}
  75.                     
  76.                     {% if page.description is defined and page.description is not null %}
  77.                     <div class="paragraph wysiwyg paragraph--L mt-6 hero-edito__chapo">
  78.                         {{ page.description|raw }}
  79.                     </div>
  80.                     {% endif %}
  81.                     {% if properties.publicationDate is defined and properties.publicationDate is not null and page.type not in ['agenda', 'event'] %}
  82.                         <p class="text-13 flex items-center font-medium mt-5">
  83.                             <svg width="12" height="12"
  84.                                 class="mr-2 {{ page.type == 'practical-guide' ? 'icon--white' :  'icon--violet' }}">
  85.                                 <use href="#icon-hour" xlink:href="#icon-hour"></use>
  86.                             </svg>
  87.                             <span>Publié le <span class="font-bold {{ bgColor is defined ? 'text-white' : 'text-violet' }}">{{ properties.publicationDate.date|date('d.m.Y') }}</span></span>
  88.                         </p>
  89.                     {% endif %}
  90.                     {% if properties.place is defined and properties.place is not null %}
  91.                     <div class="flex mt-5 hero-edito__location">
  92.                         <svg width="14" height="20" class="mr-2 icon--orange flex-shrink-0">
  93.                             <use href="#icon-pin" xlink:href="#icon-pin"></use>
  94.                         </svg>
  95.                         <span class="font-medium text-15">À <span class="font-bold">{{ properties.place }}</span></span>
  96.                     </div>
  97.                     {% endif %}
  98.                 </div>
  99.             </div>
  100.             <div class="col-12 lg-col-6 relative {{ page.type in ['agenda', 'event'] ? 'self-start' : '' }} {{ page.type not in ['article', 'agenda', 'event' ] ? 'hero__right' : '' }} order-first lg:order-last">
  101.                 {% if page.type not in ['article', 'agenda', 'event' ] %}
  102.                 <div class="hero__pic-wrap {{ isPicto ? roundColor : '' }}">
  103.                     {% if properties.image.singleMedia is defined and properties.image.singleMedia.publicId is not null %}
  104.                         <picture>
  105.                             <source media="(max-width: 420px)"
  106.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_390,h_282') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_390,h_282,dpr_2') }} 2x">
  107.                             <source media="(max-width: 767px)"
  108.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_740,h_558') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_740,h_558,dpr_2') }} 2x">
  109.                             <source media="(max-width: 1023px)"
  110.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_990,h_758') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_990,h_758,dpr_2') }} 2x">
  111.                             <source media="(max-width: 1279px)"
  112.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_858,h_858') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_858,h_858,dpr_2') }} 2x">
  113.                             <source media="(min-width: 1280px)"
  114.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_962,h_962') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_962,h_962,dpr_2') }} 2x">
  115.                             <img class="object-fit-image absolute" height="962" width="962"
  116.                                  src="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,q_auto,c_fill,w_962,h_962') }}"
  117.                                  alt="{{ properties.image.singleMedia.alt }}">
  118.                         </picture>
  119.                     {% endif %}
  120.                     {% if isPublication and page.type == 'thematic-brochure'  or page.type == 'practical-guide' or page.type == 'faq' %}
  121.                         {% if page.type == 'thematic-brochure' %}
  122.                             <svg width="125" height="172">
  123.                                 <use href="#icon-publication-brochure" xlink:href="#icon-publication-brochure"></use>
  124.                             </svg>
  125.                         {% else %}
  126.                             <svg width="185" height="130">
  127.                                 <use href="#icon-publication-guide" xlink:href="#icon-publication-guide"></use>
  128.                             </svg>
  129.                         {% endif %}
  130.                     {% endif %}
  131.                 </div>
  132.                 {% elseif page.type in ['agenda', 'event'] %}
  133.                     <div class="hero-edito__event-wrap">
  134.                         <picture>
  135.                             <source media="(max-width: 420px)"
  136.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_388,h_274') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_388,h_274,dpr_2') }} 2x">
  137.                             <source media="(max-width: 767px)"
  138.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_735,h_560') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_735,h_560,dpr_2') }} 2x">
  139.                             <source media="(max-width: 1023px)"
  140.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_991,h_755') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_991,h_755,dpr_2') }} 2x">
  141.                             <source media="(max-width: 1279px)"
  142.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_640,h_488') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_640,h_488,dpr_2') }} 2x">
  143.                             <source media="(min-width: 1280px)"
  144.                                     srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_708,h_540') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_708,h_540,dpr_2') }} 2x">
  145.                             <img class="w-full" height="708" width="540"
  146.                                     src="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,q_auto,c_fill,w_708,h_540') }}"
  147.                                     alt="{{ properties.image.singleMedia.alt }}">
  148.                         </picture>
  149.                     </div>
  150.                     <div class="hero-edito__date">
  151.                         <span>{{ properties.startEventDate.date|date("d.m") }}</span>
  152.                         {% if properties.endEventDate is defined and properties.endEventDate is not empty %}
  153.                             <span>{{ properties.endEventDate.date|date("d.m") }}</span>
  154.                             <span class="year">{{ properties.endEventDate.date|date("Y") }}</span>
  155.                         {% else %}
  156.                             <span class="year">{{ properties.startEventDate.date|date("Y") }}</span>
  157.                         {% endif %}
  158.                     </div>
  159.                     {% if properties.registerLink is defined and properties.registerLink is not null %}
  160.                         <a href="{{ properties.registerLink }}" target="_blank" rel="nofollow" class="hero-edito__register">
  161.                             <svg width="32" height="29" class="icon--white">
  162.                                 <use href="#icon-calendar" xlink:href="#icon-calendar"></use>
  163.                             </svg>
  164.                             <span class="sr-only">S'inscrire à l'évènement</span>
  165.                         </a>
  166.                     {% endif %}
  167.                 {% else %}
  168.                     <picture>
  169.                         <source media="(max-width: 420px)"
  170.                                 srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_356,h_356') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_356,h_356,dpr_2') }} 2x">
  171.                         <source media="(max-width: 767px)"
  172.                                 srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_703,h_703') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_703,h_703,dpr_2') }} 2x">
  173.                         <source media="(max-width: 1023px)"
  174.                                 srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_950,h_950') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_950,h_950,dpr_2') }} 2x">
  175.                         <source media="(max-width: 1279px)"
  176.                                 srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_592,h_592') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_592,h_592,dpr_2') }} 2x">
  177.                         <source media="(min-width: 1280px)"
  178.                                 srcset="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_664,h_664') }} 1x, {{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,c_fill,q_auto,w_664,h_664,dpr_2') }} 2x">
  179.                         <img class="w-full rounded-lg mt-20 md:mt-23" height="664" width="664"
  180.                                 src="{{ cloudinary_media(properties.image.singleMedia, 'fl_progressive,f_auto,q_auto,c_fill,w_664,h_664') }}"
  181.                                 alt="{{ properties.image.singleMedia.alt }}">
  182.                     </picture>
  183.                 {% endif %}
  184.                 {% if properties.document.singleMedia.publicId is defined and properties.document.singleMedia.publicId is not null %}
  185.                     {% set isHidden = properties.isMemberOnly and app.user == null %}
  186.                     {% if not isHidden %}
  187.                     <a onclick="gtag('event', 'telecharger-publication', {'button_text': 'telecharger-publication'});" target="_blank" href="{{ cloudinary_media(properties.document.singleMedia) }}" class="hero-edito__dl {{ isPicto ? 'hero-edito__dl--picto' : '' }}">
  188.                         <span class="icon-center">
  189.                             Télécharger <br/> le document
  190.                         </span>
  191.                         <span class="icon-center">
  192.                             <svg width="30" height="30" class="icon--white">
  193.                                 <use href="#icon-download" xlink:href="#icon-download"></use>
  194.                             </svg>
  195.                         </span>
  196.                     </a>
  197.                     {% endif %}
  198.                 {% endif %}
  199.             </div>
  200.         </div>
  201.     </div>
  202. </div>