{% from '@openform_front_templates/_includes/_icons.html.twig' import search, close %}
<script>
jQuery(function () {
$('.range-everywhere').click(function () {
$('.range-all-entity, .range-entity').prop('checked', false);
});
$('.range-all-entity').click(function () {
$('.range-everywhere').prop('checked', false);
var dataRange = $(this).data('range');
$('.range-entity[data-range=' + dataRange + ']').prop('checked', false);
});
$('.range-entity').click(function () {
$('.range-everywhere').prop('checked', false);
var dataRange = $(this).data('range');
$('.range-all-entity[data-range=' + dataRange + ']').prop('checked', false);
});
});
</script>
<form action="{{ toolkit_route_localizer.generate('search', {}, app.request.locale) }}" class="search-filters-form" autocomplete="off" >
{#rangePath <input class="range-path" type="text" name="rangePath" value="{{ filters.rangePath is defined ? filters.rangePath }}"/>#}
<div class="search-filters-form__title">
{{ ('T_SEARCH_RESULTS' ~(filters.phrase is defined ? '_FOR_PHRASE') )|trans({}, 'openform_front', app.request.locale) }}:
</div>
<input class="search-filters-form__phrase" type="search" name="phrase" value="{{ filters.phrase is defined ? filters.phrase }}"
title="{{ 'T_SEARCH_ON_THE_SITE'|trans({}, 'openform_front', app.request.locale) }}"
/>
<div class="search-filters-form__container">
{# EveryEhere #}
<div class="checkbox search-filters-form__container__everywhere">
<input class="range-everywhere visuallyhidden" type="checkbox" name="rangeEverywhere" value="1" {{ filters.rangeEverywhere is defined ? 'checked' }} id="rangeEverywhere" />
<label for="rangeEverywhere">
<div>
{{ 'T_EVERYWHERE'|trans({}, 'openform_front', app.request.locale) }} <span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeEverywhere', 1) }})</span>
</div>
</label>
</div>
<div class="search-filters-form__wrapper">
{# Exhibitions #}
<div class="checkbox">
<input class="range-all-entity visuallyhidden" data-range="exhibitions" type="checkbox" name="rangeAllExhibition" id="rangeAllExhibition" value="1" {{ filters.rangeAllExhibition is defined ? 'checked' }} />
<label for="rangeAllExhibition">
<div>
{{ 'T_VIRTUAL_EXHIBITIONS'|trans({}, 'openform_front', app.request.locale) }}
<span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeAllExhibition', 1) }})</span>
</div>
</label>
</div>
<div class="search-filters-form__wrap">
{% for key, item in openform_front_util.getItemsForSearch('Exhibition', app.request.locale) %}
<div class="checkbox">
<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' }} />
<label for="exhibitions-{{key}}">
<div>
{{ item.Translation[app.request.locale].title }}
<span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'exhibitions', [item.id]) }})</span>
</div>
</label>
</div>
{% endfor %}
</div>
{# Museums #}
<div class="checkbox">
<input class="range-all-entity visuallyhidden" data-range="museums" type="checkbox" name="rangeAllMuseum" value="1" id="rangeAllMuseum" {{ filters.rangeAllMuseum is defined ? 'checked' }} />
<label for="rangeAllMuseum">
<div>
{{ 'T_VIRTUAL_MUSEUMS'|trans({}, 'openform_front', app.request.locale) }}
<span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeAllMuseum', 1) }})</span>
</div>
</label>
</div>
<div class="search-filters-form__wrap">
{% for key, item in openform_front_util.getItemsForSearch('Museum', app.request.locale) %}
<div class="checkbox">
<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}}"/>
<label for="museums-{{key}}">
<div>
{{ item.Translation[app.request.locale].title }}
<span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'museums', [item.id]) }})</span>
</div>
</label>
</div>
{% endfor %}
</div>
{# Archives #}
<div class="checkbox">
<input class="range-all-entity visuallyhidden" data-range="archives" type="checkbox" name="rangeAllArchive" id="rangeAllArchive" value="1" {{ filters.rangeAllArchive is defined ? 'checked' }} />
<label for="rangeAllArchive">
<div>
{{ 'T_VIRTUAL_ARCHIVES'|trans({}, 'openform_front', app.request.locale) }}
<span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeAllArchive', 1) }})</span>
</div>
</label>
</div>
<div class="search-filters-form__wrap">
{% for key, item in openform_front_util.getItemsForSearch('Archive', app.request.locale) %}
<div class="checkbox">
<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' }} />
<label for="archives-{{key}}">
<div>
{{ item.Translation[app.request.locale].title }}
<span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'archives', [item.id]) }})</span>
</div>
</label>
</div>
{% endfor %}
</div>
{# PrivateCollections #}
<div class="checkbox">
<input class="range-all-entity visuallyhidden" data-range="privateCollections" type="checkbox" name="rangeAllPrivateCollection" id="rangeAllPrivateCollection" value="1" {{ filters.rangeAllPrivateCollection is defined ? 'checked' }} />
<label for="rangeAllPrivateCollection">
<div>
{{ 'T_VIRTUAL_PRIVATE_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}
<span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'rangeAllPrivateCollection', 1) }})</span>
</div>
</label>
</div>
<div class="search-filters-form__wrap">
{% for key, item in openform_front_util.getItemsForSearch('PrivateCollection', app.request.locale) %}
<div class="checkbox">
<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' }} />
<label for="privateCollections-{{key}}">
<div>
{{ item.Translation[app.request.locale].title }}
<span class="num-of-items">({{ openform_front_util.count(app.request.locale, filters, 'privateCollections', [item.id]) }})</span>
</div>
</label>
</div>
{% endfor %}
</div>
</div>
<button class="btn search-form__buttons__button search-filters-form__btn" type="submit" name="search" value="1">
<span>{{ 'T_SEARCH_ON_THE_SITE_BTN'|trans({}, 'openform_front', app.request.locale) }}</span>
</button>
</div>
</form>