{% extends 'base.html.twig' %}
{% if listWithThumbnails is not defined %}
{% set listWithThumbnails = false %}
{% endif %}
{% set activeMenu = "infos-pratiques" %}
{% set titreSuffix = "(page " ~ pageNb ~ "/" ~ (articles.getTotalItemCount / pageLimit)|round ~ ")" %}
{% if title is defined and title is not null %}
{% set titre = title %}
{% else %}
{% set titre = "Tous les articles " %}
{% endif %}
{% block title %}{{ titre ~ " " ~ titreSuffix }}{% endblock %}
{% block body %}
<h1 class="">{{ (titre ~ " <small class=\"text-muted\">" ~ titreSuffix ~ "</small>")|raw }}</h1>
{% import "common/listWithImages.html.twig" as listWithImages %}
{% if listWithThumbnails %}
<div class="row articles-list with-images">
{% for article in articles %}
<div class="col-sm-6 col-md-4 col-lg-3 article with-image
{% if type is defined %}{{ type }}{% endif %}
">
<a style="display:block" href="{{ path('showArticleBySlug', {slug:article.slug}) }}">
<div class="post-medias">
{{ listWithImages.showOneImage(article) }}
</div>
<p>
{# <span class="date">{{ article.createdAt|date("d/m/Y") }}</span>
<span class="tags">{{ article.tags|join(', ') }}</span>
<br/> #}
<span class="title">
{{ article.title }}
{# {{ article.title|raw|striptags|slice(0,30) }}
{% if article.title|raw|striptags|length > 30 %}...{% endif %} #}
</span>
</p>
</a>
</div>
{% endfor %}
</div>
{% else %}
<ul class="list-unstyled">
{% for article in articles %}
<li class="une">
<span class="date">{{ article.createdAt|date("d/m/Y") }}<span> <a href="{{ path('showArticleBySlug', {slug:article.slug}) }}">{{ article.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
<div class="pagination">
{{ knp_pagination_render(articles) }}
</div>
{% endblock %}