src/Package/Openform/Front/Templates/_includes/_search.html.twig line 1

Open in your IDE?
  1. {% from '@openform_front_templates/_includes/_icons.html.twig' import search, close %}
  2. <div 
  3.     class="search-modal js-header-search" 
  4.     tabindex="-1" 
  5.     role="dialog" 
  6.     aria-label="{{ 'HEADER_SEARCH'|trans({}, 'openform_front', app.request.locale) }}"
  7.     >
  8.     <div class="search-modal__header">
  9.         <button class="search-modal__close js-close-dialog" type="button">
  10.             {{'CLOSE_WINDOW'|trans({}, 'openform_front', app.request.locale)}}
  11.             <span>{{ close('CLOSE_WINDOW'|trans({}, 'openform_front', app.request.locale)) }}</span>
  12.         </button>
  13.     </div>
  14.     <form 
  15.         class="search-form js-search-modal" 
  16.         action="{{ toolkit_route_localizer.generate('search', {}, app.request.locale) }}" 
  17.         autocomplete="off"
  18.         >
  19.         {% if entity is defined and entity.idName is defined and entity.idName == 'page_collections'  %}
  20.             {% set rangeAllExhibition = 1 %}
  21.             {% set rangeAllArchive = 1 %}
  22.             {% set rangeAllMuseum = 1 %}
  23.             {% set rangeAllPrivateCollection = 1 %}
  24.             
  25.         {% elseif entity is defined and entity.idName is defined and entity.idName == 'page_exhibitions'  %}
  26.             {% set rangeAllExhibition = 1 %}
  27.             
  28.         {% elseif entity is defined and entity.idName is defined and entity.idName == 'page_archives'  %}
  29.             {% set rangeAllArchive = 1 %}
  30.             
  31.         {% elseif entity is defined and entity.idName is defined and entity.idName == 'page_museums'  %}
  32.             {% set rangeAllMuseum = 1 %}
  33.             
  34.         {% elseif entity is defined and entity.idName is defined and entity.idName == 'page_private_collections'  %}
  35.             {% set rangeAllPrivateCollection = 1 %}
  36.             
  37.         {% elseif rootParent is defined and rootParent|getClassName in ['Exhibition','Museum','Archive','PrivateCollection']  %}
  38.             {% set rangeRootParent = rootParent|getClassName ~'_'~ rootParent.id  %}
  39.             
  40.         {% endif %}
  41. {#        {% if filters is defined and filters.rangePath is defined and filters.rangePath %}
  42.             {% set rangePath = filters.rangePath %}            
  43.         {% elseif (rootParent is defined and rootParent in ['Exhibition','Museum','Archive','PrivateCollection'])  %}
  44.             {% if entity is defined and entity|getClassName not in ['Antique','Relict'] %}
  45.                 {% set rangePath ='|'~ entity|getClassName ~ '_' ~ entity.id ~ '|' %}                    
  46.             {% endif %}
  47.         {% endif %}
  48.         {% if rangePath is defined %}
  49.             <input type="text" name="rangePath" value="{{ rangePath }}" />
  50.             {{ openform_front_util.getTitleByRangePath(rangePath, app.request.locale) }}
  51.         {% endif %}#}
  52.         <h2 class="search-form__wrapper__title">{{ 'T_SEARCH_ON_THE_SITE'|trans({}, 'openform_front', app.request.locale) }}</h2>
  53.         <input 
  54.             class="search-form__wrapper__input js-search-input" 
  55.             id="search-form-input" 
  56.             placeholder="{{ 'T_ENTER_THE_SEARCH_PHRASE'|trans({}, 'openform_front', app.request.locale) }}" 
  57.             type="search" 
  58.             name="phrase"  
  59.             value="{{ filters.phrase is defined ? filters.phrase }}"  
  60.             title="{{ 'T_SEARCH_ON_THE_SITE'|trans({}, 'openform_front', app.request.locale) }}"
  61.             >
  62.         <div class="search-form__wrapper">
  63.             <div class="search-form__wrapper__section">
  64.                 <div class="checkbox">
  65.                     <input type="checkbox" id="everywhere-check" name="rangeEverywhere" class="visuallyhidden js-search-item-all"
  66.                            {{ filters.rangeEverywhere is defined ? 'checked' }} value="1"   >
  67.                     <label for="everywhere-check">
  68.                         {{ 'T_EVERYWHERE'|trans({}, 'openform_front', app.request.locale) }}
  69.                     </label>
  70.                 </div>
  71.             </div>
  72.             <div class="search-form__wrapper__section">
  73.                 <div class="search-form__wrapper__item js-search-item" data-placeholder="Wszystkie wystawy">
  74.                     <div class="checkbox">
  75.                         <input type="checkbox" id="virtual-exhibitions-check" name="rangeAllExhibition" value="1" class="visuallyhidden js-search-check" 
  76.                                {{ rangeAllExhibition is defined or filters.rangeAllExhibition is defined ? 'checked' }} />
  77.                         <label for="virtual-exhibitions-check">
  78.                             {{ 'T_VIRTUAL_EXHIBITIONS'|trans({}, 'openform_front', app.request.locale) }}
  79.                         </label>
  80.                     </div>
  81.                     <div class="select select--top">
  82.                         <select class="js-choice" name="exhibitions[]" multiple >
  83.                             {% for item in openform_front_util.getItemsForSearch('Exhibition', app.request.locale) %}
  84.                                 <option value="{{ item.id }}" {{ (rangeRootParent is defined and rangeRootParent == 'Exhibition_'~item.id) or (filters.exhibitions is defined and item.id in filters.exhibitions) ? 'selected' }}  >
  85.                                     {{ item.Translation[app.request.locale].title }}
  86.                                 </option>
  87.                             {% endfor %}                            
  88.                         </select>
  89.                     </div>
  90.                 </div>
  91.                 <div class="search-form__wrapper__item js-search-item" data-placeholder="Wszystkie muzea">
  92.                     <div class="checkbox">
  93.                         <input type="checkbox" id="virtual-museums-check" name="rangeAllMuseum" value="1" class="visuallyhidden js-search-check"
  94.                                {{ rangeAllMuseum is defined or filters.rangeAllMuseum is defined ? 'checked' }}  />
  95.                         <label for="virtual-museums-check">
  96.                             {{ 'T_VIRTUAL_MUSEUMS'|trans({}, 'openform_front', app.request.locale) }}
  97.                         </label>
  98.                     </div>
  99.                     <div class="select select--top">
  100.                         <select class="js-choice" name="museums[]" multiple >
  101.                             {% for item in openform_front_util.getItemsForSearch('Museum', app.request.locale) %}
  102.                                 <option value="{{ item.id }}" {{ (rangeRootParent is defined and rangeRootParent == 'Museum_'~item.id) or (filters.museums is defined and item.id in filters.museums) ? 'selected' }}  >
  103.                                     {{ item.Translation[app.request.locale].title }}
  104.                                 </option>
  105.                             {% endfor %} 
  106.                         </select>
  107.                     </div>
  108.                 </div>
  109.                 <div class="search-form__wrapper__item js-search-item" data-placeholder="Wszystkie archiwa">
  110.                     <div class="checkbox">
  111.                         <input type="checkbox" id="virtual-archives-check" name="rangeAllArchive" value="1" class="visuallyhidden js-search-check"
  112.                                {{ rangeAllArchive is defined or filters.rangeAllArchive is defined ? 'checked' }} />
  113.                         <label for="virtual-archives-check">
  114.                             {{ 'T_VIRTUAL_ARCHIVES'|trans({}, 'openform_front', app.request.locale) }}
  115.                         </label>
  116.                     </div>
  117.                     <div class="select">
  118.                         <select class="js-choice" name="archives[]" multiple >
  119.                             {% for item in openform_front_util.getItemsForSearch('Archive', app.request.locale) %}    
  120.                                 <option value="{{ item.id }}" {{ (rangeRootParent is defined and rangeRootParent == 'Exhibition_'~item.id) or (filters.exhibitions is defined and item.id in filters.exhibitions) ? 'selected' }}  >        
  121.                                     {{ item.Translation[app.request.locale].title }}
  122.                                 </option>
  123.                             {% endfor %} 
  124.                         </select>
  125.                     </div>
  126.                 </div>
  127.                 <div class="search-form__wrapper__item js-search-item" data-placeholder="Wszystkie kolekcje prywatne">
  128.                     <div class="checkbox">
  129.                         <input type="checkbox" id="virtual-private-collections-check" name="rangeAllPrivateCollection" value="1" class="visuallyhidden js-search-check"
  130.                                {{ rangeAllPrivateCollection is defined or filters.rangeAllPrivateCollection is defined ? 'checked' }} />
  131.                         <label for="virtual-private-collections-check">
  132.                             {{ 'T_VIRTUAL_PRIVATE_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}
  133.                         </label>
  134.                     </div>
  135.                     <div class="select">
  136.                         <select class="js-choice" name="privateCollections[]" multiple >
  137.                             {% for item in openform_front_util.getItemsForSearch('PrivateCollection', app.request.locale) %}
  138.                                 <option value="{{ item.id }}" {{ (rangeRootParent is defined and rangeRootParent == 'PrivateCollection_'~item.id) or (filters.privateCollections is defined and item.id in filters.privateCollections) ? 'selected' }}  >
  139.                                     {{ item.Translation[app.request.locale].title }}
  140.                                 </option>
  141.                             {% endfor %} 
  142.                         </select>
  143.                     </div>
  144.                 </div>
  145.             </div>
  146.         </div>
  147.         <div class="search-form__buttons">
  148.             <button 
  149.                 class="btn search-form__buttons__button" 
  150.                 type="submit"
  151.                 >
  152.                 <span>{{ 'T_SEARCH_ON_THE_SITE_BTN'|trans({}, 'openform_front', app.request.locale) }}</span>
  153.             </button>
  154.         </div>            
  155.     </form>
  156. </div>