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

  1. {% extends 'front_layout.html.twig' %}
  2. {% block title %}Formations{% endblock %}
  3. {% block body %}
  4. <main class="t-page">
  5.     {% set mediaPoleRecherche = null %}
  6.     {% for pole in poles %}
  7.         {% if (selectedPole is defined and selectedPole == pole.name) 
  8.                 or (selectedPole is not defined and pole.name == poleSearch) %}
  9.             {% set mediaPoleRecherche = pole.urlPole.banniere.filepath %}
  10.         {% endif %}
  11.     {% endfor %}
  12.     <header class="t-page__header"
  13.         {% if mediaPoleRecherche is not null %}
  14.             style="background-image: url('{{ asset('/uploads/medias/' ~ mediaPoleRecherche)|imagine_filter('banner') }}');"
  15.         {% else %}
  16.             style="background-image: url('/build/images/grey.jpg');"
  17.         {% endif %}
  18.     >
  19.         <h1 class="t-page__mainTitle">Formations</h1>
  20.     </header>
  21.     <div class="t-page__wrap">
  22.         {{ render(controller('App\\Controller\\WidgetController::breadcrumb', {'request': app.request})) }}
  23.         <div class="t-page__intro">
  24.             Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
  25.             industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
  26.             scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into
  27.             electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
  28.             Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like
  29.             Aldus PageMaker including versions of Lorem Ipsum.
  30.         </div>
  31.     </div>
  32.     <section class="ptForm ptForm--formations">
  33.         <div class="ptForm__wrap">
  34.             <h2 class="ptForm__title">Je recherche ma formation</h2>
  35.             <form action="{{ path('app_formation_list') }}" data-controller="formation" data-formation-url-value="{{ path('change-select-ajax') }}" >
  36.                 {% include "front/formation/include/_recherche.html.twig" %}
  37.                 <div class="ptForm__row">
  38.                     <button class="ptForm__btn" type="submit">Rechercher
  39.                         <svg><use xlink:href="#caret-right"></use></svg>
  40.                     </button>
  41.                 </div>
  42.                 <div class="ptForm__row">
  43.                     <a href="{{ path('app_formation_list') }}" class="ptForm__btnClear" id="search__clean" type="button">Effacer les filtres</a>
  44.                 </div>
  45.             </form>
  46.                 
  47.         </div>
  48.     </section>
  49.     
  50.     {% if formations is not null %}
  51.     {% set poleUrl = app.request.query.get('pole') %}
  52.     {% set diplomeUrl = app.request.query.get('diplome') %}
  53.     {% set contratUrl = app.request.query.get('contrat') %}
  54.     <section class="rechercheFormations">
  55.         <div class="rechercheFormations__wrap" id="resultats-recherche-formation">
  56.             <div class="rechercheToolbar__top">
  57.                 <p class="rechercheToolbar__nbResult">Résultats de la recherche :
  58.                 {% if formations|length <= 1 %}
  59.                     {{ nbFormation }} formation
  60.                 {% else %}
  61.                     {{ nbFormation }} formations
  62.                 {% endif %}
  63.             </p>
  64.             
  65.             {# Pagination #}
  66.             {% set nbPaginate = app.request.query.get('page') %}
  67.             {% set domaine = app.request.query.get('domaine') %}
  68.                 {% if nbFormation > 10 %}
  69.                 <div class="pagination-ligne">               
  70.                     {# {% if nbPaginate > 1 %}
  71.                         <a class="pagination-fleche-gauche" href="{{ path("app_formation_list", { 'page': nbPaginate - 1 }) }}">◀</a> 
  72.                     {% endif %} #}
  73.                     {% if app.request.query.get('domaine') %}
  74.                         {% if nbPaginate > 1 %}
  75.                             <a class="pagination-fleche-gauche" href="{{ path("app_formation_list", {'pole': poleUrl, 'domaine': domaine, 'page': nbPaginate - 1 }) }}">◀</a>
  76.                         {% endif %}
  77.                     {% else %}
  78.                         {% if nbPaginate > 1 %}
  79.                             <a class="pagination-fleche-gauche" href="{{ path("app_formation_list", { 'pole': poleUrl, 'domaine': domaine,'page': nbPaginate - 1 }) }}">◀</a> 
  80.                         {% endif %}
  81.                     {% endif %}                    
  82.                     {{ ttskch_paginator_pager() }}                 
  83.                         {# {{ dump(app.request.query.get('page')) }} #}
  84.                     {% set x = (app.request.query.get('page') is null) ?  2 : 1 %}
  85.                     {% if app.request.query.get('domaine') %}
  86.                         {% if (nbFormation / 10) > nbPaginate %}
  87.                             <a class="pagination-fleche-droite" href="{{ path("app_formation_list", {
  88.                                 'pole': poleUrl,
  89.                                 'domaine': domaine, 
  90.                                 'page': nbPaginate + x
  91.                                 }) }}">▶</a>
  92.                         {% endif %}
  93.                     {% else %}
  94.                         {% if (nbFormation / 10) > nbPaginate %}
  95.                             <a class="pagination-fleche-droite" href="{{ path("app_formation_list", { 
  96.                                 'pole': poleUrl,
  97.                                 'domaine': domaine,
  98.                                 'page': nbPaginate + x
  99.                                 }) }}">▶</a>
  100.                         {% endif %}
  101.                     {% endif %}                   
  102.                 </div>
  103.                 {% endif %}
  104.         </div>
  105.         <div class="rechercheFormations__grid">
  106.             {# <div class="rechercheFormations__domaines">
  107.                 <p class="rechercheFormations__filterTitle">Métiers</p>
  108.                 {% for domaine in domaines %}
  109.                     <a 
  110.                     href="{{ path('app_formation_list', {
  111.                         'pole': poleUrl ? poleUrl : null,
  112.                         'domaine': domaine.titreDomaine,
  113.                         'diplome': diplomeUrl ? diplomeUrl : null,
  114.                         'contrat': contratUrl ? contratUrl : null
  115.                         }) }}" 
  116.                     class="rechercheFormations__filterBtn">
  117.                         {{ domaine.titreDomaine }}
  118.                     </a>
  119.                 {% endfor %}
  120.             </div> #}
  121.             <div class="rechercheFormations__list">                    
  122.                 {% for formation in formations %}
  123.                     <a class="rechercheFormations__item" href="{{ path('app_formation_detail', {'formation': formation.id}) }}">
  124.                         {% if formation.banniere is not null %}
  125.                         <img class="rechercheFormations__img" src="{{ asset('/uploads/medias/' ~ formation.banniere.filepath)|imagine_filter('c250') }}" alt="{{ formation.banniere.alt }}">
  126.                         {% else %}
  127.                         <img class="rechercheFormations__img" src="https://placehold.co/250?text=*" alt="">
  128.                         {% endif %}
  129.                         
  130.                         <div class="rechercheFormations__content">
  131.                             <h3 class="rechercheFormations__title">{{ formation.titreFormation | slice(0,86) }}</h3>
  132.                             {% if formation.contenu is defined %}
  133.                             <div class="rechercheFormations__txt">{{ formation.contenu | striptags | slice(0,220) | raw }}…</div>
  134.                             {% endif %}
  135.                             {% if formation.domaineId.titreDomaine is defined %}
  136.                             <p class="rechercheFormations__domaine">
  137.                                 {% if formation.domaineId is not null %}
  138.                                     {{ formation.domaineId.titreDomaine }}
  139.                                 {% else %}
  140.                                     <p>Non renseigné</p>
  141.                                 {% endif %}
  142.                             </p>
  143.                             {% endif %}
  144.                         </div>
  145.                     </a>
  146.                 {% endfor %}
  147.                 {# Pagination #}
  148.                 {% set nbPaginate = app.request.query.get('page') %}
  149.                 {% set domaine = app.request.query.get('domaine') %}
  150.                     {% if nbFormation > 10 %}
  151.                     <div class="pagination-ligne">               
  152.                         {# {% if nbPaginate > 1 %}
  153.                             <a class="pagination-fleche-gauche" href="{{ path("app_formation_list", { 'page': nbPaginate - 1 }) }}">◀</a> 
  154.                         {% endif %} #}
  155.                         {% if app.request.query.get('domaine') %}
  156.                             {% if nbPaginate > 1 %}
  157.                                 <a class="pagination-fleche-gauche" href="{{ path("app_formation_list", {
  158.                                     'pole': poleUrl, 
  159.                                     'domaine': domaine, 
  160.                                     'page': nbPaginate - 1 
  161.                                     }) }}">◀</a>
  162.                             {% endif %}
  163.                         {% else %}
  164.                             {% if nbPaginate > 1 %}
  165.                                 <a class="pagination-fleche-gauche" href="{{ path("app_formation_list", { 
  166.                                     'pole': poleUrl, 
  167.                                     'domaine': domaine, 
  168.                                     'page': nbPaginate - 1 
  169.                                     }) }}">◀</a> 
  170.                             {% endif %}
  171.                         {% endif %}                    
  172.                         {{ ttskch_paginator_pager() }}                 
  173.                             {# {{ dump(app.request.query.get('page')) }} #}
  174.                         {% set x = (app.request.query.get('page') is null) ?  2 : 1 %}
  175.     
  176.                         {% if app.request.query.get('domaine') %}
  177.                             {% if (nbFormation / 10) > nbPaginate %}
  178.                                 <a class="pagination-fleche-droite" href="{{ path("app_formation_list", {
  179.                                     'pole': poleUrl,
  180.                                     'domaine': domaine, 
  181.                                     'page': nbPaginate + x
  182.                                     }) }}">▶</a>
  183.                             {% endif %}
  184.                         {% else %}
  185.                             {% if (nbFormation / 10) > nbPaginate %}
  186.                                 <a class="pagination-fleche-droite" href="{{ path("app_formation_list", { 
  187.                                     'pole': poleUrl,
  188.                                     'domaine': domaine, 
  189.                                     'page': nbPaginate + x
  190.                                     }) }}">▶</a>
  191.                             {% endif %}
  192.                         {% endif %}                   
  193.                     </div>
  194.                     {% endif %}
  195.             </div>
  196.         </div>
  197.         <div class="rechercheToolbar__bottom">
  198.             &nbsp;
  199.             {# <div class="rechercheToolbar__pagi">TODO: Pagination</div> #}
  200.         </div>
  201.     </section>
  202.     {% endif %}
  203.     {% include 'front/includes/_homeActus.html.twig' %}
  204.     {% include 'front/includes/_homeAnnonces.html.twig' %}
  205.     
  206. </main>
  207. {% endblock %}