{# @var \Pimcore\Templating\GlobalVariables app #}
{# @var \Elements\Bundle\DemiFrontendBundle\Templating\Helper\Filter demiFilterHelper #}
{# @var \Elements\Demi\Accommodation\Search\Parameter searchParam #}
{# @var \Zend\Paginator\Paginator paginator #}
{# @var int totalPages #}
{# @var bool noDate #}
{# @var boolean editmode #}
{# @var int minResult
{# @var bool isPackageSearch #}
{# @var bool showAlternativeResults #}
{# @var bool makeAlternativeSearchRequest #}
{# @var bool availabilityIsChecked #}
{% extends('@ElementsDemiFrontend/Layout/layout.html.twig') %}
{% set params = params is defined ? params : [] %}
{% block content %}
<script type="text/javascript" data-cookieconsent="ignore">
{% if not searchParam.getIsAlternative() %}
_config.makeAlternativeSearchRequest = {{ makeAlternativeSearchRequest == true ? "true" : "false" }};
_config.showAlternativeResults = false;
{% endif %}
{% set nearbySearchJson = '/var/tmp/typeahead/' ~ app.request.getLocale() ~ '/nearbySearch.json' %}
{% set searchJson = '/var/tmp/typeahead/hotellists' ~ document.getId() ~ '.json' %}
{% if not demi_improvedFileExists(searchJson, "PIMCORE_WEB_ROOT", '/var') %}
{% set searchJson = '/var/tmp/typeahead/' ~ app.request.getLocale() ~ '/hotels.json' %}
{% endif %}
{% if demi_improvedFileExists(searchJson, "PIMCORE_WEB_ROOT", '/var') %}
_config.searchAutocompleteUrl = '/cache-buster-{{ demi_getExistingCacheFile(searchJson) }}';
{% endif %}
_config.acommodationMapHideBusinesses = {{ demi_core_configuration('getMapHideBusinesses', {}) ? 'true' : 'false' }}
</script>
{% do jsConfig("_config").add('noDate', noDate) %}
<script type="text/javascript" data-cookieconsent="ignore">
{% if searchParam is not null and searchParam.getOrderRandSeed() is not empty %}
_config.urlParams = _config.urlParams || [];
_config.urlParams.push({name: "randSeed", value: "{{ searchParam.getOrderRandSeed() }}"});
{% endif %}
_config.historyController = true;
_config.searchData = true;
_config.quickfilter = true;
_config.priceInfo = true;
{#} JS Object für die Liste Suche #}
_config.accoList = true;
_config.accoListUrl = '';
_config.accoListIsPackageList = {{ isPackageSearch ? 'true': 'false' }};
</script>
<main id="main" role="main">
{% if document.getProperty("demi_housePackageContainer") is not empty or document.getProperty("demi_housePackageMasterSelfAssign") is not empty %}
{% set listType = document.getProperty("demi_housePackageContainer")?: document.getProperty("demi_housePackageMasterSelfAssign") %}
{% set hasPackageContainer = true %}
{{ include('@ElementsDemiFrontend/Includes/elements/package-list-info.mobile.html.twig', { "searchParam": searchParam, "listType": listType}) }}
{% endif %}
<div>
<div class="js-search-data__show-if-submitted" {{ availabilityIsChecked ? '' : 'hidden' }}>
{{ include('@ElementsDemiFrontend/Includes/ribbon.html.twig', {'searchParam': searchParam,'showBackButton': false, 'withFlag': true}) }}
</div>
<div class="js-search-data__hide-if-submitted" {{ availabilityIsChecked ? 'hidden' : '' }}>
<div class="container my-3">
{% if hasPackageContainer is not defined or not hasPackageContainer %}
<h1>{{ pimcore_input('headline') }}</h1>
{% endif %}
{% if not document.property("demi_hideVacancySearch") %}
<button type="button" class="btn btn-success btn-lg btn-block js-overlay__toggle"
data-target="#search-overlay">
{{ 'demi.list.search-vacancies-button'|trans }}
</button>
{% endif %}
</div>
<hr class="hr--bold hr--light mb-2">
</div>
</div>
{{ include('@ElementsDemiFrontend/List/includes/navigation.html.twig') }}
<hr class="hr--bold hr--light mb-2 mt-2">
{% if error is not empty%}
{{ include('@ElementsDemiFrontend/Checkout/includes/error-container.html.twig', {'error': error, 'styleModifier': 'mb-0', 'isList': true}) }}
<hr class="hr--bold hr--light mb-2 mt-2">
{% endif %}
<div class="js-acco-list__hide-if-no-results">
<div class="js-quick-filter" hidden>
<section class="container text-center">
<div class="js-quick-filter__list"></div>
</section>
<hr class="hr--bold hr--light mb-3 mt-2">
</div>
</div>
<div class="acco-list js-acco-list" role="alert" aria-live="assertive">
<div class="text-center my-5 js-acco-list__loading" hidden>
{{ include('@ElementsDemiFrontend/Includes/elements/spinner/loading-spinner.html.twig') }}
</div>
<div class="js-acco-list__content">
{# Wenn kein Ajax loading #}
{{ include('@ElementsDemiFrontend/List/list-content.html.twig', { 'accommodationPaginator': paginator, 'isPackageSearch': isPackageSearch }) }}
</div>
</div>
<div class="js-acco-list__hide-if-few-results">
<hr class="hr--bold hr--light my-3">
{{ include('@ElementsDemiFrontend/List/includes/navigation.html.twig') }}
</div>
{# Preis info #}
{{ include('@ElementsDemiFrontend/Includes/elements/price-info.html.twig',{"searchParameter": searchParam }) }}
{# Alternative Suchergebnisse wenn in der oberen Liste zu wenig gefunden wurde. #}
{{ include('@ElementsDemiFrontend/List/includes/acco-list-alternative-search.html.twig') }}
{% do elements_head_meta().setDescription( pimcore_wysiwyg('description'), false ) %}
<section
class="text-muted text-center js-search-data__hide-if-submitted" {{ availabilityIsChecked ? 'hidden' : '' }}>
<hr class="hr--bold hr--light my-3">
{{ pimcore_wysiwyg('description') }}
</section>
</main>
<aside>
{% set contactSnippet = demi_core_configuration("getContactSnippet",[]) %}
{% if contactSnippet is not empty %}
<hr class="hr--bold hr--light my-3">
{{ pimcore_inc(contactSnippet) }}
{% endif %}
</aside>
{{ include('@ElementsDemiFrontend/Includes/overlays/search.html.twig', {
'filterSnippet': pimcore_relation('filterSnippet').getData(),
'searchParam': searchParam,
'noDate': noDate,
'isSearch': true,
'isPackageSearch': isPackageSearch,
'showMoreOptions': not pimcore_relation('filterSnippet').empty ? demi_showMoreFilterOptions(pimcore_relation('filterSnippet').getElement())
}) }}
{{ include('@ElementsDemiFrontend/Includes/overlays/filter.html.twig', {
'filterSnippet': pimcore_relation('filterSnippet').getData(),
'searchParam': searchParam,
'noDate': noDate,
'isPackageSearch': isPackageSearch
}) }}
{% endblock %}