src/Package/Openform/Front/Templates/Search/_filters.html.twig line 1

Open in your IDE?
  1. {% from '@openform_front_templates/_includes/_icons.html.twig' import search, close %}
  2. <script>
  3.     jQuery(function () {
  4.         $('.range-everywhere').click(function () {
  5.             $('.range-all-entity, .range-entity').prop('checked', false);
  6.         });
  7.         $('.range-all-entity').click(function () {
  8.             $('.range-everywhere').prop('checked', false);
  9.             var dataRange = $(this).data('range');
  10.             $('.range-entity[data-range=' + dataRange + ']').prop('checked', false);
  11.         });
  12.         $('.range-entity').click(function () {
  13.             $('.range-everywhere').prop('checked', false);
  14.             var dataRange = $(this).data('range');
  15.             $('.range-all-entity[data-range=' + dataRange + ']').prop('checked', false);
  16.         });
  17.     });
  18. </script>
  19. <form action="{{ toolkit_route_localizer.generate('search', {}, app.request.locale) }}"  class="search-filters-form" autocomplete="off" >
  20.     
  21.     {#rangePath <input class="range-path" type="text" name="rangePath" value="{{ filters.rangePath is defined ? filters.rangePath }}"/>#}
  22.     <div class="search-filters-form__title">
  23.         {{ ('T_SEARCH_RESULTS' ~(filters.phrase is defined ? '_FOR_PHRASE') )|trans({}, 'openform_front', app.request.locale) }}:
  24.     </div>
  25.     <input class="search-filters-form__phrase" type="search" name="phrase" value="{{ filters.phrase is defined ? filters.phrase }}" 
  26.            title="{{ 'T_SEARCH_ON_THE_SITE'|trans({}, 'openform_front', app.request.locale) }}"
  27.            />
  28.     <div class="search-filters-form__container">
  29.         
  30.     
  31.         {# EveryEhere #}
  32.         <div class="checkbox search-filters-form__container__everywhere">
  33.             <input class="range-everywhere visuallyhidden" type="checkbox" name="rangeEverywhere" value="1"  {{ filters.rangeEverywhere is defined ? 'checked' }} id="rangeEverywhere" />
  34.             <label for="rangeEverywhere">
  35.                 <div>
  36.                    {{ 'T_EVERYWHERE'|trans({}, 'openform_front', app.request.locale) }} <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeEverywhere', 1) }})</span> 
  37.                 </div>
  38.                 
  39.             </label>
  40.         </div>
  41.         <div class="search-filters-form__wrapper">
  42.             {# Exhibitions #}
  43.             <div class="checkbox">
  44.                 <input class="range-all-entity visuallyhidden" data-range="exhibitions" type="checkbox" name="rangeAllExhibition" id="rangeAllExhibition" value="1"  {{ filters.rangeAllExhibition is defined ? 'checked' }} />
  45.                 <label for="rangeAllExhibition">
  46.                     <div>
  47.                         {{ 'T_VIRTUAL_EXHIBITIONS'|trans({}, 'openform_front', app.request.locale) }}
  48.                         <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeAllExhibition', 1) }})</span>
  49.                     </div>
  50.                     
  51.                     
  52.                 </label>
  53.             </div>
  54.             <div class="search-filters-form__wrap">
  55.                 {% for key, item in openform_front_util.getItemsForSearch('Exhibition', app.request.locale) %}
  56.                     <div class="checkbox">
  57.                         <input class="range-entity visuallyhidden" data-range="exhibitions" type="checkbox" name="exhibitions[]" id="exhibitions-{{key}}" value="{{ item.id }}" {{ filters.exhibitions is defined and item.id in filters.exhibitions ? 'checked' }} />
  58.                         <label for="exhibitions-{{key}}">
  59.                             <div>
  60.                                 {{ item.Translation[app.request.locale].title }}
  61.                                 <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'exhibitions', [item.id]) }})</span>
  62.                             </div>
  63.                         </label>
  64.                     </div>
  65.                 {% endfor %} 
  66.             </div>
  67.             {# Museums #}
  68.             <div class="checkbox">
  69.                 <input class="range-all-entity visuallyhidden" data-range="museums" type="checkbox" name="rangeAllMuseum" value="1" id="rangeAllMuseum"  {{ filters.rangeAllMuseum is defined ? 'checked' }} />
  70.                 <label for="rangeAllMuseum">
  71.                     <div>
  72.                         {{ 'T_VIRTUAL_MUSEUMS'|trans({}, 'openform_front', app.request.locale) }}
  73.                         <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeAllMuseum', 1) }})</span>
  74.                     </div>
  75.                     
  76.                     
  77.                 </label>
  78.             </div>
  79.             <div class="search-filters-form__wrap">
  80.                 {% for key, item in openform_front_util.getItemsForSearch('Museum', app.request.locale) %}
  81.                     <div class="checkbox">
  82.                         <input class="range-entity visuallyhidden" data-range="museums" type="checkbox" name="museums[]" value="{{ item.id }}" {{ filters.museums is defined and item.id in filters.museums ? 'checked' }} id="museums-{{key}}"/>
  83.                         <label for="museums-{{key}}">
  84.                             <div>
  85.                                 {{ item.Translation[app.request.locale].title }}
  86.                                 <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'museums', [item.id]) }})</span>  
  87.                             </div>
  88.                             
  89.                             
  90.                         </label>
  91.                     </div>
  92.                 {% endfor %} 
  93.             </div>
  94.             {# Archives #}
  95.             <div class="checkbox">
  96.                 <input class="range-all-entity visuallyhidden" data-range="archives" type="checkbox" name="rangeAllArchive" id="rangeAllArchive" value="1"  {{ filters.rangeAllArchive is defined ? 'checked' }} />
  97.                 <label for="rangeAllArchive">
  98.                 <div>
  99.                     {{ 'T_VIRTUAL_ARCHIVES'|trans({}, 'openform_front', app.request.locale) }}
  100.                     <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeAllArchive', 1) }})</span>
  101.                 </div>
  102.                     
  103.                     
  104.                 </label>
  105.             </div>
  106.             <div class="search-filters-form__wrap">
  107.                 {% for key, item in openform_front_util.getItemsForSearch('Archive', app.request.locale) %}
  108.                     <div class="checkbox">
  109.                         <input class="range-entity visuallyhidden" data-range="archives" type="checkbox" id="archives-{{key}}" name="archives[]" value="{{ item.id }}" {{ filters.archives is defined and item.id in filters.archives ? 'checked' }} />
  110.                         <label for="archives-{{key}}">
  111.                             <div>
  112.                                 {{ item.Translation[app.request.locale].title }}
  113.                                 <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'archives', [item.id]) }})</span>
  114.                             </div>
  115.                             
  116.                             
  117.                         </label>
  118.                     </div>
  119.                 {% endfor %} 
  120.             </div>
  121.             {# PrivateCollections #}
  122.             <div class="checkbox">
  123.                 <input class="range-all-entity visuallyhidden" data-range="privateCollections" type="checkbox" name="rangeAllPrivateCollection" id="rangeAllPrivateCollection" value="1"  {{ filters.rangeAllPrivateCollection is defined ? 'checked' }} />
  124.                 <label for="rangeAllPrivateCollection">
  125.                     <div>
  126.                        {{ 'T_VIRTUAL_PRIVATE_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}
  127.                         <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeAllPrivateCollection', 1) }})</span> 
  128.                     </div>
  129.                     
  130.                     
  131.                 </label>
  132.             </div>
  133.             <div class="search-filters-form__wrap">
  134.                 {% for key, item in openform_front_util.getItemsForSearch('PrivateCollection', app.request.locale) %}
  135.                     <div class="checkbox">
  136.                         <input class="range-entity visuallyhidden" data-range="privateCollections" type="checkbox" name="privateCollections[]" id="privateCollections-{{key}}" value="{{ item.id }}" {{ filters.privateCollections is defined and item.id in filters.privateCollections ? 'checked' }} />
  137.                         <label for="privateCollections-{{key}}"> 
  138.                             <div>
  139.                                 {{ item.Translation[app.request.locale].title }}
  140.                                 <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'privateCollections', [item.id]) }})</span>
  141.                             </div>
  142.                             
  143.                             
  144.                         </label>
  145.                     </div>
  146.                 {% endfor %} 
  147.             </div>
  148.         </div>
  149.         <button class="btn search-form__buttons__button search-filters-form__btn" type="submit" name="search" value="1">
  150.             <span>{{ 'T_SEARCH_ON_THE_SITE_BTN'|trans({}, 'openform_front', app.request.locale) }}</span>
  151.         </button>
  152.     </div>
  153. </form>