templates/Nordinfo/Main/parts/item_list.html.twig line 1

Open in your IDE?
  1. {% set date = "" %}
  2. {% if post.dateDebut is defined and post.dateDebut is not null %}
  3.   {% set date_segments = post.dateDebut | split('/') %}
  4.   {% set date = date_segments[1] ~ '/' ~ date_segments[0] ~ '/' ~ date_segments[2] %}
  5. {% endif %}
  6. {% set date_fin = "" %}
  7. {% if post.dateFin is defined and post.dateFin != null %}
  8.   {% set date_segmentss = post.dateFin | split('/') %}
  9.   {% set date_fin = date_segmentss[1] ~ '/' ~ date_segmentss[0] ~ '/' ~ date_segmentss[2] %}
  10. {% endif %}
  11. {% set is_vip = false %}
  12. {% set is_presse = false %}
  13. {% set is_locked = false %}
  14. {% for target in post.Targetpublics %}
  15.   {% if target.id == 2 or target.id == 3 %}
  16.     {#  {% if target.id == 2 or target.id == 3 or target.id == 4 %} #}
  17.     {% set is_locked = true %}
  18.   {% endif %}
  19. {% endfor %}
  20. {% if main_type is not defined %}
  21.   {% set main_type = 'all' %}
  22. {% endif %}
  23. {% if is_locked == false or is_locked == true and main_type != 'folder' %}
  24.   {% if post.type.type == 'video' %}
  25.     {% if actus == true and post.boolActu == true or actus == false %}
  26.       <div class="colArticleItem col-item">
  27.         <p class="sr-only"
  28.            style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  29.            id="list-item-{{ post.id }}"
  30.            data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  31.         <a
  32.           href="{{ path('video_detail', {"slug": post.slug}) }}"
  33.           class="articleItem _video {% if is_locked is defined and is_locked == true %}_locked{% endif %}">
  34.                 <span class="__lock">
  35.                     {{ source('svg/lock.svg') }}
  36.                 </span>
  37.           <div class="__img lozad"
  38.                data-background-image="{% if post.defautFil is defined and post.defautFil is same as(true) %}{{ post.illustrationfilName }}{% else %}{{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('thumb') }}{% endif %}"
  39.           >
  40.             <p class="__tag">
  41.               VIDÉO &nbsp;&nbsp;
  42.               <span>{{ post.duree }}</span>
  43.             </p>
  44.             <button class="__button-remove" id="btnRemove{{ post.id }}" data-remove-item="{{ post.id }}"
  45.                     title="Retirer des favoris">
  46.               <svg aria-hidden="true" focusable="false" data-name="Calque 1"
  47.                    xmlns="http://www.w3.org/2000/svg" viewbox="0 0 283.5 283.5">
  48.                 <path class=""
  49.                       d="M240.9,42.5a140.29,140.29,0,1,0,0,198.4C295.7,186.2,295.7,97.3,240.9,42.5ZM176.5,182.7,141.7,148,107,182.8l-6.3-6.3,34.8-34.8L100.7,107l6.3-6.3,34.8,34.8,34.8-34.8,6.3,6.3L148,141.7l34.8,34.8Z"/>
  50.               </svg>
  51.               <span class="sr-only">Retirer des favoris</span>
  52.             </button>
  53.           </div>
  54.           <h2 class="__title">
  55.             <span>{{ post.title }}</span>
  56.           </h2>
  57.         </a>
  58.       </div>
  59.     {% endif %}
  60.   {% elseif post.type.type == 'event' %}
  61.     <div class="colArticleItem col-item">
  62.       <p class="sr-only"
  63.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  64.          id="list-item-{{ post.id }}"
  65.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  66.       <a {% if post.museeName != null %} target="_blank" {% endif %}
  67.         href="{% if post.museeName != null %}{{ post.url1 }}{% else %}{{ path('post_detail', {"slug": post.slug}) }}{% endif %}"
  68.         class="articleItem _short _event {% if is_locked is defined and is_locked == true %}_locked{% endif %}">
  69.             <span class="__lock">
  70.                 {{ source('svg/lock.svg') }}
  71.             </span>
  72.         <div class="row">
  73.           <div class="col-auto pr-0">
  74.             <div
  75.               class="__img --event placement{% if post.positionImage.id is defined %}{{ post.positionImage.id }}{% endif %} lozad"
  76.               data-background-image="{% if post.defautFil is defined and post.defautFil is same as(true) %}{{ post.illustrationfilName }}{% elseif post.museeName != null or post.imageUrl %}{{ post.imageUrl }}{% else %}{% if post.illustrationfilName is not null %}
  77.                                {{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('thumb') }}{% else %}{{ post.thumbUrl }}{% endif %}{% endif %}"
  78.             >
  79.               <button class="__button-remove" id="btnRemove{{ post.id }}" data-remove-item="{{ post.id }}"
  80.                       title="Retirer des favoris">
  81.                 <svg aria-hidden="true" focusable="false" data-name="Calque 1"
  82.                      xmlns="http://www.w3.org/2000/svg" viewbox="0 0 283.5 283.5">
  83.                   <path class=""
  84.                         d="M240.9,42.5a140.29,140.29,0,1,0,0,198.4C295.7,186.2,295.7,97.3,240.9,42.5ZM176.5,182.7,141.7,148,107,182.8l-6.3-6.3,34.8-34.8L100.7,107l6.3-6.3,34.8,34.8,34.8-34.8,6.3,6.3L148,141.7l34.8,34.8Z"/>
  85.                 </svg>
  86.                 <span class="sr-only">Retirer des favoris</span>
  87.               </button>
  88.             </div>
  89.           </div>
  90.           <div class="col">
  91.             <h2 class="__title">
  92.               <span>{{ post.title }}</span>
  93.             </h2>
  94.             {% if post.subtitle|length > 0 %}
  95.               <p class="__desc">
  96.                 {{ post.subtitle }}
  97.               </p>
  98.             {% endif %}
  99.             <p class="__date">
  100.               {% if date == date_fin %}
  101.                 Le
  102.                 {{ date|format_datetime(locale='fr', pattern='d MMMM Y') }}
  103.               {% else %}
  104.                 Du
  105.                 {% if date_fin|format_datetime(locale='fr', pattern="Y") == date|format_datetime(locale='fr', pattern="Y") %}
  106.                   {% if date|format_datetime(locale='fr', pattern="M") ==  date_fin|format_datetime(locale='fr', pattern="M") %}
  107.                     {{ date|format_datetime(locale='fr', pattern="d") }}
  108.                   {% else %}
  109.                     {{ date|format_datetime(locale='fr', pattern="d MMMM") }}
  110.                   {% endif %}
  111.                 {% else %}
  112.                   {{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}
  113.                 {% endif %}
  114.                 {# { post.dateDebut|format_datetime('none', 'none', app.request.locale, 'Europe/Paris', 'd MMMM') } #}
  115.                 au
  116.                 {{ date_fin|format_datetime(locale='fr', pattern="d MMMM Y") }}
  117.                 {# { post.dateFin|format_datetime('none', 'none', app.request.locale, 'Europe/Paris','d MMMM Y') } #}
  118.               {% endif %}
  119.             </p>
  120.             {% if post.museeName is not null %}
  121.               {% if post.shortDescription|length > 0 %}
  122.                 <p class="__place">
  123.                   {{ post.shortDescription }}
  124.                 </p>
  125.               {% endif %}
  126.             {% else %}
  127.               {% if post.lieu|length > 0 or post.ville|length > 0 %}
  128.                 <p class="__place">
  129.                   <span class="__lieu">{{ post.lieu }}</span>
  130.                   {% if post.lieu is not null and post.ville is not null %}
  131.                     <span class="separator">|</span>
  132.                   {% endif %}
  133.                   <span class="__ville">{{ post.ville }}</span>
  134.                 </p>
  135.               {% endif %}
  136.             {% endif %}
  137.           </div>
  138.         </div>
  139.       </a>
  140.     </div>
  141.   {% elseif post.type.type == 'folder' %}
  142.     <div class="colArticleItem col-item">
  143.       <p class="sr-only"
  144.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  145.          id="list-item-{{ post.id }}"
  146.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  147.       <a
  148.         href="{{ path('post_detail', {"slug": post.slug}) }}"
  149.         class="articleItem _background {% if is_locked is defined and is_locked == true %}_locked{% endif %}">
  150.             <span class="__lock">
  151.             {{ source('svg/lock.svg') }}
  152.         </span>
  153.         <div
  154.           class="__img placement{% if post.positionImage.id is defined %}{{ post.positionImage.id }}{% endif %} lozad"
  155.           data-background-image="{% if post.defautFil is defined and post.defautFil is same as(true) %}{{ post.illustrationfilName }}{% else %}{{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('thumb') }}{% endif %}"
  156.         ></div>
  157.         <div class="__info-wrapper" style="background-color: {{ post.palettecouleur.getCodeHexa() }};">
  158.           <h2 class="__title">
  159.             <span>{{ post.title }}</span>
  160.           </h2>
  161.           {% if post.subtitle|length > 0 %}
  162.             <p class="__desc">{{ post.subtitle }}</p>
  163.           {% endif %}
  164.         </div>
  165.       </a>
  166.     </div>
  167.   {% elseif post.type.type == 'article' %}
  168.     <div class="colArticleItem col-item">
  169.       <p class="sr-only"
  170.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  171.          id="list-item-{{ post.id }}"
  172.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  173.       <a
  174.         href="{{ path('post_detail', {"slug": post.slug}) }}"
  175.         class="articleItem _article {% if post.getGrandFormat != 1 %}_short{% endif %} {% if is_locked is defined and is_locked == true %}_locked{% endif %}">
  176.           <span class="__lock">
  177.             {{ source('svg/lock.svg') }}
  178.         </span>
  179.         <div class="__inner">
  180.           <div class="__col-img">
  181.             <div
  182.               class="__img placement{% if post.positionImage.id is defined %}{{ post.positionImage.id }}{% endif %} lozad"
  183.               data-background-image="{% if post.defautFil is defined and post.defautFil is same as(true) %}{{ post.illustrationfilName }}{% else %}{{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('thumb') }}{% endif %}"
  184.             >
  185.               <button class="__button-remove" id="btnRemove{{ post.id }}" data-remove-item="{{ post.id }}"
  186.                       title="Retirer des favoris">
  187.                 <svg aria-hidden="true" focusable="false" data-name="Calque 1"
  188.                      xmlns="http://www.w3.org/2000/svg" viewbox="0 0 283.5 283.5">
  189.                   <path class=""
  190.                         d="M240.9,42.5a140.29,140.29,0,1,0,0,198.4C295.7,186.2,295.7,97.3,240.9,42.5ZM176.5,182.7,141.7,148,107,182.8l-6.3-6.3,34.8-34.8L100.7,107l6.3-6.3,34.8,34.8,34.8-34.8,6.3,6.3L148,141.7l34.8,34.8Z"/>
  191.                 </svg>
  192.                 <span class="sr-only">Retirer des favoris</span>
  193.               </button>
  194.             </div>
  195.           </div>
  196.           <div class="__col-info">
  197.             <div class="__info-wrapper">
  198.               <h2 class="__title">
  199.                 <span>{{ post.title }}</span>
  200.               </h2>
  201.               {% if post.shortDescription|length > 0 %}
  202.                 <p class="__desc">
  203.                   {{ post.shortDescription }}
  204.                 </p>
  205.               {% endif %}
  206.             </div>
  207.           </div>
  208.         </div>
  209.       </a>
  210.     </div>
  211.   {% elseif post.type.type == 'podcast' %}
  212.     <div class="containerArticleBig">
  213.       <p class="sr-only"
  214.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  215.          id="list-item-{{ post.id }}"
  216.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  217.       <a
  218.         href="{{ path('post_detail', {"slug": post.slug}) }}"
  219.         class="articleItem _big">
  220.           <span class="__lock">
  221.             {{ source('svg/lock.svg') }}
  222.         </span>
  223.         <div class="__inner">
  224.           <div class="__col-img">
  225.             <div
  226.               class="__img placement{% if post.positionImage.id is defined %}{{ post.positionImage.id }}{% endif %} lozad"
  227.               data-background-image="{% if post.defautFil is defined and post.defautFil is same as(true) %}{{ post.illustrationfilName }}{% else %}{{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('thumb') }}{% endif %}"
  228.             ></div>
  229.           </div>
  230.           <div class="__col-info">
  231.             <div class="__info-wrapper">
  232.               <h2 class="__title">
  233.                 <span>{{ post.title }}</span>
  234.               </h2>
  235.               {% if post.shortDescription|length > 0 %}
  236.                 <p class="__desc">
  237.                   {{ post.shortDescription }}
  238.                 </p>
  239.               {% endif %}
  240.             </div>
  241.           </div>
  242.         </div>
  243.       </a>
  244.     </div>
  245.   {% elseif post.type.type == 'pub' %}
  246.     <div class="colArticleItem col-item">
  247.       <p class="sr-only"
  248.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  249.          id="list-item-{{ post.id }}" title="{{ post.subtitle }}"
  250.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  251.       {% if post.widthImageFocusPub == post.heightImageFocusPub %}
  252.         {% set img_padding = 100 %}
  253.       {% else %}
  254.         {% set img_padding = (post.heightImageFocusPub/post.widthImageFocusPub)*100 %}
  255.       {% endif %}
  256.       {% if post.relatedPost1 is not null %}
  257.         <a
  258.           href="{{ path('post_detail', {"slug": post.relatedPost1.slug}) }}"
  259.           class="articleItem _pub {% if false %}_locked{% endif %}" title="{{ post.subtitle }}">
  260.           <span class="__lock">
  261.             {{ source('svg/lock.svg') }}
  262.           </span>
  263.           <div class="__img placement{% if post.positionImage.id is defined %}{{ post.positionImage.id }}{% endif %}"
  264.                style="position:relative;width:100%;padding-bottom:{{ img_padding }}%;">
  265.             <img
  266.               data-src="{% if post.defautFil is defined and post.defautFil is same as(true) %}{{ post.illustrationfilName }}{% else %}{{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('thumb') }}{% endif %}"
  267.               src=""
  268.               alt="{{ post.subtitle }}" class="lozad"
  269.               style="position:absolute;top:0;left:0;height:100%!important;width:100%!important;">
  270.           </div>
  271.         </a>
  272.       {% else %}
  273.         <a href="{{ post.url1 }}" target="_blank"
  274.            class="articleItem _pub {% if false %}_locked{% endif %}"
  275.            title="{{ post.subtitle }}">
  276.           {% if post.illustrationfilName|length > 0 %}
  277.             <div class="__img placement{% if post.positionImage.id is defined %}{{ post.positionImage.id }}{% endif %}"
  278.                  style="position:relative;width:100%;padding-bottom:{{ img_padding }}%;">
  279.               <img
  280.                 data-src="{% if post.defautFil is defined and post.defautFil is same as(true) %}{{ post.illustrationfilName }}{% else %}{{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('thumb') }}{% endif %}"
  281.                 src=""
  282.                 alt="{{ post.subtitle }}" class="lozad"
  283.                 style="position:absolute;top:0;left:0;height:100%!important;width:100%!important;">
  284.             </div>
  285.           {% else %}
  286.             <div class="__img"></div>
  287.           {% endif %}
  288.           {% if post.subtitle|length > 0 %}
  289.             <p class="sr-only">{{ post.subtitle }}</p>
  290.           {% endif %}
  291.         </a>
  292.       {% endif %}
  293.     </div>
  294.   {% elseif post.type.type == 'socialpost' %}
  295.     <div class="col-social-post col-item">
  296.       <p class="sr-only"
  297.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  298.          id="list-item-{{ post.id }}"
  299.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  300.       <a href="{{ post.url1 }}" target="_blank"
  301.          class="socialPostItem {% if false %}_locked{% endif %} {% if post.subtitle == 'Twitter' %} _twitter {% endif %}{% if post.subtitle == 'Facebook' %} _facebook {% endif %}{% if post.subtitle == 'Instagram' %} _instagram {% endif %}{% if post.subtitle == 'Linkedin' %} _linkedin {% endif %}">
  302.         <h2 class="sr-only">
  303.           <span class="sr-only">{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</span>
  304.           <span>{{ post.title }}</span>
  305.           <span>@departement59</span>
  306.         </h2>
  307.         <span class="__lock">
  308.           {{ source('svg/lock.svg') }}
  309.         </span>
  310.         <div class="__header">
  311.           {% if post.subtitle == 'Twitter' %}
  312.             <svg alt="Twitter" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"
  313.                  width="20.119" height="16.337"
  314.                  viewbox="0 0 20.119 16.337">
  315.               <g id="twitter" transform="translate(56.9)">
  316.                 <path id="Path_58" data-name="Path 58"
  317.                       d="M-38.834,4.6A11.65,11.65,0,0,1-50.57,16.337a11.666,11.666,0,0,1-6.33-1.859,8.222,8.222,0,0,0,.988.065,8.349,8.349,0,0,0,5.134-1.768,4.123,4.123,0,0,1-3.86-2.859,4.953,4.953,0,0,0,.78.078,4.158,4.158,0,0,0,1.079-.143A4.142,4.142,0,0,1-56.094,5.8V5.745a4.156,4.156,0,0,0,1.872.52,4.125,4.125,0,0,1-1.833-3.431A4.217,4.217,0,0,1-55.5.754,11.638,11.638,0,0,0-47,5.069a3.758,3.758,0,0,1-.1-.936A4.124,4.124,0,0,1-42.98,0a4.141,4.141,0,0,1,3.015,1.3A8.453,8.453,0,0,0-37.34.3a4.142,4.142,0,0,1-1.82,2.287,8.59,8.59,0,0,0,2.378-.65,8.713,8.713,0,0,1-2.054,2.144C-38.847,4.25-38.834,4.432-38.834,4.6Z"
  318.                       fill="#fff"/>
  319.               </g>
  320.             </svg>
  321.             <span class="sr-only">Twitter</span>
  322.           {% endif %}
  323.           {% if post.subtitle == 'Facebook' %}
  324.             <svg alt="Facebook" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"
  325.                  width="11.501" height="21.235"
  326.                  viewbox="0 0 11.501 21.235">
  327.               <g id="facebook" transform="translate(-20.3 -6.4)">
  328.                 <path id="Path_54" data-name="Path 54"
  329.                       d="M30.442,18.4H27.421l-.012,8.739H23.593L23.6,18.4H21.342a.527.527,0,0,1-.53-.53L20.8,15.049a.537.537,0,0,1,.53-.542h2.263v-2.72c0-3.166,1.926-4.887,4.743-4.887h2.311a.547.547,0,0,1,.542.542V9.813a.539.539,0,0,1-.542.542h-1.42c-1.529,0-1.83.734-1.83,1.806V14.52h3.37a.539.539,0,0,1,.53.6l-.325,2.8A.516.516,0,0,1,30.442,18.4Z"
  330.                       transform="translate(0 0)" fill="#fff" stroke="#18509a" stroke-width="1"/>
  331.               </g>
  332.             </svg>
  333.             <span class="sr-only">Facebook</span>
  334.           {% endif %}
  335.           {% if post.subtitle == 'Instagram' %}
  336.             <svg alt="Facebook" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"
  337.                  xmlns:xlink="http://www.w3.org/1999/xlink" width="18.022" height="18" viewbox="0 0 18.022 18">
  338.               <defs>
  339.                 <radialGradient id="radial-gradient" cx="105.069" cy="44.509" r="20.34"
  340.                                 gradienttransform="translate(-0.001 0.001)" gradientunits="userSpaceOnUse">
  341.                   <stop offset="0" stop-color="#ffed75"/>
  342.                   <stop offset="0.31" stop-color="#e87706"/>
  343.                   <stop offset="0.571" stop-color="#dc1417"/>
  344.                   <stop offset="0.828" stop-color="#b14d90"/>
  345.                   <stop offset="1" stop-color="#413b89"/>
  346.                 </radialGradient>
  347.                 <radialGradient id="radial-gradient-2" cx="-0.069" cy="19.376" r="20.363"
  348.                                 gradienttransform="translate(0 0.019)" xlink:href="#radial-gradient"/>
  349.                 <radialGradient id="radial-gradient-3" cx="36.331" cy="55.91" r="20.339"
  350.                                 gradienttransform="matrix(1, 0, 0, 1, 0, 0)" xlink:href="#radial-gradient"/>
  351.               </defs>
  352.               <g id="Instagram" transform="translate(0.3 -3.8)">
  353.                 <g id="Group_43" data-name="Group 43" transform="translate(-0.3 3.8)">
  354.                   <path id="Path_55" data-name="Path 55"
  355.                         d="M118.908,31.9a1.108,1.108,0,1,0,1.108,1.108A1.107,1.107,0,0,0,118.908,31.9Z"
  356.                         transform="translate(-105.093 -28.877)" fill="url(#radial-gradient)"/>
  357.                   <path id="Path_56" data-name="Path 56"
  358.                         d="M12.589,3.8H4.832A5.136,5.136,0,0,0-.3,8.921v7.757A5.129,5.129,0,0,0,4.832,21.8h7.757a5.136,5.136,0,0,0,5.132-5.121V8.921A5.136,5.136,0,0,0,12.589,3.8Zm3.583,12.889a3.582,3.582,0,0,1-3.583,3.583H4.832a3.582,3.582,0,0,1-3.583-3.583V8.921A3.582,3.582,0,0,1,4.832,5.339h7.757a3.582,3.582,0,0,1,3.583,3.583Z"
  359.                         transform="translate(0.3 -3.8)" fill="url(#radial-gradient-2)"/>
  360.                   <path id="Path_57" data-name="Path 57"
  361.                         d="M45.116,44.6a4.616,4.616,0,1,0,4.616,4.616A4.622,4.622,0,0,0,45.116,44.6Zm0,7.682a3.066,3.066,0,1,1,3.077-3.066A3.072,3.072,0,0,1,45.116,52.282Z"
  362.                         transform="translate(-36.11 -40.21)" fill="url(#radial-gradient-3)"/>
  363.                 </g>
  364.               </g>
  365.             </svg>
  366.             <span class="sr-only">Instagram</span>
  367.           {% endif %}
  368.           {% if post.subtitle == 'Linkedin' %}
  369.             <svg alt="Linkedin" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"
  370.                  width="18" height="17.969"
  371.                  viewbox="0 0 18 17.969">
  372.               <g id="Group_56" data-name="Group 56" transform="translate(-469.935 -116.826)">
  373.                 <path id="Path_76" data-name="Path 76"
  374.                       d="M470.232,122.792h3.73v12h-3.73Zm1.866-5.966a2.163,2.163,0,1,1-2.163,2.162,2.164,2.164,0,0,1,2.163-2.162"
  375.                       transform="translate(0 0)" fill="#fff"/>
  376.                 <path id="Path_77" data-name="Path 77"
  377.                       d="M506.394,149.576h3.578v1.64h.05a3.92,3.92,0,0,1,3.53-1.939c3.777,0,4.475,2.486,4.475,5.718v6.583H514.3v-5.837c0-1.392-.026-3.182-1.938-3.182-1.941,0-2.239,1.516-2.239,3.082v5.938h-3.727Z"
  378.                       transform="translate(-30.091 -26.784)" fill="#fff"/>
  379.               </g>
  380.             </svg>
  381.             <span class="sr-only">Linkedin</span>
  382.           {% endif %}
  383.         </div>
  384.         <div class="__body">
  385.           {% if post.defautFil is defined and post.defautFil is same as(true) %}
  386.             <div class="__img-wrapper">
  387.               <div
  388.                 class="__img placement{% if post.getPositionImage.id is defined %}{{ post.getPositionImage.id }}{% endif %} lozad"
  389.                 data-background-image="{{ post.illustrationfilName }}"
  390.                 style='padding-bottom:{{ post.padding }}%;'></div>
  391.             </div>
  392.           {% elseif post.illustrationfilName is defined and post.illustrationfilName != null %}
  393.             <div class="__img-wrapper">
  394.               <div
  395.                 class="__img placement{% if post.getPositionImage.id is defined %}{{ post.getPositionImage.id }}{% endif %} lozad"
  396.                 data-background-image="{{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('thumb') }}"
  397.                 style='padding-bottom:{{ post.padding }}%;'></div>
  398.             </div>
  399.           {% elseif post['image_url']is defined and post.imageUrl != null %}
  400.             <div class="__img-wrapper">
  401.               <div
  402.                 class="__img placement{% if post.getPositionImage.id is defined %}{{ post.getPositionImage.id }}{% endif %} lozad"
  403.                 data-background-image="{{ post.imageUrl }}"
  404.                 style='padding-bottom:{{ post.padding }}%;'></div>
  405.             </div>
  406.           {% endif %}
  407.           <p class="__desc">
  408.             {{ post.shortDescription|raw }}
  409.           </p>
  410.         </div>
  411.       </a>
  412.     </div>
  413.   {% elseif post.type.type == 'sondage' %}
  414.     <div class="col-checkboxes-item col-item">
  415.       <p class="sr-only"
  416.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  417.          id="list-item-{{ post.id }}"
  418.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  419.       <div class="checkboxesContainer"
  420.            id="checkboxesContainer{{ post.id }}">
  421.         <div class="container">
  422.           <h3 class="__title" id="sondageTitle{{ post.id }}">{{ post.title }}</h3>
  423.           <div id="sondage{{ post.id }}" class="d-flex justify-content-center">
  424.             <div data-checkbox-group>
  425.               {% for response in post.reponses %}
  426.                 <div class="form-check">
  427.                   <input class="form-check-input" type="radio" name="sondageRadios{{ post.id }}"
  428.                          id="resp{{ response.id }}" value="{{ response.id }}">
  429.                   <label class="form-check-label" for="resp{{ response.id }}">{{ response.texte }}</label>
  430.                 </div>
  431.                 <script>
  432.                   sondageid = '{{ post.id }}';
  433.                   respid = '{{ response.id }}';
  434.                   $('#resp' + respid).on('click', function () {
  435.                     let $checkboxesContainer = $('#checkboxesContainer' + '{{ post.id }}');
  436.                     let checkboxesContainerInner = $checkboxesContainer[0].querySelector('.container');
  437.                     checkboxesContainerInner.style.opacity = '.1';
  438.                     let $sondage = $('#sondage' + {{ post.id }});
  439.                     let $sondageTitle = $('#sondageTitle' + {{ post.id }});
  440.                     let $loaderSondage = $('#loaderSondage' + {{ post.id }});
  441.                     let heightCheckboxesContainer = $checkboxesContainer.outerHeight();
  442.                     $checkboxesContainer.css('min-height', heightCheckboxesContainer + 'px');
  443.                     $sondage.html('');
  444.                     $sondageTitle.html('Vos réponses :');
  445.                     $loaderSondage.fadeIn();
  446.                     $.ajax({
  447.                       type: 'POST',
  448.                       url: "{{ path('ajax_count_sondage') }}",
  449.                       data: {
  450.                         'sondage_id': '{{ post.id }}',
  451.                         'response_id': '{{ response.id }}'
  452.                       },
  453.                       success: function (data) {
  454.                         $loaderSondage.hide();
  455.                         checkboxesContainerInner.style.opacity = '1';
  456.                         $('#sondage' + data.sondage).removeClass('d-flex justify-content-center');
  457.                         $.each(data.votes, function (index, value) {
  458.                           let html = '<div class="__result"><div class="__text">' + value.texte + ' : <strong>' + value.pourcent + '%</strong></div><div class="__bar"><div class="__inner" style="width:' + value.pourcent + '%;"></div></div></div>';
  459.                           $('#sondage' + data.sondage).append(html);
  460.                         });
  461.                         window.masonryGrid.layout();
  462.                       }
  463.                     });
  464.                   });
  465.                 </script>
  466.               {% endfor %}
  467.             </div>
  468.           </div>
  469.           {#      <div>{{ post.contenu_|raw }}</div> #}
  470.         </div>
  471.         <div class="__loader-container" id="loaderSondage{{ post.id }}" style="display:none;">
  472.           <span class="loader">Chargement en cours</span>
  473.         </div>
  474.       </div>
  475.     </div>
  476.   {% elseif post.type.type == 'intranet' %}
  477.     <div class="colArticleItem col-item">
  478.       <p class="sr-only"
  479.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  480.          id="list-item-{{ post.id }}"
  481.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  482.       <a
  483.         href="{{ path('post_detail', {"slug": post.slug}) }}"
  484.         class="articleItem _article {% if post.getGrandFormat != 1 %}_short{% endif %} _locked">
  485.         <span class="__lock">
  486.             {{ source('svg/lock.svg') }}
  487.         </span>
  488.         <div class="__inner">
  489.           <div class="__col-img">
  490.             <div
  491.               class="__img placement{% if post.positionImage.id is defined %}{{ post.positionImage.id }}{% endif %} lozad"
  492.               data-background-image="{{ asset('img/visuel-intranet.png_5e81dc3807ceb.png') }}">
  493.               <button class="__button-remove" id="btnRemove{{ post.id }}" data-remove-item="{{ post.id }}"
  494.                       title="Retirer des favoris">
  495.                 <svg aria-hidden="true" focusable="false" data-name="Calque 1"
  496.                      xmlns="http://www.w3.org/2000/svg" viewbox="0 0 283.5 283.5">
  497.                   <path class=""
  498.                         d="M240.9,42.5a140.29,140.29,0,1,0,0,198.4C295.7,186.2,295.7,97.3,240.9,42.5ZM176.5,182.7,141.7,148,107,182.8l-6.3-6.3,34.8-34.8L100.7,107l6.3-6.3,34.8,34.8,34.8-34.8,6.3,6.3L148,141.7l34.8,34.8Z"/>
  499.                 </svg>
  500.                 <span class="sr-only">Retirer des favoris</span>
  501.               </button>
  502.             </div>
  503.           </div>
  504.           <div class="__col-info">
  505.             <div class="__info-wrapper">
  506.               <h2 class="__title">
  507.                 <span>{{ post.title }}</span>
  508.               </h2>
  509.               {% if post.shortDescription|length > 0 %}
  510.                 <p class="__desc">
  511.                   {{ post.shortDescription }}
  512.                 </p>
  513.               {% endif %}
  514.             </div>
  515.           </div>
  516.         </div>
  517.       </a>
  518.     </div>
  519.   {% elseif post.type.type == 'quiz' %}
  520.     <div class="col-checkboxes-item col-item">
  521.       <p class="sr-only"
  522.          style="position:absolute;left:0;width:100%;height:30px;visibility:hidden;opacity:0;{% if loop.index == 1 %}top:-24px;{% else %}top:0;{% endif %}"
  523.          id="list-item-{{ post.id }}"
  524.          data-date-bar-scroll-point>{{ date|format_datetime(locale='fr', pattern="d MMMM Y") }}</p>
  525.       {% include 'Nordinfo/Main/parts/quiz_block.html.twig' with {post: post, content_post: '', is_detail: false} only %}
  526.     </div>
  527.   {% endif %}
  528. {% endif %}