templates/front/actualite/index.html.twig line 1

  1. {% extends 'front_layout.html.twig' %}
  2. {% block title %}Actualités{% endblock %}
  3. {% block body %}
  4. <main class="t-page">
  5.     {% set mediaPoleRecherche = null %}
  6.     {% for pole in poles %}
  7.         {% if pole.name == poleSearch %}
  8.             {% set mediaPoleRecherche = pole.urlPole.banniere.filepath %}
  9.         {% endif %}
  10.     {% endfor %}
  11.     <header class="t-page__header" 
  12.         {% if mediaPoleRecherche is not null %}
  13.             style="background-image: url('{{ asset('/uploads/medias/' ~ mediaPoleRecherche)|imagine_filter('banner') }}');"
  14.         {% else %}
  15.             style="background-image: url('/build/images/grey.jpg');"
  16.         {% endif %}
  17.     >
  18.         <h1 class="t-page__mainTitle">Découvrez toute l'actualité</h1>
  19.     </header>
  20.     <div class="t-page__wrap">
  21.         {{ render(controller('App\\Controller\\WidgetController::breadcrumb', {'request': app.request})) }}
  22.         <div class="t-page__intro">
  23.             Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
  24.             industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
  25.             scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into
  26.             electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
  27.             Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like
  28.             Aldus PageMaker including versions of Lorem Ipsum.
  29.         </div>
  30.     </div>
  31.     <section class="ptForm ptForm--actualite">
  32.         <div class="ptForm__wrap">
  33.             <h2 class="ptForm__title">Rechercher une actu ?</h2>
  34.             <form action="{{ path('app_actualite_list') }}">
  35.                 <div class="ptForm__row">
  36.                     <input type="text" name="pole" value="{{ app.request.get('pole') }}" hidden>
  37.                     <select class="ptForm__select js-tomselect" id="search__pole" name="pole">
  38.                         <option value="">Pôle</option>
  39.                         {% for pole in poles %}
  40.                             <option value="{{ pole.name }}"
  41.                                 {% if poleSearch == pole.name %}selected{% endif %}
  42.                             >
  43.                                     {{ pole.name }}
  44.                             </option>
  45.                         {% endfor %}
  46.                     </select>
  47.                     <select class="ptForm__select js-tomselect" id="search__categorie" name="categorie">
  48.                         <option value="">Catégorie</option>
  49.                         {% for categorie in categories %}
  50.                             <option value="{{ categorie.titre }}"
  51.                                 {% if categorieSearch == categorie.titre %}selected{% endif %}
  52.                             >
  53.                                     {{ categorie.titre }}
  54.                             </option>
  55.                         {% endfor %}
  56.                     </select>
  57.                 </div>
  58.                 <div class="ptForm__row">
  59.                     <button class="ptForm__btn" type="submit">Rechercher
  60.                         <svg><use xlink:href="#caret-right"></use></svg>
  61.                     </button>
  62.                 </div>
  63.                 <div class="ptForm__row">
  64.                     <a href="{{ path('app_actualite_list') }}" class="ptForm__btnClear" id="search__clean" type="button">Effacer les filtres</a>
  65.                 </div>
  66.             </form>
  67.         </div>
  68.     </section>
  69.     {% if actualites is not null %}
  70.     {% set nbPaginate = app.request.query.get('page') %}
  71.         <section class="rechercheActu">
  72.             <div class="rechercheActu__wrap">
  73.                 <div class="rechercheToolbar__top">
  74.                     <p class="rechercheToolbar__nbResult">Résultats de la recherche : 
  75.                         {% if actualites|length <= 1 %}
  76.                         {{ actualites|length }} événement
  77.                         {% else %}
  78.                         {{ actualites|length }} événements
  79.                         {% endif %}
  80.                     </p>
  81.                 </div>
  82.                 {% if actualites is empty %}
  83.                     <p>Aucune actualité pour le moment. </p>
  84.                 {% else %} 
  85.                     {# Pagination haute#}
  86.                     <div class="pagination-ligne">               
  87.                         {% if nbPaginate > 1 %}
  88.                             <a class="pagination-fleche-gauche" href="{{ path("app_actualite_list", { 'page': nbPaginate - 1 }) }}">◀</a> 
  89.                         {% endif %}
  90.                         
  91.                         {{ ttskch_paginator_pager() }} 
  92.                         {% set x = (app.request.query.get('page') is null) ?  2 : 1 %}
  93.                         {% if (nbActus/10) > nbPaginate %}
  94.                             <a class="pagination-fleche-droite" href="{{ path("app_actualite_list", { 
  95.                                 'page': nbPaginate + x 
  96.                                 }) }}">▶</a>
  97.                     </div>
  98.                 {% endif %}
  99.                     <div class="rechercheActu__grid">
  100.                         {% for actualite in actualites %}
  101.                             <a class="rechercheActu__item" href="{{ path('app_actualite_detail', {'actualite': actualite.id}) }}" style="background-image: url({{ asset('/uploads/medias/' ~ actualite.banniere.filepath)|imagine_filter('c350') }});">
  102.                                 <h3 class="rechercheActu__title">{{ actualite.titre }}</h3>
  103.                                 <div class="rechercheActu__txt">{{ actualite.description | raw }}</div>
  104.                             </a>
  105.                         {% endfor %}
  106.                     </div>            
  107.                     {# Pagination basse#}
  108.                     <div class="pagination-ligne">               
  109.                         {% if nbPaginate > 1 %}
  110.                             <a class="pagination-fleche-gauche" href="{{ path("app_actualite_list", { 'page': nbPaginate - 1 }) }}">◀</a> 
  111.                         {% endif %}
  112.                         
  113.                         {{ ttskch_paginator_pager() }} 
  114.                         {% set x = (app.request.query.get('page') is null) ?  2 : 1 %}
  115.                         {% if (nbActus/10) > nbPaginate %}
  116.                             <a class="pagination-fleche-droite" href="{{ path("app_actualite_list", { 
  117.                                 'page': nbPaginate + x 
  118.                                 }) }}">▶</a>
  119.                         {% endif %}
  120.                     </div>
  121.                 {% endif %}
  122.                 
  123.                 <div class="rechercheToolbar__bottom">
  124.                     &nbsp;
  125.                     {# <div class="rechercheToolbar__pagi">TODO: Pagination</div> #}
  126.                 </div>
  127.             </div>
  128.         </section>
  129.     {% endif %}
  130. </main>
  131. {% endblock %}