templates/homesearch.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}- Recherche{% endblock %}
  3. {% block headersection %}
  4. <div class="fixed-top">
  5.     {{ include('flashmessages/flashmessages.html.twig') }}
  6. </div>
  7. <section class="section section-xl bg-primary overlay-dark text-white rounded covernorepeat" data-background="{{ asset('assets/img/cards-3662554_1920.jpg') }}">
  8.     <div class="container">
  9.         <div class="row justify-content-center">
  10.             <div class="col-12">
  11.                 <nav aria-label="breadcrumb">
  12.                     <ol class="breadcrumb breadcrumb-transparent">
  13.                         <li class="breadcrumb-item"><a href="{{ path('home', {}, relative = false) }}">Accueil</a></li>
  14.                         <li class="breadcrumb-item active">Recherche</li>
  15.                     </ol>
  16.                 </nav>
  17.                 <!-- Heading -->
  18.                 <h1 class="display-2">
  19.                     <i class="fab fa-searchengin mr-2"></i><span class="font-weight-light">Trouvez votre</span> tournoi ou festival
  20.                 </h1>
  21.                 <!-- Text -->
  22.                 <p class="lead text-muted mt-4">
  23.                     Recherchez parmi tous les tournois et festivals de notre site.
  24.                 </p>
  25.             </div>
  26.         </div>
  27.     </div>
  28. </section>
  29. {%endblock%}
  30. {%block body%}
  31. <main>
  32.     <div class="section pt-5 pt-lg-6" style="min-height: 50vh;">
  33.         <div id="spaces-container" class="container">
  34.             <div class="row justify-content-center mb-3">
  35.                 <div class="col-12">
  36.                     {{ form_start(formsearch, { 'attr': {'class': 'row justify-content-center'} }) }}
  37.                     <div class="col-12 col-lg-4">
  38.                         <div class="form-group mb-lg-0">
  39.                             <div class="input-group input-group-lg mb-lg-0">
  40.                                 <div class="input-group-prepend">
  41.                                     <span class="input-group-text"><i class="fas fa-search-location"></i></span>
  42.                                 </div>
  43.                                 {{ form_widget(formsearch.location, {'attr': {'class': 'form-control autocomplete', 'placeholder': 'Ville', 'onFocus' : 'geolocate()' }}) }}
  44.                             </div>
  45.                             {{ form_widget(formsearch.locationhidden)}}
  46.                             {{ form_widget(formsearch.placeid)}}
  47.                         </div>
  48.                     </div>
  49.                     <div class="col-12 col-lg-3">
  50.                         <div class="input-group input-group-lg mb-3 mb-lg-0">
  51.                             <div class="input-group-prepend">
  52.                                 <span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
  53.                             </div>
  54.                             {{ form_widget(formsearch.date, {'attr': {'class': 'form-control datepicker', 'placeholder': 'Date', 'data-date-format':'dd/mm/yyyy'}}) }}
  55.                             <!--<input class="form-control datepicker" placeholder="Select date" type="text" required>-->
  56.                         </div>
  57.                     </div>
  58.                     <div class="col-12 col-lg-2">
  59.                         {{ form_widget(formsearch.search, {'attr': {'class': 'btn btn-lg btn-primary btn-block mt-3 mt-md-0 animate-up-2' }} ) }}
  60.                         <!--<button class="btn btn-lg btn-primary btn-block mt-3 mt-md-0 animate-up-2" type="submit">Find a desk</button>-->
  61.                     </div>
  62.                 </div>
  63.             </div>
  64.             <div class="row justify-content-center">
  65.                 <div class="col-12 col-lg-9 order-lg-1">
  66.                     <div class="justify-content-between align-items-center d-flex">
  67.                         <div class="mr-3">
  68.                             <p class="mb-0 font-small">
  69.                                 Nombre de résultats : {{ pagination.getTotalItemCount }}
  70.                             </p>
  71.                         </div>
  72.                         <div class="">
  73.                             <div class="input-group input-group-sm">
  74.                                 <div class="input-group-prepend form-control-sm">
  75.                                     <span class="input-group-text form-control-sm"><i class="fas fa-route"></i></span>
  76.                                     {{ form_widget(formsearch.distance, {'attr': {'class': 'form-control-sm font-small', 'onchange':'this.form.submit()'}}) }}
  77.                                 </div>
  78.                             </div>
  79.                         </div>    
  80.                     </div>
  81.                     {{form_end(formsearch)}}
  82.                     <div class="tab-content mt-4 mt-lg-4 " id="tabcontentexample-5">
  83.                         <div class="tab-pane fade show active" id="link-example-13" role="tabpanel" aria-labelledby="tab-link-example-13">
  84.                             {% for bfedition in pagination %}
  85.                             {{ render(controller('App\\Controller\\BFEditionController::ShowListView', {id:bfedition.id})) }}
  86.                             {%endfor%}
  87.                         </div>
  88.                     </div>
  89.                     {{ knp_pagination_render(pagination) }}
  90.                 </div>
  91.             </div>
  92.         </div>
  93.     </div>
  94. </main>
  95. <script>
  96.     var placeSearch, autocompleteinput;
  97.     var input = document.getElementById('festival_search_with_distance_location');
  98.     var componentForm = {
  99.         street_number: 'short_name',
  100.         route: 'long_name',
  101.         locality: 'long_name',
  102.         administrative_area_level_1: 'short_name',
  103.         country: 'long_name',
  104.         postal_code: 'short_name'
  105.     };
  106.     function initAutocomplete() {
  107.         google.maps.event.addDomListener(input, 'blur', function() {
  108.             if (jQuery('.pac-item:hover').length === 0) {
  109.                 google.maps.event.trigger(this, 'focus', {});
  110.                 google.maps.event.trigger(this, 'keydown', {
  111.                     keyCode: 13
  112.                 });
  113.             }
  114.         })
  115.         // Create the autocomplete object, restricting the search to geographical
  116.         // location types.
  117.         autocompleteinput = new google.maps.places.Autocomplete(
  118.             /** @type {!HTMLInputElement} */
  119.             (input), {
  120.                 types: ['geocode']
  121.             });
  122.         // When the user selects an address from the dropdown, populate the address
  123.         // fields in the form.
  124.         autocompleteinput.addListener('place_changed', fillInAddress);
  125.     }
  126.     function fillInAddress() {
  127.         // Get the place details from the autocomplete object.
  128.         var place = autocompleteinput.getPlace();
  129.         if (place != null && place.place_id) {
  130.             //fill the hidden data
  131.             document.getElementById('festival_search_with_distance_locationhidden').setAttribute('value', document.getElementById('festival_search_with_distance_location').value)
  132.             document.getElementById('festival_search_with_distance_placeid').setAttribute('value', place.place_id)
  133.         }
  134.     }
  135. </script>
  136. <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyArRqV6iNkruffZtVT2G0iX4kfemd1SQD4&libraries=places&callback=initAutocomplete&sessiontoken={{uuid}}" async defer></script>
  137. {%endblock%}