custom/plugins/NetiNextStoreLocator/src/Resources/views/storefront/store_locator/search.twig line 1

Open in your IDE?
  1. {% block neti_store_locator_search %}
  2.     <form class="neti-next-store-locator-filter search-container container border-bottom mb-2">
  3.         <div class="row mx-3 d-flex">
  4.             {% block neti_store_locator_search_locate_button %}
  5.                 <template v-if="geoLocationEnabled">
  6.                     <button
  7.                         v-if="isLocating"
  8.                         class="locate btn btn-light mr-2"
  9.                     >
  10.                         <div class="spinner-border spinner"></div>
  11.                     </button>
  12.                     <button
  13.                             v-else
  14.                             class="locate btn btn-light mr-2"
  15.                             @click.prevent="onLocate"
  16.                             aria-label="locate"
  17.                     >
  18.                         {% sw_icon 'gps' %}
  19.                     </button>
  20.                 </template>
  21.             {% endblock %}
  22.             {% block neti_store_locator_search_input %}
  23.                 {#
  24.                 For some reason the icons are not shown in a special case. Unfortunately yet not reproducable for us.
  25.                 https://redmine.netinventors.de/issues/42545
  26.                 #}
  27.                 <span style="display: none">{% sw_icon 'marker' %}</span>
  28.                 <div
  29.                         class="search-input"
  30.                         :class="{ 'has-countries': countries.length > 2, 'has-country-filter': config.showCountryFilter }"
  31.                 >
  32.                     {% block neti_store_locator_search_input_country_select %}
  33.                         <div class="dropdown country-select" v-if="countries.length > 2">
  34.                             <button
  35.                                     class="btn dropdown-toggle" type="button" id="dropdownCountries"
  36.                                     data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
  37.                             >
  38.                                 <span class="badge badge-primary selected-country" v-if="selectedCountry">
  39.                                     {{ '{{ selectedCountry.isoCode }}' }}
  40.                                 </span>
  41.                             </button>
  42.                             <div class="dropdown-menu" aria-labelledby="dropdownCountries">
  43.                                 <input
  44.                                         v-if="config.showCountryFilter"
  45.                                         class="country-filter"
  46.                                         type="text"
  47.                                         placeholder="{{ "neti-next-store-locator.index.search.placeholderCountryFilter"|trans }}"
  48.                                         v-model="countryFilterInput"
  49.                                 />
  50.                                 <div class="dropdown-item-container">
  51.                                     <a
  52.                                             href="#" class="dropdown-item"
  53.                                             v-for="(country, key) in filteredCountries" :key="key"
  54.                                             @click.prevent="onSelectCountry(country)"
  55.                                     >
  56.                                         <div class="country-iso-code">
  57.                                         <span class="badge badge-light ">
  58.                                             {{ '{{ country.isoCode }}' }}
  59.                                         </span>
  60.                                         </div>
  61.                                         <div class="country-label">
  62.                                             {{ '{{ country.label }}' }}
  63.                                         </div>
  64.                                     </a>
  65.                                 </div>
  66.                                 <div class="no-results" v-if="filteredCountries.length === 0">
  67.                                     {{ "neti-next-store-locator.index.search.noCountriesText"|trans }}
  68.                                 </div>
  69.                             </div>
  70.                         </div>
  71.                     {% endblock %}
  72.                     {% block neti_store_locator_search_input_field %}
  73.                         <input
  74.                                 type="text" name="address"
  75.                                 placeholder="{{ "neti-next-store-locator.index.search.placeholder"|trans }}"
  76.                                 class="form-control flex-fill"
  77.                                 v-model="searchInput"
  78.                                 ref="searchInput"
  79.                                 @focus="searchInputFocused = true"
  80.                                 @blur="onBlur"
  81.                                 @keydown.enter.prevent="onAutocompletedSearch"
  82.                                 autocomplete="off"
  83.                                 aria-label="Search stores"
  84.                         />
  85.                     {% endblock %}
  86.                 </div>
  87.             {% endblock %}
  88.             {% block neti_store_locator_search_toggle_filter_button %}
  89.                 <button
  90.                         class="toggle-filter btn btn-light ml-2"
  91.                         @click.prevent="onToggleFilter"
  92.                         aria-label="Toggle filter"
  93.                         v-if="isToggleFilterButtonVisible"
  94.                 >
  95.                     {% sw_icon 'filter' %}
  96.                     <span class="filter-badge" v-if="searchFilter.customFilterCount > 0"></span>
  97.                 </button>
  98.             {% endblock %}
  99.             {% block neti_store_locator_search_toggle_stores_button %}
  100.                 <button class="toggle-stores btn btn-light ml-2" v-if="isMobile" @click.prevent="onToggleStores">
  101.                     {% sw_icon 'editor-list' %}
  102.                 </button>
  103.             {% endblock %}
  104.             {% block neti_store_locator_search_autocomplete_search_result %}
  105.                 <div
  106.                         class="autocomplete-search-result"
  107.                         v-if="searchInputFocused && searchInput.length"
  108.                 >
  109.                     {% if config('NetiNextStoreLocator.config.autocompleteResultPriority') == 'stores_before_places' %}
  110.                         {% sw_include '@Storefront/storefront/store_locator/search/autocomplete-stores.html.twig' %}
  111.                         {% sw_include '@Storefront/storefront/store_locator/search/autocomplete-places.html.twig' %}
  112.                     {% else %}
  113.                         {% sw_include '@Storefront/storefront/store_locator/search/autocomplete-places.html.twig' %}
  114.                         {% sw_include '@Storefront/storefront/store_locator/search/autocomplete-stores.html.twig' %}
  115.                     {% endif %}
  116.                     <div class="search-result" v-if="!autocompleteResults.length && !autocompletedStores.length">
  117.                         {{ "neti-next-store-locator.index.search.autocompleteNoResults"|trans }}
  118.                     </div>
  119.                 </div>
  120.             {% endblock %}
  121.         </div>
  122.         {% block neti_store_locator_search_filter %}
  123.             <div
  124.                     :class="filterClass"
  125.                     v-offcanvas="filter.offCanvas ? { open: filter.opened } : null"
  126.                     @close="filter.opened = false"
  127.                     @opened="onOffcanvasOpened"
  128.                     @closed="onOffcanvasClosed"
  129.             >
  130.                 <div class="col">
  131.                     {% block neti_store_locator_search_filter_header %}
  132.                         <div class="header">
  133.                             {{ "neti-next-store-locator.index.search.filterHeader"|trans }}
  134.                             <div class="close-button" @click="filter.opened = false">
  135.                                 {% sw_icon 'x' %}
  136.                             </div>
  137.                         </div>
  138.                     {% endblock %}
  139.                     {% block neti_store_locator_search_filter_radius %}
  140.                         <div class="form-group">
  141.                             <label for="radius">
  142.                                 {{ "neti-next-store-locator.index.search.fieldRadius"|trans }}
  143.                             </label>
  144.                             <select id="radius" name="radius" class="custom-select" v-model="searchFilter.radius">
  145.                                 <option>
  146.                                     {{ "neti-next-store-locator.index.search.fieldRadiusPlaceholder"|trans }}
  147.                                 </option>
  148.                                 {% for item in page.radiusList %}
  149.                                     <option value="{{ item.value }}">
  150.                                         {{ item.value }}
  151.                                         {{ page.config.distanceUnit }}
  152.                                     </option>
  153.                                 {% endfor %}
  154.                             </select>
  155.                         </div>
  156.                     {% endblock %}
  157.                     {% block neti_store_locator_search_filter_order %}
  158.                         <div class="form-group">
  159.                             <label for="order">
  160.                                 {{ "neti-next-store-locator.index.search.fieldOrder"|trans }}
  161.                             </label>
  162.                             <div class="d-flex flex-row space">
  163.                                 <select id="order" name="order" class="custom-select" v-model="searchFilter.orderBy.id">
  164.                                     {% for key, orderType in page.orderTypes %}
  165.                                         <option value="{{ orderType }}"{% if key == 0 %} selected{% endif %}>
  166.                                             {{ ("neti-next-store-locator.index.search.order." ~ orderType)|trans }}
  167.                                         </option>
  168.                                     {% endfor %}
  169.                                 </select>
  170.                                 &nbsp;
  171.                                 <div class="btn-group" role="group">
  172.                                     <button
  173.                                             type="button" class="btn"
  174.                                             :class="searchFilter.orderBy.direction === 'asc' ? 'btn-secondary' : 'btn-outline-secondary'"
  175.                                             @click="searchFilter.orderBy.direction = 'asc'"
  176.                                     >
  177.                                         &uarr;
  178.                                     </button>
  179.                                     <button
  180.                                             type="button" class="btn"
  181.                                             :class="searchFilter.orderBy.direction === 'desc' ? 'btn-secondary' : 'btn-outline-secondary'"
  182.                                             @click="searchFilter.orderBy.direction = 'desc'"
  183.                                     >
  184.                                         &darr;
  185.                                     </button>
  186.                                 </div>
  187.                             </div>
  188.                         </div>
  189.                     {% endblock %}
  190.                     {% block neti_store_locator_search_filter_featured %}
  191.                         {% if config('NetiNextStoreLocator.config.enableFilterOnlyFeatured') == true %}
  192.                             <div class="form-check form-group">
  193.                                 <input
  194.                                         class="form-check-input"
  195.                                         type="checkbox"
  196.                                         id="onlyFeatured"
  197.                                         v-model="searchFilter.onlyFeatured"
  198.                                 >
  199.                                 <label class="form-check-label" for="onlyFeatured">
  200.                                     {{ "neti-next-store-locator.index.search.onlyFeatured"|trans }}
  201.                                 </label>
  202.                             </div>
  203.                         {% endif %}
  204.                     {% endblock %}
  205.                     <div class="custom-filter-container" v-if="searchFilter.customFilterVisible">
  206.                         {% block neti_store_locator_search_filter_custom %}
  207.                             {% sw_include '@Storefront/storefront/store_locator/filter/index.html.twig' %}
  208.                         {% endblock %}
  209.                     </div>
  210.                     {% block neti_store_locator_search_filter_buttons %}
  211.                         <div class="buttons d-flex flex-row justify-content-between">
  212.                             <button type="reset" class="btn btn-secondary btn-sm" @click.prevent="onReset">
  213.                                 {{ "neti-next-store-locator.index.search.buttonReset"|trans }}
  214.                             </button>
  215.                             <button type="submit" class="btn btn-primary btn-sm" @click.prevent="onSearch">
  216.                                 {{ "neti-next-store-locator.index.search.buttonSearch"|trans }}
  217.                             </button>
  218.                         </div>
  219.                     {% endblock %}
  220.                 </div>
  221.             </div>
  222.         {% endblock %}
  223.     </form>
  224. {% endblock %}