templates/location/locationfinder.html.twig line 1

Open in your IDE?
  1. {% do jsConfig().add('googleMapAPIKey', googleApiKey()) %}
  2. {% extends "layout/default.html.twig" %}
  3. {% block content %}
  4.     <main id="main-content" role="main" class="{{ not editmode ? 'main-content' }} content-block js-content-visibility content-visibility--auto">
  5.         <script data-cookieconsent="ignore">
  6.             window.addEventListener('CookiebotOnDialogDisplay', function () {
  7.                 window.addEventListener('CookiebotOnAccept', function () {
  8.                     location.reload();
  9.                 }, false);
  10.             }, false);
  11.         </script>
  12.         {{ include('navigation/breadcrumb.html.twig') }}
  13.         <section class="locationfinder__container container">
  14.             {{ include('includes/title-blocks/title-block.html.twig', {
  15.                 titleTag: 'h1'
  16.             }) }}
  17.             <div class="js-locationfinder">
  18.                 <div class="consent locationfinder__consent js-consent" data-consent-service="marketing">
  19.                     <div class="consent__overlay js-consent__overlay">
  20.                         {{ 'cookies.Um die Map anzusehen, müssen Sie die Cookies akzeptieren'|trans }}
  21.                         <a href="javascript: Cookiebot.show()" class="btn btn-primary">
  22.                             {{ 'cookies.Marketingcookies akzeptieren'|trans }}
  23.                         </a>
  24.                     </div>
  25.                     <template class="js-consent__template">
  26.                         <div class="js-ajax-form-map-google js-ajax-form locationfinder position-relative"
  27.                              data-google-map-initial-lng="14.306777"
  28.                              data-google-map-initial-lat="47.2183939"
  29.                              data-ajax-form-submit-on-change="true"
  30.                              data-ajax-form-add-url-params="true"
  31.                              data-form-map-url="{{ document.fullpath }}?pois=1">
  32.                             <div aria-live="polite">
  33.                                 <div class="locationfinder__form-container mb-3">
  34.                                     <form action="" data-action="{{ document.fullpath }}?ajax=1" class="js-ajax-form-map-google__form js-ajax-form__form">
  35.                                         <ul class="list-inline d-flex mb-md-5 mb-3 form-tab-radio-list">
  36.                                             <li class="list-inline-item">
  37.                                                 {{ include('includes/form_elements/radio.html.twig', {
  38.                                                     label: "global.resorts.Alle"|trans,
  39.                                                     id: "all",
  40.                                                     name: "resort",
  41.                                                     value: "all",
  42.                                                     isTabRadio: true,
  43.                                                     inputAttributes: {
  44.                                                         checked: true
  45.                                                     },
  46.                                                 }, with_context = false) }}
  47.                                             </li>
  48.                                             {% for resortKey in usedResorts %}
  49.                                                 {% set inputAttributes = [] %}
  50.                                                 {% if (document.property('resort') == resortKey and not app.request.get('resort')) or (app.request.get('resort') == resortKey) %}
  51.                                                     {% set inputAttributes = {
  52.                                                         checked: true
  53.                                                     } %}
  54.                                                 {% endif %}
  55.                                                 <li class="list-inline-item">
  56.                                                     {{ include('includes/form_elements/radio.html.twig', {
  57.                                                         label: ('global.resort.' ~ resortKey)|trans,
  58.                                                         id: resortKey,
  59.                                                         name: "resort",
  60.                                                         value: resortKey,
  61.                                                         isTabRadio: true,
  62.                                                         inputAttributes: inputAttributes
  63.                                                     }, with_context = false) }}
  64.                                                 </li>
  65.                                             {% endfor %}
  66.                                         </ul>
  67.                                         <div class="row">
  68.                                             <div class="col-md-5">
  69.                                                 <div class="position-relative">
  70.                                                     <input type="text" class="form-control" name="searchLocationLat" id="searchLocationLat"
  71.                                                            value="{{ app.request.get('searchLocationLat') ?: '' }}" hidden>
  72.                                                     <input type="text" class="form-control" name="searchLocationLng" id="searchLocationLng"
  73.                                                            value="{{ app.request.get('searchLocationLng') ?: '' }}" hidden>
  74.                                                     {{ include('/includes/form_elements/input.html.twig', {
  75.                                                         "styleModifier": 'mb-0 w-xs-100',
  76.                                                         "placeholder": 'locationfinder.location-name:' | trans,
  77.                                                         "id": 'location',
  78.                                                         "name": 'location',
  79.                                                         "inputModifier": 'js-geolocator-search__location-input geolocator-search__location-input',
  80.                                                         "type" : 'text',
  81.                                                         "value" :  app.request.get('location') ?: '',
  82.                                                         "inputAttributes": {
  83.                                                             "data-target-lat": "#searchLocationLat",
  84.                                                             "data-target-lng": "#searchLocationLng"
  85.                                                         }
  86.                                                     }
  87.                                                     ) }}
  88.                                                     <span class="geolocator-search__icon icon icon-search" aria-hidden="true"></span>
  89.                                                     <button type="submit" class="btn js-geolocator-search__submit-btn geolocator-search__submit-btn btn-no-styling">{{ 'global.Suchen'|trans }}</button>
  90.                                                 </div>
  91.                                             </div>
  92.                                             <div class="col-md-7">
  93.                                                 <div class="d-flex align-items-center h-100 locationfinder-location mt-2 mt-md-3">
  94.                                                     <span class="locationfinder-location__text">{{ 'locationfinder.oder'|trans }}</span>
  95.                                                     <input type="text" class="form-control" name="currentLocationLat" id="currentLocationLat"
  96.                                                            value="{{ app.request.get('currentLocationLat') ?: '' }}" hidden>
  97.                                                     <input type="text" class="form-control" name="currentLocationLng" id="currentLocationLng"
  98.                                                            value="{{ app.request.get('currentLocationLng') ?: '' }}" hidden>
  99.                                                     <button id="js-geolocator-current" type="submit" class="btn-no-styling js-geolocator-current__btn locationfinder-location__geo-btn text-secondary"
  100.                                                             data-target-lat="#currentLocationLat" data-target-lng="#currentLocationLng">
  101.                                                         <span class="icon icon-target" aria-label="{{ 'locationfinder.Standort automatisch ermitteln'|trans }}" aria-hidden="true"></span>
  102.                                                         {{ 'locationfinder.Standort automatisch ermitteln'|trans }}
  103.                                                     </button>
  104.                                                 </div>
  105.                                             </div>
  106.                                         </div>
  107.                                     </form>
  108.                                     <div class="js-ajax-form-map-google__notifications mb-3 js-ajax-form__notifications" hidden></div>
  109.                                     <div class="js-ajax-form-map-google__error-area mb-3" hidden>
  110.                                         <button class="js-ajax-form-map-google__retry btn btn-info ml-2">{{ 'global.Retry'|trans }}</button>
  111.                                     </div>
  112.                                     {{ include('includes/overlays/loading-overlay.html.twig', {
  113.                                         className: 'js-ajax-form__loading',
  114.                                         hidden: true
  115.                                     }) }}
  116.                                 </div>
  117.                                 <div class="row">
  118.                                     <div class="col-md-7">
  119.                                         <div class="js-ajax-form-map__map js-ajax-form-map-google__map locationfinder__map position-relative">
  120.                                             <div class="js-ajax-form-map-google__map__canvas locationfinder__map-canvas border-radius-4 shadow"></div>
  121.                                         </div>
  122.                                     </div>
  123.                                     <div class="col-md-5 gy-1 position-relative">
  124.                                         <div class="locationfinder__list-container scrolling-content">
  125.                                             <div class="locationfinder__list-container-position shadow">
  126.                                                 <div class="js-locationfinder-gradient locationfinder__gradient"></div>
  127.                                                 <div class="js-ajax-form-map-google__result js-ajax-form__result">
  128.                                                     {{ include('location/includes/location-list.html.twig') }}
  129.                                                 </div>
  130.                                             </div>
  131.                                         </div>
  132.                                     </div>
  133.                                 </div>
  134.                             </div>
  135.                         </div>
  136.                     </template>
  137.                 </div>
  138.                 {% set legendList = legendList | default([
  139.                     {
  140.                         "poi":"poi-baumaschinen",
  141.                         "title":"locationfinder.legend.Kuhn Baumaschinen"|trans
  142.                     },
  143.                     {
  144.                         "poi":"poi-ladetechnik",
  145.                         "title":"locationfinder.legend.Kuhn Ladetechnik"|trans
  146.                     },
  147.                     {
  148.                         "poi":"poi-group",
  149.                         "title":"locationfinder.legend.Kuhn Baumaschinen & Ladetechnik"|trans
  150.                     },
  151.                 ]) %}
  152.                 <div class="locationfinder__map-legend-container">
  153.                     <ul class="locationfinder__map-legend list-inline">
  154.                         {% for legendItem in legendList %}
  155.                             <li class="list-inline-item locationfinder__map-legend-item mb-1">
  156.                                 <img src="/static/img/map/pois/{{ legendItem.poi }}.svg" class="locationfinder__map-legend-poi me-md-3">
  157.                                 {{ legendItem.title }}
  158.                             </li>
  159.                         {% endfor %}
  160.                     </ul>
  161.                 </div>
  162.             </div>
  163.         </section>
  164.     </main>
  165.     {{ pimcore_placeholder('jsFile').set("js/locationfinder") }}
  166. {% endblock %}