templates/homepage/detailDealer.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ seoTitle }}{% endblock %}
  3. {% block desc %}{{ seoDescription }}{% endblock %}
  4.         {% block stylesheets %}
  5.             {{ encore_entry_link_tags('app') }}
  6.            {% endblock %}
  7.           {% block javascripts %}
  8.               {{ encore_entry_script_tags('app') }}
  9.               <script
  10.                       src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDMvCFLEp2JWA1HQ5riIBgtCn8Hy5bS9nw&callback=initMap&v=weekly"
  11.                       defer
  12.               ></script>
  13.               <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
  14.               <script src="https://unpkg.com/@googlemaps/markerclusterer/dist/index.min.js"></script>
  15.           {% endblock %}
  16. {% block body %}
  17.     <section class="contact">
  18.         <header class="contact__header">
  19.             <h1>{{ dealer.name }}</h1>
  20.             <figure class="contact__logo">
  21.                 {% if dealer.logo %}
  22.                 <img
  23.                         src="{{ asset('img-dealer/')~dealer.logo }}"
  24.                         {{ stimulus_controller('symfony/ux-lazy-image/lazy-image', {
  25.                             src: asset('img-dealer/')~dealer.logo
  26.                         }) }}
  27.                         width="200"
  28.                 >
  29.                 {% endif %}
  30.             </figure>
  31.         </header>
  32.         {% if dealer.description %}
  33.         <div class="contact__description">
  34.             <p>{{ dealer.description }}</p>
  35.         </div>
  36.         {% endif %}
  37.         <div class="contact__grid">
  38.             <div>
  39.                 <h2 class="contact__heading">Adresa</h2>
  40.                 <div class="contact__item">
  41.                     <i class="contact__icon icon icon-garage"></i>
  42.                     <div>
  43.                         {% if dealer.street %}{{ dealer.street }}<br>{% endif %}
  44.                         {% if dealer.city %}{{ dealer.city }}<br>{% endif %}
  45.                         {% if dealer.district %}{{ dealer.district.region.name }}{% endif %}
  46.                     </div>
  47.                 </div>
  48.             </div>
  49.             <div>
  50.                 <h2 class="contact__heading">Telefon</h2>
  51.                 <div class="contact__item">
  52.                     <i class="contact__icon icon icon-phone"></i>
  53.                     {% for p in dealer.dealerPhones %}
  54.                     <a href="">{{ p.name }}</a><br>
  55.                     {% endfor %}
  56.                 </div>
  57.             </div>
  58.             <div>
  59.                 <h2 class="contact__heading">E-mail</h2>
  60.                 {% if dealer.email %}
  61.                 <div class="contact__item contact__item--primary">
  62.                     <i class="contact__icon icon icon-email"></i>
  63.                     <a href="mailto:{{ dealer.email }}">{{ dealer.email }}</a>
  64.                 </div>
  65.                 {% endif %}
  66.             </div>
  67.         </div>
  68.         <footer id="mapa" class="contact__footer">
  69.             {% if hasVehicleImport %}
  70.             <a class="contact__button" href="{{ path('page_dealer_vehicle', { url:  dealer.url }) }}">
  71.                 <i class="icon icon-car"></i>
  72.                 Zobrazit nabídku vozidel
  73.             </a>
  74.             {% endif %}
  75.             {% if dealer.lat and dealer.lng %}
  76.             <a class="contact__button contact__button--secondary" href="https://www.google.com/maps/search/?api=1&query={{ dealer.lat }},{{ dealer.lng }}" target="_blank">
  77.                 Zobrazit trasu
  78.                 <i class="icon icon-map"></i>
  79.             </a>
  80.             {% endif %}
  81.             {% if dealer.www %}
  82.             <a class="contact__button contact__button--secondary" href="http://{{ dealer.www }}" target="_blank">
  83.                 Zobrazit web
  84.                 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 64 64" fill="currentColor">
  85.                     <path d="M 40 10 C 38.896 10 38 10.896 38 12 C 38 13.104 38.896 14 40 14 L 47.171875 14 L 30.585938 30.585938 C 29.804938 31.366938 29.804938 32.633063 30.585938 33.414062 C 30.976938 33.805063 31.488 34 32 34 C 32.512 34 33.023063 33.805062 33.414062 33.414062 L 50 16.828125 L 50 24 C 50 25.104 50.896 26 52 26 C 53.104 26 54 25.104 54 24 L 54 12 C 54 10.896 53.104 10 52 10 L 40 10 z M 18 12 C 14.691 12 12 14.691 12 18 L 12 46 C 12 49.309 14.691 52 18 52 L 46 52 C 49.309 52 52 49.309 52 46 L 52 34 C 52 32.896 51.104 32 50 32 C 48.896 32 48 32.896 48 34 L 48 46 C 48 47.103 47.103 48 46 48 L 18 48 C 16.897 48 16 47.103 16 46 L 16 18 C 16 16.897 16.897 16 18 16 L 30 16 C 31.104 16 32 15.104 32 14 C 32 12.896 31.104 12 30 12 L 18 12 z"></path>
  86.                 </svg>
  87.             </a>
  88.             {% endif %}
  89.         </footer>
  90.     </section>
  91.     <section    class="grid grid--gap40 grid--padding40">
  92.         <div>
  93.                 <div id="map" style="height: 400px" > </div>
  94.                 <script>
  95.                     function initMap() {
  96.                         const map = new google.maps.Map(document.getElementById("map"), {
  97.                             zoom: 7,
  98.                             center: {lat: 49.7887636, lng: 15.6634697},
  99.                         });
  100.                         setMarkers(map);
  101.                     }
  102.                     function setMarkers(map) {
  103.                         const image = {
  104.                             url: "{{ asset('img/icon-dealer.png') }}",
  105.                             // This marker is 20 pixels wide by 32 pixels high.
  106.                             size: new google.maps.Size(40, 40),
  107.                             // The origin for this image is (0, 0).
  108.                             origin: new google.maps.Point(0, 0),
  109.                             // The anchor for this image is the base of the flagpole at (0, 32).
  110.                             anchor: new google.maps.Point(0, 40),
  111.                         };
  112.                         const dealers = [
  113.                             {
  114.                                 id: {{ dealer.id }},
  115.                                 name: "{{ dealer.name }}",
  116.                                 city: "{{ dealer.city }}",
  117.                                 street: "{{ dealer.street }}",
  118.                                 lat: {{ dealer.lat }},
  119.                                 lng: {{ dealer.lng }}
  120.                             }
  121.                         ];
  122.                         const markers = [];
  123.                         for (let i = 0; i < dealers.length; i++) {
  124.                             const dealer = dealers[i];
  125.                             const marker = new google.maps.Marker({
  126.                                 position: {lat: dealer.lat, lng: dealer.lng},
  127.                                 map,
  128.                                 icon: image,
  129.                                 title: dealer.name + ' ' + dealer.city,
  130.                                 zIndex: dealer.id,
  131.                             });
  132.                             marker.addListener("click", () => {
  133.                                 const infowindow = new google.maps.InfoWindow({
  134.                                     content: '<div style="width: 350px; overflow: hidden">' +
  135.                                         '<b>'+dealer.name+'</b><br>'+dealer.city+', '+dealer.street+'</div>',
  136.                                 });
  137.                                 google.maps.event.addListener(map, 'click', function() {
  138.                                     infowindow.close();
  139.                                 });
  140.                                 infowindow.open({
  141.                                     anchor: marker,
  142.                                     map,
  143.                                 });
  144.                             });
  145.                             markers.push(marker);
  146.                         }
  147.                     }
  148.                     window.initMap = initMap;
  149.                 </script>
  150.         </div>
  151.         <div>
  152.             <article class="opening">
  153.                 <h2 class="opening__title">
  154.                     <i class="icon icon-hours"></i>
  155.                     Provozní doba
  156.                 </h2>
  157.                 <div class="opening__schedule">
  158.                     {% for t in  openTime %}
  159.                     <div>{{ t.day.value }}</div>
  160.                     <div>{{ t.description }}</div>
  161.                     {% endfor %}
  162.                 </div>
  163.                 {% if dealer.openingHoursNote %}
  164.                 <div class="opening__info">{{ dealer.openingHoursNote }}</div>
  165.                 {% endif %}
  166.             </article>
  167.         </div>
  168.     </section>
  169. <section class="grid grid--gap40 grid--padding40">
  170.     <div>
  171.         <div id="adform_squarem"></div>
  172.         {% if dealer.dealerImages|length > 1 %}
  173.         <section class="gallery gallery--columns3 js-gallery">
  174.             {% for g  in  dealer.dealerImages %}
  175.                 <a   {% if  loop.index > 3 %} style="display: none"   {% endif %}
  176.                         class="gallery__item" href="{{ asset('img-dealer/')~g.name }}" title="{{ dealer.name }}">
  177.                     <img
  178.                             src="{{ asset('img-dealer/')~g.name    }}"
  179.                             {{ stimulus_controller('symfony/ux-lazy-image/lazy-image', {
  180.                                 src: asset('img-dealer/')~g.name
  181.                             }) }}
  182.                             width="200"
  183.                     >
  184.                 </a>
  185.             {% endfor %}
  186.             {% if  dealer.dealerImages|length > 3 %}
  187.             <div class="gallery__show">
  188.                 <i class="icon icon-camera"></i>
  189.                 + {{ dealer.dealerImages|length - 3 }}
  190.             </div>
  191.             {% endif%}
  192.         </section>
  193.         {% endif %}
  194.         <!-- The Gallery as lightbox dialog, should be a document body child element -->
  195.         <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" aria-label="image gallery"
  196.              aria-modal="true" role="dialog">
  197.             <div class="slides" aria-live="polite"></div>
  198.             <h3 class="title"></h3>
  199.             <a class="prev" aria-controls="blueimp-gallery" aria-label="previous slide" aria-keyshortcuts="ArrowLeft"></a>
  200.             <a class="next" aria-controls="blueimp-gallery" aria-label="next slide" aria-keyshortcuts="ArrowRight"></a>
  201.             <a class="close" aria-controls="blueimp-gallery" aria-label="close" aria-keyshortcuts="Escape"></a>
  202.             <ol class="indicator"></ol>
  203.         </div>
  204.         {% if hasVehicleImport %}
  205.             <h2 class="grid__title">Novinky z nabídky</h2>
  206.             {% for v in vehicles %}
  207.                 {% include 'vehicle/_vehicle.html.twig' with { vehicle: v } %}
  208.                 {% if loop.index == 1 %}
  209.                     <div id="banner-mobile-container" class="banner-mobile"></div>
  210.                 {%  endif %}
  211.                 {% if loop.index == 4 %}
  212.                     <div id="adform_squarem2"></div>
  213.                 {%  endif %}
  214.             {% endfor %}
  215.             <footer class="contact__footer" style="float: right">
  216.                 <a class="contact__button" href="{{ path('page_dealer_vehicle', { url:  dealer.url }) }}">
  217.                     <i class="icon icon-car"></i>
  218.                     Zobrazit nabídku vozidel
  219.                 </a>
  220.             </footer>
  221.         {% else %}
  222.             <h2 class="grid__title">Tipy z autobazarů</h2>
  223.             {% for tip in vehicleTips %}
  224.                 {% include 'vehicle/_vehicle.html.twig' with { vehicle: tip.vehicle } %}
  225.                 {% if loop.index == 1 %}
  226.                     <div id="banner-mobile-container" class="banner-mobile"></div>
  227.                 {% endif %}
  228.             {% endfor %}
  229.             {% if dealer.district %}
  230.             <footer class="contact__footer" style="float: right">
  231.                 <a class="contact__button" href="{{ path('page_vehicle_search', {urlKind: 'osobni-vozidla'}) }}?place={{ dealer.district.region.url }}">
  232.                     <i class="icon icon-car"></i>
  233.                     Nabídka vozidel {{ dealer.district.region.name }}
  234.                 </a>
  235.             </footer>
  236.             {% endif %}
  237.         {% endif %}
  238.     </div>
  239.     <div>
  240.         <div id="adform_halfpage"></div>
  241.         <div id="banner-container" class="banner"></div>
  242.     </div>
  243. </section>
  244. {% endblock %}