templates/modules/searchbar/searchbar.twig line 1

Open in your IDE?
  1. {% set button = button ?: false %}
  2. {% set responsive_js = responsive_js ?: false %}
  3. {% set entity = entity ?: '' %}
  4. {% set with_form = with_form ?: false %}
  5. {% set with_button = with_button ?: 'o' %}
  6. {% if not button and with_form %}
  7. <div class="grid-container search-container">
  8.     <form action="{{link}}"
  9.         class="searchBar grid-x align-center {{responsive_js ? "js-searchbar-responsive"}} {{annuairePage ? "searchBar_annuaire"}}">
  10.         {% endif %}
  11.         {% for input in inputs %}
  12.         <div class="searchBar-group">
  13.             {% if button %}
  14.               <div class="searchBar-group-button btn btn_whiteBkg btn_blueBorder btn_cat">{{ input.name }} 
  15.                 <img src="{{ asset('images/svg/icon_arrowDown_blue.svg') }}" />
  16.               </div>
  17.             {% else %}
  18.               <input 
  19.                 type="text" 
  20.                 name="{{ input.name }}" 
  21.                 autocomplete="off" id="{{ bigSearch ? "bigsearchInput" }}"
  22.                 class="searchBar-group-input {{ input.options.arrow ? "searchBar-group-input_arrowIcon" : "" }} {{ input.options.pen ? "searchBar-group-input_penIcon" : "" }}"
  23.                 placeholder="{{ input.placeholder }}" 
  24.                 entity="{{ entity }}"
  25.                 required="{{ entity == 'bigsearch' ? 'true' : false }}"
  26.               />
  27.               {% if app.request.query.has('annee') %}
  28.                 <input type="hidden" name="annee" value="{{ app.request.query.get('annee') }}" />
  29.               {% endif %}
  30.             {% endif %}
  31.             {% if entity != 'bigsearch' %}
  32.               <div class="searchBar-group-dropdown grid-y {{ not result_categories ?: 'stuff_home' }}">
  33.                   {% if input.options.arrow %}
  34.                   <div class="searchBar-group-dropdown-section">
  35.                     <p class="searchBar-group-dropdown-section-title" id="locate_me">
  36.                       <a href="javascript:;" style="color:#525c66;">
  37.                         <img src="/assets/images/svg/arrowIcon_dark.svg"> Autour de moi
  38.                       </a>
  39.                     </p>
  40.                   </div>
  41.                   {% endif %}
  42.                   {% if input.options.pen and result_categories %}
  43.                   <div class="searchBar-group-dropdown-section" id="default_entities">
  44.                       {% for cat in result_categories %}
  45.                       <p class="searchBar-group-dropdown-section-queries-item"
  46.                           onclick="setStuff({{'"' ~ cat.name ~ '"'}}, {{cat.alias}})">{{cat.name}}</p>
  47.                       {% endfor %}
  48.                       <p><i>ou taper votre recherche ...</i></p>
  49.                   </div>
  50.                   {% endif %}
  51.                   <div class="searchBar-group-dropdown-section" id="list_{{ input.name }}"></div>
  52.               </div>
  53.               <input type="hidden" id="{{ input.name }}">
  54.             {% endif %}
  55.         </div>
  56.         {% endfor %}
  57.         {% if not button and with_button == 'o' %}
  58.           {% if entity == "centres affiliés" or entity == 'bigsearch' or entity == "videos" %}
  59.             <button type="submit" class="btn btn-extra">Rechercher</button>
  60.           {% else %}
  61.             <button type="button" id="submit" class="btn">Rechercher</button>
  62.           {% endif %}
  63.         {% endif %}
  64.         {% if not button and with_form %}
  65.     </form>
  66.     {% if pageType is defined and pageType == "center_lists" %}
  67.     <div class="cell flex-container filter-wrapper">
  68.         <button type="button" class="btn filter-wrapper_button">
  69.           Filtrer
  70.         </button>
  71.     </div>
  72.     {% endif %}
  73. </div>
  74. {% endif %}
  75. {% if not button and with_form %}
  76. {% if pageType is defined and pageType == "center_lists" %}
  77. <div class="grid-container filters-wrapper">
  78.     {% include "modules/select/select.twig" with {
  79.         "inputs" : [
  80.             {
  81.                 "name": "Réseaux",
  82.                 "queries": dropdown.networks
  83.             },
  84.             {
  85.                 "name": "Diplômes",
  86.                 "queries": dropdown.degrees
  87.             }
  88.         ]
  89.     } %}
  90. </div>
  91. {% endif %}
  92. {% endif %}