templates/search/search.html.twig line 1

Open in your IDE?
  1. {% extends 'layout.html.twig' %}
  2. {% block layout %}
  3.     <div class="row">
  4.         <div class="d-lg-block col-lg-3 homepage-navbar">
  5.             <div class="list-group">
  6.                 <a href="{{ path('search', {search: search, categorie: null}) }}" class="list-group-item list-group-item-action {{ (null == categoryRequest) ? "active" : "" }}">
  7.                     Toutes les catégories
  8.                 </a>
  9.                 <a href="{{ path('search', {search: search, categorie: 'jurisprudences'}) }}" class="color jurisprudence list-group-item list-group-item-action {{ ('jurisprudences' == categoryRequest) ? "active" : "" }}">
  10.                     Jurisprudences
  11.                 </a>
  12.                 <div class="list-group list-group-horizontal">
  13.                     <a href="{{ path('search', {search: search, categorie: 'tutos'}) }}" class="color tuto flex-fill list-group-item list-group-item-action {{ ('tutos' == categoryRequest) and (null == catId) ? "active" : "" }}" style="border-radius:0px;">
  14.                         La Base
  15.                     </a>
  16.                     <button class="list-group-item list-group-item-action col-2 {{ ('tutos' == categoryRequest) and (null == catId) ? "active" : "" }}" type="button" data-toggle="collapse" data-target="#tutoscat" aria-expanded="false" aria-controls="tutoscat" style="text-align:center;border-radius:0px;"><span class="fa fa-caret-down"></button>
  17.                 </div>
  18.                 {% for labaseCat in labaseCategory %}
  19.                     <a id="tutoscat" href="{{ path('search', {search: search, categorie: 'tutos', id: labaseCat.id}) }}" class="{{ ('tutos' == categoryRequest) and (null != catId) ? "" : "collapse"}} list-group-item list-group-item-action {{ ('tutos' == categoryRequest) and (catId == labaseCat.id) ? "active" : "" }}"><i>{{labaseCat.name}}</i></a>
  20.                 {% endfor %}
  21.                 <div class="list-group list-group-horizontal">
  22.                     <a href="{{ path('search', {search: search, categorie: 'infos'}) }}" class="color news  list-group-item list-group-item-action {{ ('infos' == categoryRequest) and (null == catId) ? "active" : "" }}" style="border-radius:0px;">
  23.                         Actus
  24.                     </a>
  25.                     <button class="list-group-item list-group-item-action col-2 {{ ('infos' == categoryRequest) and (null == catId) ? "active" : "" }}" type="button" data-toggle="collapse" data-target="#newscat" aria-expanded="false" aria-controls="tutoscat" style="text-align:center;border-radius:0px;"><span class="fa fa-caret-down"></button>
  26.                 </div>
  27.                 {% for newsCat in newsCategory %}
  28.                     <a id="newscat" href="{{ path('search', {search: search, categorie: 'infos', id: newsCat.id}) }}" class="{{('infos' == categoryRequest) and (null != catId) ? "" : "collapse" }} list-group-item list-group-item-action {{ ('infos' == categoryRequest) and (catId == newsCat.id) ? "active" : "" }}"><i>{{newsCat.name}}</i></a>
  29.                 {% endfor %}
  30.             </div>
  31.         </div>
  32.         <div class="col-lg-9 col-12">
  33.             <div class="row">
  34.                 {% if dataContent|length > 0 %}
  35.                     {% for data in dataContent %}
  36.                         <div class="col-sm-12 col-lg-6 liste">
  37.                             <div class="card" style="border: 1px solid black;height: 100%;min-height:215px">
  38.                                 <h5 class="card-header color {% if data.type == 'tuto' %} tuto {% elseif data.type == 'news' %} news {% else %} jurisprudence {% endif %}">
  39.                                     <strong>
  40.                                         {{ data.title }}
  41.                                     </strong>
  42.                                 </h5>
  43.                                 <div class="card-body">
  44.                                     <p class="card-text">
  45.                                         <i>
  46.                                             {% if data.chapo != null %}
  47.                                                 {{ data.chapo|length > 200 ? data.chapo|slice(0,200)|raw : data.chapo|raw }}
  48.                                                 {{ data.chapo|length > 200 ? '...' : ''}}
  49.                                             {% else %}
  50.                                                 {{ data.content|length > 200 ? data.content|slice(0,200)|raw : data.content|raw }}
  51.                                                 {{ data.content|length > 200 ? '...' : ''}}
  52.                                             {% endif %}
  53.                                         </i>
  54.                                     </p>
  55.                                 </div>
  56.                                 <div class="card-footer">
  57.                                     {% if data.type == 'tuto' %}
  58.                                         <a href="{{ path('tuto_read', {tutoId: data.id}) }}" style="float:right; background-color:var(--info); border-color:var(--info);" class="btn btn-primary">
  59.                                             Lire l'article
  60.                                         </a>
  61.                                     {% elseif data.type == 'news' %}
  62.                                         <a href="{{ path('news_read', {actuId: data.id}) }}" style="float:right; background-color:var(--news-color); border-color:var(--news-color);" class="btn btn-primary">
  63.                                             Lire l'actu
  64.                                         </a>
  65.                                     {% else %}
  66.                                         <a href="{{ path('jurisprudence_show', {jurisprudenceId: data.id}) }}" style="float:right;" class="btn btn-primary">
  67.                                             Consulter la jurisprudence
  68.                                         </a>
  69.                                     {% endif %}
  70.                                 </div>
  71.                             </div>
  72.                         </div>
  73.                     {% endfor %}
  74.                 {% else %}
  75.                     <div class="col-12">
  76.                         <p>
  77.                             Aucune ressource ne correspond à votre recherche
  78.                         </p>
  79.                     </div>
  80.                 {% endif %}
  81.             </div>
  82.         </div>
  83.     </div>
  84. {% endblock %}