templates/site/articles.html.twig line 1

Open in your IDE?
  1. {% extends '/site/base_site.html.twig' %}
  2. {% block title %}
  3.         {% if theme is defined and theme is not null %}
  4.             {{theme.titre}}
  5.         {% else %}
  6.             Temps forts            
  7.         {% endif %}
  8. {% endblock %}
  9. {% block metadescription %}{{theme.metadescription is defined and theme.metadescription is not null ? theme.metadescription }}{% endblock %}
  10. {% block body %}
  11.     {% set mois = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ] %}
  12.     <div class="eventEntete demarcheEntete intervenantEntete bgEntete ressourcesEntete">
  13.         <img src="/site/img/ressources_symbol.png" />
  14.         <h1>
  15.         {% if theme is defined and theme is not null %}
  16.             {{theme.titre}}
  17.         {% else %}
  18.             Temps forts            
  19.         {% endif %}
  20.         </h1>
  21.     </div>
  22.     <div class="wrapper articles">
  23.         <div class="search">
  24.             {{form_start(form)}}
  25.             {{ form_widget(form.search, {'attr': {'class': 'searchInput', 'placeholder':'Rechercher dans les articles'}}) }}
  26.             {{ form_widget(form.ok, {'attr': {'class': 'searchOk', 'style':''}}) }}
  27.             {{form_end(form)}}
  28.         </div>
  29.         {% set articlesListing = articles %}
  30.         {% if articlesSearch is defined and articlesSearch is not null and articlesSearch is not empty %}
  31.             {% set articlesListing = articlesSearch %}
  32.             <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>
  33.         {% elseif articlesSearch is defined and articlesSearch is not null and articlesSearch is empty %}
  34.             <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>
  35.         {% endif %}
  36.         
  37.         {% if theme is defined and theme is not null %}
  38.             <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>
  39.         {% endif %}
  40.         
  41.         <ul>
  42.             {% for item in articlesListing %}
  43.             
  44.             <li>
  45.                 {# <div style="background-image:url('/site/upload/{{item.vignette}}');"> 
  46.                     <a href="{{path('site_ressources_article', {'slug': item.slug} )}}">   
  47.                     <span class="titre">{{item.titre}}</span>
  48.                     </a>
  49.                 </div> #}
  50.                 <a href="{{path('site_ressources_article', {'slug': item.slug} )}}">
  51.                 <span class="img" style="background-image:url('/site/upload/{{item.vignette}}');"></span>   
  52.                 <span class="titre">{{item.titre}}</span>
  53.                 </a>
  54.                 <span class="extract"><i>{{item.date|date('d/m/y')}}</i> {{item.chapo|extract|raw}}</span>
  55.                 <span class="themes">
  56.                     {% for theme in item.themes %}
  57.                     <b>{{theme.titre}}</b>&nbsp;&nbsp;
  58.                     {% endfor %}
  59.                 </span>
  60.             </li>
  61.             {% endfor %}
  62.         </ul>
  63.         <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>
  64.         <div class="themesListe">
  65.             {% for item in themes %}
  66.                 {% if item.articles|filter(a => a.datePublication is not null and a.datePublication|date('Ymd') <= "now"|date('Ymd'))|length > 0 %}
  67.                     <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>
  68.                 
  69.                 {% endif %}
  70.                 
  71.             {% endfor %}
  72.         </div>
  73.     </div>
  74.    
  75.     
  76.   
  77. {% endblock %}