{% from '@openform_front_templates/_includes/_icons.html.twig' import search, close %}
<div
class="search-modal js-header-search"
tabindex="-1"
role="dialog"
aria-label="{{ 'HEADER_SEARCH'|trans({}, 'openform_front', app.request.locale) }}"
>
<div class="search-modal__header">
<button class="search-modal__close js-close-dialog" type="button">
{{'CLOSE_WINDOW'|trans({}, 'openform_front', app.request.locale)}}
<span>{{ close('CLOSE_WINDOW'|trans({}, 'openform_front', app.request.locale)) }}</span>
</button>
</div>
<form
class="search-form js-search-modal"
action="{{ toolkit_route_localizer.generate('search', {}, app.request.locale) }}"
autocomplete="off"
>
{% if entity is defined and entity.idName is defined and entity.idName == 'page_collections' %}
{% set rangeAllExhibition = 1 %}
{% set rangeAllArchive = 1 %}
{% set rangeAllMuseum = 1 %}
{% set rangeAllPrivateCollection = 1 %}
{% elseif entity is defined and entity.idName is defined and entity.idName == 'page_exhibitions' %}
{% set rangeAllExhibition = 1 %}
{% elseif entity is defined and entity.idName is defined and entity.idName == 'page_archives' %}
{% set rangeAllArchive = 1 %}
{% elseif entity is defined and entity.idName is defined and entity.idName == 'page_museums' %}
{% set rangeAllMuseum = 1 %}
{% elseif entity is defined and entity.idName is defined and entity.idName == 'page_private_collections' %}
{% set rangeAllPrivateCollection = 1 %}
{% elseif rootParent is defined and rootParent|getClassName in ['Exhibition','Museum','Archive','PrivateCollection'] %}
{% set rangeRootParent = rootParent|getClassName ~'_'~ rootParent.id %}
{% endif %}
{# {% if filters is defined and filters.rangePath is defined and filters.rangePath %}
{% set rangePath = filters.rangePath %}
{% elseif (rootParent is defined and rootParent in ['Exhibition','Museum','Archive','PrivateCollection']) %}
{% if entity is defined and entity|getClassName not in ['Antique','Relict'] %}
{% set rangePath ='|'~ entity|getClassName ~ '_' ~ entity.id ~ '|' %}
{% endif %}
{% endif %}
{% if rangePath is defined %}
<input type="text" name="rangePath" value="{{ rangePath }}" />
{{ openform_front_util.getTitleByRangePath(rangePath, app.request.locale) }}
{% endif %}#}
<h2 class="search-form__wrapper__title">{{ 'T_SEARCH_ON_THE_SITE'|trans({}, 'openform_front', app.request.locale) }}</h2>
<input
class="search-form__wrapper__input js-search-input"
id="search-form-input"
placeholder="{{ 'T_ENTER_THE_SEARCH_PHRASE'|trans({}, 'openform_front', app.request.locale) }}"
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-form__wrapper">
<div class="search-form__wrapper__section">
<div class="checkbox">
<input type="checkbox" id="everywhere-check" name="rangeEverywhere" class="visuallyhidden js-search-item-all"
{{ filters.rangeEverywhere is defined ? 'checked' }} value="1" >
<label for="everywhere-check">
{{ 'T_EVERYWHERE'|trans({}, 'openform_front', app.request.locale) }}
</label>
</div>
</div>
<div class="search-form__wrapper__section">
<div class="search-form__wrapper__item js-search-item" data-placeholder="Wszystkie wystawy">
<div class="checkbox">
<input type="checkbox" id="virtual-exhibitions-check" name="rangeAllExhibition" value="1" class="visuallyhidden js-search-check"
{{ rangeAllExhibition is defined or filters.rangeAllExhibition is defined ? 'checked' }} />
<label for="virtual-exhibitions-check">
{{ 'T_VIRTUAL_EXHIBITIONS'|trans({}, 'openform_front', app.request.locale) }}
</label>
</div>
<div class="select select--top">
<select class="js-choice" name="exhibitions[]" multiple >
{% for item in openform_front_util.getItemsForSearch('Exhibition', app.request.locale) %}
<option value="{{ item.id }}" {{ (rangeRootParent is defined and rangeRootParent == 'Exhibition_'~item.id) or (filters.exhibitions is defined and item.id in filters.exhibitions) ? 'selected' }} >
{{ item.Translation[app.request.locale].title }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="search-form__wrapper__item js-search-item" data-placeholder="Wszystkie muzea">
<div class="checkbox">
<input type="checkbox" id="virtual-museums-check" name="rangeAllMuseum" value="1" class="visuallyhidden js-search-check"
{{ rangeAllMuseum is defined or filters.rangeAllMuseum is defined ? 'checked' }} />
<label for="virtual-museums-check">
{{ 'T_VIRTUAL_MUSEUMS'|trans({}, 'openform_front', app.request.locale) }}
</label>
</div>
<div class="select select--top">
<select class="js-choice" name="museums[]" multiple >
{% for item in openform_front_util.getItemsForSearch('Museum', app.request.locale) %}
<option value="{{ item.id }}" {{ (rangeRootParent is defined and rangeRootParent == 'Museum_'~item.id) or (filters.museums is defined and item.id in filters.museums) ? 'selected' }} >
{{ item.Translation[app.request.locale].title }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="search-form__wrapper__item js-search-item" data-placeholder="Wszystkie archiwa">
<div class="checkbox">
<input type="checkbox" id="virtual-archives-check" name="rangeAllArchive" value="1" class="visuallyhidden js-search-check"
{{ rangeAllArchive is defined or filters.rangeAllArchive is defined ? 'checked' }} />
<label for="virtual-archives-check">
{{ 'T_VIRTUAL_ARCHIVES'|trans({}, 'openform_front', app.request.locale) }}
</label>
</div>
<div class="select">
<select class="js-choice" name="archives[]" multiple >
{% for item in openform_front_util.getItemsForSearch('Archive', app.request.locale) %}
<option value="{{ item.id }}" {{ (rangeRootParent is defined and rangeRootParent == 'Exhibition_'~item.id) or (filters.exhibitions is defined and item.id in filters.exhibitions) ? 'selected' }} >
{{ item.Translation[app.request.locale].title }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="search-form__wrapper__item js-search-item" data-placeholder="Wszystkie kolekcje prywatne">
<div class="checkbox">
<input type="checkbox" id="virtual-private-collections-check" name="rangeAllPrivateCollection" value="1" class="visuallyhidden js-search-check"
{{ rangeAllPrivateCollection is defined or filters.rangeAllPrivateCollection is defined ? 'checked' }} />
<label for="virtual-private-collections-check">
{{ 'T_VIRTUAL_PRIVATE_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}
</label>
</div>
<div class="select">
<select class="js-choice" name="privateCollections[]" multiple >
{% for item in openform_front_util.getItemsForSearch('PrivateCollection', app.request.locale) %}
<option value="{{ item.id }}" {{ (rangeRootParent is defined and rangeRootParent == 'PrivateCollection_'~item.id) or (filters.privateCollections is defined and item.id in filters.privateCollections) ? 'selected' }} >
{{ item.Translation[app.request.locale].title }}
</option>
{% endfor %}
</select>
</div>
</div>
</div>
</div>
<div class="search-form__buttons">
<button
class="btn search-form__buttons__button"
type="submit"
>
<span>{{ 'T_SEARCH_ON_THE_SITE_BTN'|trans({}, 'openform_front', app.request.locale) }}</span>
</button>
</div>
</form>
</div>