{% if resources|length > 0 %}
<div class="latest-items">
{% for article in resources %}
<div class="item" id="card-last-event-show">
<div class="content">
<a class="header" href="{{ path('odiseo_sylius_blog_plugin_shop_article_show', {'slug' : article.slug}) }}">
{% if article.images|length > 0 %}
<div class="image">
<img src="{{ article.images[0].path|imagine_filter(filter|default('sylius_large')) }}" {{ sylius_test_html_attribute('main-image') }} alt="" class="ui bordered image" />
</div>
{% endif %}
</a>
<div class="description">
<div class="place-times-event">
{% set month0 = article.createdAt|date('F') %}
{% set translation0 = 'sylius.ui.' ~ month0 %}
<div>
<i class="calendar alternate outline icon"></i>
{{ article.DateEvenement|date('j') }} {{ translation0|trans }}, {{ article.DateEvenement|date('Y') }}
</div>
<div>
<i class="map marker alternate icon"></i>
{% if article.articleLocation.location|length > 16 %}
{{ article.articleLocation.location|slice(0, 16) }}...
{% else %}
{{ article.articleLocation.location }}
{% endif %}
</div>
</div>
{# <div class="desc-date">#}
{# {% set month = article.DateEvenement|date('F') %}#}
{# {% set translation = 'sylius.ui.' ~ month %}#}
{# <i class="calendar alternate outline icon"></i>#}
{# {{ article.DateEvenement|date('j') }} {{ translation|trans }}, {{ article.DateEvenement|date('Y') }}#}
{# <div class="place-product-show">#}
{# <i class="map marker alternate icon"></i>#}
{# {% if article.articleLocation.location|length > 16 %}#}
{# <span>{{ article.articleLocation.location|slice(0, 16) }}...</span>#}
{# {% else %}#}
{# <span>{{ article.articleLocation.location }}</span>#}
{# {% endif %}#}
{# </div>#}
{# #}{# {% endif %}#}
{# </div>#}
<h3>
<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}) }}">
{{ article.translations['fr_FR'].title }}
</a>
</h3>
<p>
{% if article.content|striptags|length > 200 %}
{{ article.content|striptags|slice(0, 200)|raw }}...
{% else %}
{{ article.content|striptags|raw }}
{% endif %}
</p>
</div>
</div>
</div>
{% endfor %}
<div class="points-last-article">
<span class="point-last active" onclick="changeImage(1)"></span>
<span class="point-last" onclick="changeImage(2)"></span>
<span class="point-last" onclick="changeImage(3)"></span>
</div>
</div>
{% endif %}
<script>
function changeImage(index) {
// Récupérer toutes les images de la galerie
var images = document.querySelectorAll('.latest-items .item');
// Réinitialiser la classe "active" pour tous les points
var points = document.querySelectorAll('.point-last');
points.forEach(function(point) {
point.classList.remove('active');
});
// Cacher toutes les images de la galerie
images.forEach(function(image) {
image.style.display = 'none';
});
// Afficher l'image correspondante à l'index spécifié
images[index - 1].style.display = 'block';
// Ajouter la classe "active" au point correspondant à l'index spécifié
points[index - 1].classList.add('active');
}
</script>