templates/bundles/OdiseoSyliusBlogPlugin/Shop/Evenement/_latest.html.twig line 1

Open in your IDE?
  1. {% if resources|length > 0 %}
  2.     <div class="latest-items">
  3.         {% for article in resources %}
  4.             <div class="item" id="card-last-event-show">
  5.                 <div class="content">
  6.                     <a class="header" href="{{ path('odiseo_sylius_blog_plugin_shop_article_show', {'slug' : article.slug}) }}">
  7.                         {% if article.images|length > 0 %}
  8.                             <div class="image">
  9.                                 <img src="{{ article.images[0].path|imagine_filter(filter|default('sylius_large')) }}" {{ sylius_test_html_attribute('main-image') }} alt="" class="ui bordered image" />
  10.                             </div>
  11.                         {% endif %}
  12.                     </a>
  13.                     <div class="description">
  14.                         <div class="place-times-event">
  15.                             {% set month0 =  article.createdAt|date('F') %}
  16.                             {% set translation0 = 'sylius.ui.' ~ month0 %}
  17.                             <div>
  18.                                 <i class="calendar alternate outline icon"></i>
  19.                                 {{ article.DateEvenement|date('j') }} {{ translation0|trans }}, {{ article.DateEvenement|date('Y') }}
  20.                             </div>
  21.                             <div>
  22.                                 <i class="map marker alternate icon"></i>
  23.                                 {% if article.articleLocation.location|length > 16 %}
  24.                                     {{ article.articleLocation.location|slice(0, 16) }}...
  25.                                 {% else %}
  26.                                     {{ article.articleLocation.location }}
  27.                                 {% endif %}
  28.                             </div>
  29.                         </div>
  30. {#                        <div class="desc-date">#}
  31. {#                            {% set month =  article.DateEvenement|date('F') %}#}
  32. {#                            {% set translation = 'sylius.ui.' ~ month %}#}
  33. {#                            <i class="calendar alternate outline icon"></i>#}
  34. {#                            {{ article.DateEvenement|date('j') }} {{ translation|trans }}, {{ article.DateEvenement|date('Y') }}#}
  35. {#                            <div class="place-product-show">#}
  36. {#                                <i class="map marker alternate icon"></i>#}
  37. {#                                {% if article.articleLocation.location|length > 16 %}#}
  38. {#                                    <span>{{ article.articleLocation.location|slice(0, 16) }}...</span>#}
  39. {#                                {% else %}#}
  40. {#                                    <span>{{ article.articleLocation.location }}</span>#}
  41. {#                                {% endif %}#}
  42. {#                            </div>#}
  43. {#                            #}{#                            {% endif %}#}
  44. {#                        </div>#}
  45.                         <h3>
  46.                             <a href="{{ path('odiseo_sylius_blog_plugin_shop_article_show', {'slug' : article.slug}) }}" data-disqus-identifier="{{ url('odiseo_sylius_blog_plugin_shop_article_show', {'slug' : article.slug}) }}">
  47.                                 {{ article.translations['fr_FR'].title }}
  48.                             </a>
  49.                         </h3>
  50.                         <p>
  51.                             {% if article.content|striptags|length > 200 %}
  52.                                 {{ article.content|striptags|slice(0, 200)|raw }}...
  53.                             {% else %}
  54.                                 {{ article.content|striptags|raw }}
  55.                             {% endif %}
  56.                         </p>
  57.                     </div>
  58.                 </div>
  59.             </div>
  60.         {% endfor %}
  61.         <div class="points-last-article">
  62.             <span class="point-last active" onclick="changeImage(1)"></span>
  63.             <span class="point-last" onclick="changeImage(2)"></span>
  64.             <span class="point-last" onclick="changeImage(3)"></span>
  65.         </div>
  66.     </div>
  67. {% endif %}
  68. <script>
  69.   function changeImage(index) {
  70.     // Récupérer toutes les images de la galerie
  71.     var images = document.querySelectorAll('.latest-items .item');
  72.     // Réinitialiser la classe "active" pour tous les points
  73.     var points = document.querySelectorAll('.point-last');
  74.     points.forEach(function(point) {
  75.       point.classList.remove('active');
  76.     });
  77.     // Cacher toutes les images de la galerie
  78.     images.forEach(function(image) {
  79.       image.style.display = 'none';
  80.     });
  81.     // Afficher l'image correspondante à l'index spécifié
  82.     images[index - 1].style.display = 'block';
  83.     // Ajouter la classe "active" au point correspondant à l'index spécifié
  84.     points[index - 1].classList.add('active');
  85.   }
  86. </script>