{% extends '/site/base_site.html.twig' %}
{% block title %}
{% if theme is defined and theme is not null %}
{{theme.titre}}
{% else %}
Temps forts
{% endif %}
{% endblock %}
{% block metadescription %}{{theme.metadescription is defined and theme.metadescription is not null ? theme.metadescription }}{% endblock %}
{% block body %}
{% set mois = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ] %}
<div class="eventEntete demarcheEntete intervenantEntete bgEntete ressourcesEntete">
<img src="/site/img/ressources_symbol.png" />
<h1>
{% if theme is defined and theme is not null %}
{{theme.titre}}
{% else %}
Temps forts
{% endif %}
</h1>
</div>
<div class="wrapper articles">
<div class="search">
{{form_start(form)}}
{{ form_widget(form.search, {'attr': {'class': 'searchInput', 'placeholder':'Rechercher dans les articles'}}) }}
{{ form_widget(form.ok, {'attr': {'class': 'searchOk', 'style':''}}) }}
{{form_end(form)}}
</div>
{% set articlesListing = articles %}
{% if articlesSearch is defined and articlesSearch is not null and articlesSearch is not empty %}
{% set articlesListing = articlesSearch %}
<h2 style="font-size:1.8em; margin:65px 0 20px 0;"><i class="fas fa-angle-double-right"></i> <b style="color: #23dbc0;">{{articlesSearch|length}} article{{articlesSearch|length > 1 ? 's'}}</b> pour la recherche <b style="color: #23dbc0;">"{{search}}"</b></h2>
{% elseif articlesSearch is defined and articlesSearch is not null and articlesSearch is empty %}
<h2 style="font-size:1.8em; margin:65px 0 20px 0;"><i class="fas fa-angle-double-right"></i> Aucun résultat pour la recherche <b style="color: #23dbc0;">"{{search}}"</b></h2>
{% endif %}
{% if theme is defined and theme is not null %}
<h2 style="font-size:1.8em; margin:65px 0 20px 0;"><i class="fas fa-angle-double-right"></i> <b style="color: #23dbc0;">{{articles|length}} article{{articles|length > 1 ? 's'}}</b> pour le thème <b style="color: #23dbc0;">"{{theme.titre}}"</b></h2>
{% endif %}
<ul>
{% for item in articlesListing %}
<li>
{# <div style="background-image:url('/site/upload/{{item.vignette}}');">
<a href="{{path('site_ressources_article', {'slug': item.slug} )}}">
<span class="titre">{{item.titre}}</span>
</a>
</div> #}
<a href="{{path('site_ressources_article', {'slug': item.slug} )}}">
<span class="img" style="background-image:url('/site/upload/{{item.vignette}}');"></span>
<span class="titre">{{item.titre}}</span>
</a>
<span class="extract"><i>{{item.date|date('d/m/y')}}</i> {{item.chapo|extract|raw}}</span>
<span class="themes">
{% for theme in item.themes %}
<b>{{theme.titre}}</b>
{% endfor %}
</span>
</li>
{% endfor %}
</ul>
<h2 style="font-size:1.8em; margin:65px 0 20px 0;"><i class="fas fa-angle-double-right"></i> Nos articles par thème</h2>
<div class="themesListe">
{% for item in themes %}
{% if item.articles|filter(a => a.datePublication is not null and a.datePublication|date('Ymd') <= "now"|date('Ymd'))|length > 0 %}
<a href="{{path('site_ressources', {'slugtheme': item.slug})}}" {{theme is defined and theme is not null and theme.slug == item.slug ? 'class="currentTheme"'}}>{{item.titre}}</a>
{% endif %}
{% endfor %}
</div>
</div>
{% endblock %}