templates/circuit/detailcircuit.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block stylesheets %}
  3.     <link href="{{ asset('front/plugins/colorbox/colorbox.css') }}" rel="stylesheet" type="text/css">
  4.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/blog_style.css') }}">
  5.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/blog_responsive.css') }}">
  6.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/single_listing_style.css') }}">
  7.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/single_listing_responsive.css') }}">
  8.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/about_style.css') }}">
  9.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/about_responsive.css') }}">
  10.     <style>
  11.         .carousel {
  12.             position: relative;
  13.         }
  14.         .carousel-item img {
  15.             object-fit: cover;
  16.         }
  17.         #carousel-thumbs {
  18.             background: rgba(255,255,255,.3);
  19.             bottom: 0;
  20.             left: 0;
  21.             padding: 0 50px;
  22.             right: 0;
  23.         }
  24.         #carousel-thumbs img {
  25.             border: 5px solid transparent;
  26.             cursor: pointer;
  27.         }
  28.         #carousel-thumbs img:hover {
  29.             border-color: rgba(255,255,255,.3);
  30.         }
  31.         #carousel-thumbs .selected img {
  32.             border-color: #fff;
  33.         }
  34.         .carousel-control-prev,
  35.         .carousel-control-next {
  36.             width: 50px;
  37.         }
  38.         @media all and (max-width: 767px) {
  39.             .carousel-container #carousel-thumbs img {
  40.                 border-width: 3px;
  41.             }
  42.             
  43.             .single-pricing{
  44.             width:115% !important;
  45.             margin-left: -18px;
  46.             }
  47.             p {
  48.     font-size: 12px !important;
  49. }
  50. }
  51.         @media all and (min-width: 576px) {
  52.             .carousel-container #carousel-thumbs {
  53.                 position: absolute;
  54.             }
  55.         }
  56.         @media all and (max-width: 576px) {
  57.             .carousel-container #carousel-thumbs {
  58.                 background: #ccccce;
  59.                 width:100%!important;
  60.             }
  61.         }
  62.         .offers_item{
  63.             position: relative;
  64.             width: 205%;
  65.             overflow: hidden;
  66.             box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  67.             transition: all 300ms;
  68.             margin-bottom: 30px;
  69.             border-radius: 20px;
  70.             color: rgba(0, 0, 0, 0.87);
  71.             background: #fff;
  72.         }
  73.         .offers_item:hover {
  74.             transform: translateY(-2px);
  75.             box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  76.         }
  77.         .latest_posts_container {
  78.             margin: 35px;
  79.         }
  80.         .hotel_location {
  81.             font-size: 24px;
  82.             color: #929191;
  83.             margin-top: 9px;
  84.             font-weight: 700;
  85.         }
  86.         /*price style*/
  87.         .pricing-content{}
  88.         .single-pricing{
  89.             background:#fff;
  90.             margin-top: 25px;
  91.             width: 255%;
  92.             padding:40px 20px;
  93.             border-radius:5px;
  94.             position:relative;
  95.             z-index:2;
  96.             border:1px solid #d8d5d5;
  97.             box-shadow: 0 10px 40px -10px rgba(0,64,128,.09);
  98.             transition:0.3s;
  99.         }
  100.         @media only screen and (max-width:480px) {
  101.             .single-pricing {margin-bottom:30px;}
  102.         }
  103.         .single-pricing:hover{
  104.             box-shadow:0px 60px 60px rgba(0,0,0,0.1);
  105.             z-index:100;
  106.             transform: translate(0, -10px);
  107.         }
  108.         .price-label {
  109.             color: #fff;
  110.             background: #ff9100;
  111.             font-size: 16px;
  112.             width: 100px;
  113.             margin-bottom: 15px;
  114.             display: block;
  115.             -webkit-clip-path: polygon(100% 0%, 90% 50%, 100% 100%, 0% 100%, 0 50%, 0% 0%);
  116.             clip-path: polygon(100% 0%, 90% 50%, 100% 100%, 0% 100%, 0 50%, 0% 0%);
  117.             margin-left: -20px;
  118.             position: absolute;
  119.         }
  120.         .price-head h2 {
  121.             font-weight: 600;
  122.             margin-bottom: 0px;
  123.             text-transform: capitalize;
  124.             font-size: 35px;
  125.         }
  126.         .price-head span {
  127.             display: inline-block;
  128.             background:#ff9100;
  129.             width: 6px;
  130.             height: 6px;
  131.             border-radius: 30px;
  132.             margin-bottom: 20px;
  133.             margin-top: 15px;
  134.         }
  135.         .price {
  136.             font-weight: 500;
  137.             font-size: 50px;
  138.             margin-bottom: 0px;
  139.         }
  140.         .single-pricing{}
  141.         .single-pricing h5 {
  142.             font-size: 14px;
  143.             margin-bottom: 0px;
  144.             text-transform: uppercase;
  145.         }
  146.         .single-pricing ul{
  147.             list-style: none;
  148.             margin-bottom: 20px;
  149.             margin-top: 30px;
  150.         }
  151.         .single-pricing ul li{line-height: 35px;}
  152.         .single-pricing button {
  153.             background:#ff9100;
  154.             border: 2px solid #ff9100;
  155.             border-radius: 5000px;
  156.             color: white;
  157.             display: inline-block;
  158.             font-size: 16px;
  159.             width: -webkit-fill-available;
  160.             overflow: hidden;
  161.             padding:10px 45px;
  162.             text-transform: capitalize;
  163.             transition: all 0.3s ease 0s;
  164.         }
  165.         .single-pricing button:hover, .single-pricing a:focus{
  166.             background:#ff9100;
  167.             color: #ffffff;
  168.             border: 2px solid #ff9100;
  169.         }
  170.         .single-pricing-white{background: #5b0909
  171.         }
  172.         .single-pricing-white ul li{color:#fff;}
  173.         .single-pricing-white h2{color:#fff;}
  174.         .single-pricing-white h1{color:#fff;}
  175.         .single-pricing-white h5{color:#fff;}
  176.         /*breadcrumb style*/
  177.         .hm-gradient {
  178.             background-image: linear-gradient(to top, #f3e7e9 0%, #e3eeff 99%, #e3eeff 100%);
  179.         }
  180.         .darken-grey-text {
  181.             color: #2E2E2E;
  182.         }
  183.         .bc-icons .breadcrumb-item + .breadcrumb-item::before {
  184.             content: none; }
  185.         .bc-icons .breadcrumb-item.active {
  186.             color: #eeeeee; }
  187.         .bc-icons-2 .breadcrumb-item + .breadcrumb-item::before {
  188.             content: none; }
  189.         .bc-icons-2 .breadcrumb-item.active {
  190.             color: #455a64; }
  191.         .light-font .breadcrumb-item + .breadcrumb-item::before {
  192.             color: #fff; }
  193.         .light-font .breadcrumb-item.active {
  194.             color: #cfd8dc; }
  195.         .dark-font .breadcrumb-item + .breadcrumb-item::before {
  196.             color: #000; }
  197.         .dark-font .breadcrumb-item.active {
  198.             color: #455a64; }
  199.         .breadcrumb{
  200.             background-color: transparent;
  201.         }
  202.         .container {
  203.             max-width: 1440px!important;
  204.         }
  205.         .main_nav_item a {
  206.             font-family: 'Open Sans', sans-serif;
  207.             font-size: 15px;
  208.             font-weight: 700;
  209.             color: #0093a9!important;
  210.             text-transform: uppercase;
  211.             padding-bottom: 10px;
  212.             padding-top: 10px;
  213.         }
  214.         .main_nav_item::after {
  215.             display: block;
  216.             position: absolute;
  217.             left: -1px;
  218.             bottom: -11px;
  219.             width: calc(100% + 2px);
  220.             height: 2px;
  221.             background: linear-gradient(to right, #b29b63, #0093a9)!important;
  222.             content: '';
  223.             opacity: 0;
  224.             -webkit-transition: all 200ms ease;
  225.             -moz-transition: all 200ms ease;
  226.             -ms-transition: all 200ms ease;
  227.             -o-transition: all 200ms ease;
  228.             transition: all 200ms ease;
  229.         }
  230.     </style>
  231. {% endblock %}
  232. {% block body %}
  233.     <!-- Home -->
  234.     <div class="home" style="height: 100px">
  235.     </div>
  236.     <!-- Blog -->
  237.     <div class="blog">
  238.         <div class="container">
  239.             <div class="row">
  240.                 <div class="col-lg-8">
  241.                     <div class="blog_post_container">
  242.                         <div class="hotel_title_container d-flex flex-lg-row flex-column">
  243.                             <div class="hotel_title_content">
  244.                                 {% set total = c.prix +  c.marge %}
  245.                                 <h1 class="hotel_title"><strong><i class="fa fa-map-marker"></i> Circuit: {{c.libelle}}</h1></strong>
  246.                                 <div class="hotel_location" style="color: #0093a9">à partir de {{total}} TND</div>
  247.                             </div>
  248.                         </div>
  249.                         <div class="blog_post">
  250.                             <div class="blog_post_image">
  251.                                 <div class="container mt-5">
  252.                                     <div class="carousel-container position-relative row">
  253.                                         <div id="myCarousel" class="carousel slide" data-ride="carousel">
  254.                                             <div class="carousel-inner">
  255.                                                 {% for img in c.imagescircuits %}
  256.                                                     <div class="carousel-item {{ loop.first ? 'active' }}">
  257.                                                         <img src="{{ asset('./rusticav/public/uploads/circuits/'~img.name) }}" class="d-block w-100 img-fluid" alt="..." style="height:448px;width: 750px!important;" data-type="image" data-toggle="lightbox" data-gallery="example-gallery">
  258.                                                     </div>
  259.                                                 {% endfor %}
  260.                                             </div>
  261.                                         </div>
  262.                                         <!-- Carousel Navigation -->
  263.                                         <div id="carousel-thumbs" class="carousel slide" data-ride="carousel">
  264.                                             <div class="carousel-inner">
  265.                                                 <div class="carousel-item active">
  266.                                                     <div class="row mx-0" style="display:flex;justify-content: center;align-items: center;">
  267.                                                         {% for img in c.imagescircuits %}
  268.                                                             <div id="carousel-selector-{{ loop.index0 }}" class="thumb col-4 col-sm-2 px-1 py-2 selected" data-target="#myCarousel" data-slide-to="{{ loop.index0 }}">
  269.                                                                 <img src="{{ asset('./rusticav/public/uploads/circuits/'~img.name) }}" style="width: 100px; height: 65px" class="img-fluid" alt="...">
  270.                                                             </div>
  271.                                                         {% endfor %}
  272.                                                     </div>
  273.                                                 </div>
  274.                                             </div>
  275.                                             <a class="carousel-control-prev" href="#carousel-thumbs" role="button" data-slide="prev">
  276.                                                 <span class="carousel-control-prev-icon" aria-hidden="true"></span>
  277.                                                 <span class="sr-only">Previous</span>
  278.                                             </a>
  279.                                             <a class="carousel-control-next" href="#carousel-thumbs" role="button" data-slide="next">
  280.                                                 <span class="carousel-control-next-icon" aria-hidden="true"></span>
  281.                                                 <span class="sr-only">Next</span>
  282.                                             </a>
  283.                                         </div>
  284.                                     </div> <!-- /row -->
  285.                                 </div> <!-- /container -->
  286.                             </div>
  287.                             <div class="blog_post_meta">
  288.                                 <ul>
  289.                                     <li class="blog_post_meta_item"><a href="" style="color: black"><i class="fa fa-pencil"></i> Description</a></li>
  290.                                     <li class="blog_post_meta_item"><a href="" style="color: black"><i class="fa fa-map-marker"></i> {{ c.libelle }}</a></li>
  291.                                     <li class="blog_post_meta_item"><a href="" style="color: black"><i class="fa fa-clock-o"></i> Durée : {{c.nbrejour}} Jours /{{c.nbrejour-1 }} Nuits</a></li>
  292.                                 </ul>
  293.                             </div>
  294.                             <div class="offers_item" style="width:100%;margin-top:20px;">
  295.                             <div class="blog_post_meta" style="margin-left: 22px;margin-right: 22px;">
  296.                                 <ul>
  297.                                     {{c.description|raw}}
  298.                                 </ul>
  299.                             </div>
  300.                             </div>
  301.                             <div class="container">
  302.                                 <div class="packs-container">
  303.                                     <br><br>
  304.                                     {% for pack, packData in dataByPack %}
  305.                                         {% set isFirstPack = loop.first %}
  306.                                         <input type="radio" name="packSelector" id="{{ pack }}" value="{{ pack }}" {% if isFirstPack %}checked{% endif %}>
  307.                                         <label for="{{ pack }}">{{ pack }}</label>
  308.                                         <div class="date-ranges">
  309.                                             {% for dateRange in packData.dateRanges %}
  310.                                                 <label class="date-label">
  311.                                                     <input
  312.                                                             type="radio"
  313.                                                             name="dateRanges"
  314.                                                             value="{{ dateRange.dated }}-{{ dateRange.datef }}"
  315.                                                             data-tarifbb="{{ dateRange.tarifbb }}"
  316.                                                             data-roomdata="{{ dateRange.roomData | json_encode }}"
  317.                                                             {% if isFirstPack and loop.index == 1 %}checked{% endif %}
  318.                                                     >
  319.                                                     {{ dateRange.dated }} - {{ dateRange.datef }}
  320.                                                 </label>
  321.                                                 <br>
  322.                                             {% endfor %}
  323.                                         </div>
  324.                                     {% endfor %}
  325.                                 </div>
  326.                                 <div id="selectedData" class="selected-data">
  327.                                     <section id="pricing" class="pricing-content section-padding">
  328.                                         <div class="container">
  329.                                             <div class="row text-center">
  330.                                                 <div class="col-lg-4 col-sm-4 col-xs-12 wow fadeInUp" data-wow-duration="1s" data-wow-delay="0.2s" data-wow-offset="0">
  331.                                                     <div class="single-pricing">
  332.                                                         <div class="price-head">
  333.                                                             <h2 id="selectedPackTitle" style="color: #0093a9"></h2>
  334.                                                             <span></span>
  335.                                                             <span></span>
  336.                                                             <span></span>
  337.                                                             <span></span>
  338.                                                             <span></span>
  339.                                                             <span></span>
  340.                                                         </div>
  341.                                                         <ul>
  342.                                                             <li id="chambreInfo"></li>
  343.                                                             
  344.                                                             <li style="font-size: 17px;font-weight: 600;color: #635959;text-align: justify">
  345.                                                             <i class="fa fa-check"></i>Tarif bébé <strong id="tarifbb" style="float: right;margin-right: 25px;"></strong>
  346.                                                             </li>
  347.                                                         </ul>
  348.                                                         <form id="reservationForm" method="post" action="{{ path('nouvelle',{'circuitId':c.id}) }}" >
  349.                                                             <input type="hidden" id="tarifbbInput" name="tarifbb">
  350.                                                             <input type="hidden" id="roomDataInput" name="roomData">
  351.                                                             <input type="hidden" id="selectedPackInput" name="selectedPack">
  352.                                                             <input type="hidden" id="selectedDateInput" name="selectedDate">
  353.                                                             <!-- Ajoutez d'autres champs au besoin -->
  354.                                                             <button type="submit" id="redirectButton" onclick="redirectToNewPage({{ c.id }})">Réserver</button>
  355.                                                         </form>
  356.                                                     </div>
  357.                                                 </div><!--- END COL -->
  358.                                             </div>
  359.                                         </div>
  360.                                     </section>
  361.                                 </div>
  362.                             </div>
  363.                             <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  364.                             <script>
  365.                                 $(document).ready(function () {
  366.                                     // Sélectionnez le premier pack et sa première date par défaut
  367.                                     var firstPackRadio = $('input[name="packSelector"]:first-child');
  368.                                     var firstDateRadio = firstPackRadio.closest('form').find('input[name="dateRanges"]:first-child');
  369.                                     firstPackRadio.prop('checked', true);
  370.                                     firstDateRadio.prop('checked', true);
  371.                                     // Ajoutez un événement "change" manuel pour déclencher l'affichage des données sélectionnées
  372.                                     firstDateRadio.trigger('change');
  373.                                     // Affichez les informations sélectionnées du premier date de la première pack lors du chargement
  374.                                     displaySelectedData();
  375.                                 });
  376.                                 var packRadios = $('input[name="packSelector"]');
  377.                                 var dateRadios = $('input[name="dateRanges"]');
  378.                                 var selectedDataDiv = $('#selectedData');
  379.                                 
  380.                                 // Fonction pour afficher les informations sélectionnées
  381.                                 function displaySelectedData() {
  382.                                     var selectedPackRadio = $('input[name="packSelector"]:checked');
  383.                                     if (selectedPackRadio.length > 0) {
  384.                                         // Récupérez le nom du pack sélectionné
  385.                                         var selectedPack = selectedPackRadio.val();
  386.                                         // Affichez le nom du pack dans le titre
  387.                                         $('#selectedPackTitle').text(selectedPack);
  388.                                         var selectedRadioButton = $('input[name="dateRanges"]:checked');
  389.                                         if (selectedRadioButton.length > 0) {
  390.                                             var tarifbb = selectedRadioButton.data('tarifbb');
  391.                                             var roomData = selectedRadioButton.data('roomdata');
  392.                                             var dated = selectedRadioButton.data('dated');
  393.                                             var datef = selectedRadioButton.data('datef');
  394.                                             if (tarifbb === "" || parseFloat(tarifbb) === 0) {
  395.                                                 tarifbb = "Sur demande";
  396.                                             } else {
  397.                                                 // Formater le tarif bb avec trois zéros après la virgule
  398.                                                 tarifbb = parseFloat(tarifbb).toFixed(3)+ ' TND';
  399.                                             }
  400.                                             // Affichez le tarif BB dans le span
  401.                                             $('#tarifbb').text(tarifbb);
  402.                                             // Affichez les informations sur les chambres dans la div
  403.                                             var chambreInfoDiv = $('#chambreInfo');
  404.                                             chambreInfoDiv.empty().append('<p> </p>');
  405.                                             $.each(roomData, function (chambreName, room) {
  406.                                                 chambreInfoDiv.append('<p style="font-size: 17px;font-weight: 600;color: #635959;text-align: justify"><i class="fa fa-check"></i>  Adulte en ' + chambreName +'<strong style="float: right;margin-right: 25px;">'+ '<strong> ' + room.price.toFixed(3) + ' TND</strong>'+'</span>'+ '</p>');
  407.                                             });
  408.                                             // Affichez les dates dans la div
  409.                                             $('#dated').text(dated);
  410.                                             $('#datef').text(datef);
  411.                                         }
  412.                                     }
  413.                                 }
  414.                                 // Ajoutez un écouteur d'événements pour les changements d'état des boutons radio du sélecteur de pack
  415.                                 packRadios.on('change', function () {
  416.                                     deselectOtherDates();
  417.                                     displaySelectedData();
  418.                                 });
  419.                                 // Ajoutez un écouteur d'événements pour les changements d'état des boutons radio
  420.                                 dateRadios.on('change', displaySelectedData);
  421.                                 // Ajoutez un écouteur d'événements pour le bouton de redirection
  422.                                 $('#redirectButton').on('click', function () {
  423.                                     redirectToNewPage({{ c.id }});
  424.                                 });
  425.                                 // Fonction pour désélectionner les autres dates de toutes les classes
  426.                                 function deselectOtherDates() {
  427.                                     dateRadios.prop('checked', false);
  428.                                 }
  429.                                 // Fonction pour rediriger vers la nouvelle page
  430.                                 function redirectToNewPage(circuitId) {
  431.                                     var selectedRadioButton = $('input[name="dateRanges"]:checked');
  432.                                     if (selectedRadioButton.length > 0) {
  433.                                         var tarifbb = selectedRadioButton.data('tarifbb');
  434.                                         var roomData = selectedRadioButton.data('roomdata');
  435.                                         var selectedPack = $('input[name="packSelector"]:checked').val();
  436.                                         var selectedDate = selectedRadioButton.val();
  437.                                         // Remplissez les champs du formulaire avec les données sélectionnées
  438.                                         $('#tarifbbInput').val(tarifbb);
  439.                                         $('#roomDataInput').val(JSON.stringify(roomData));
  440.                                         $('#selectedPackInput').val(selectedPack);
  441.                                         $('#selectedDateInput').val(selectedDate);
  442.                                         // Soumettez le formulaire
  443.                                         $('#reservationForm').submit();
  444.                                     }
  445.                                 }
  446.                             
  447.                                 // Fonction pour ajouter un champ caché au formulaire
  448.                                 function addHiddenField(form, name, value) {
  449.                                     var input = document.createElement('input');
  450.                                     input.setAttribute('type', 'hidden');
  451.                                     input.setAttribute('name', name);
  452.                                     input.setAttribute('value', value);
  453.                                     form.appendChild(input);
  454.                                 }
  455.                             </script>
  456.                         </div>
  457.                     </div>
  458.                 </div>
  459.                 <!-- Blog Sidebar -->
  460.                 
  461.                 <div class="col-lg-4 sidebar_col">
  462.                     <!-- Sidebar Latest Posts -->
  463.                     <div class="sidebar_latest_posts">
  464.                         <div class="offers_item" style="width: 110%;">
  465.                             <div class="sidebar_title text-center" style="color: white;font-size: 21px;margin: 36px;background: #ff9100">Circuits à la une</div>
  466.                             <div class="latest_posts_container">
  467.                                 <ul>
  468.                                     {% for v in circuit %}
  469.                                         {% if v.id != c.id and loop.index <= 5 %}
  470.                                             <li class="latest_post clearfix">
  471.                                                 <div class="latest_post_image">
  472.                                                     <a href="#">
  473.                                                         {% for img in v.imagescircuits %}
  474.                                                         {% if loop.first %}
  475.                                                             <img src="{{ asset('./rusticav/public/uploads/circuits/'~img.name) }}" alt="" style="width: 85px; height: 65px" />
  476.                                                         {% endif %}
  477.                                                     {% endfor %}
  478.                                                     </a>
  479.                                                 </div>
  480.                                                 <div class="latest_post_content">
  481.                                                     <div class="latest_post_title trans_200" style="color: black">
  482.                                                         <i class="fa fa-map-marker"></i>
  483.                                                         {{ v.libelle }}
  484.                                                     </div>
  485.                                                     <div class="latest_post_title trans_200" style="color: black">
  486.                                                         <i class="fa fa-clock-o"></i>
  487.                                                         {{v.nbrejour}} jours / {{v.nbrejour-1}} Nuits
  488.                                                     </div>
  489.                                                     <div class="latest_post_title trans_200">
  490.                                                         <a href="{{ path('detailcircuit', {'id': v.id}) }}" style="color: #d7000e;font-size: 16px;font-weight: 700">Voir détails  <i class="fa fa-angle-double-right" aria-hidden="true"></i>
  491.                                                         </a>
  492.                                                     </div> 
  493.                                                 </div>
  494.                                             </li>
  495.                                         {% endif %}
  496.                                     {% endfor %}
  497.                                 </ul>
  498.                             </div>
  499.                         </div>
  500.                         <div class="offers_item" style="width:110%;">
  501.                         <div class="blog_post_text" style="margin-left:13px;">
  502.                             <p style="font-size: 18px">{{c.serviceinclus|raw}}</p>
  503.                         </div></div>
  504.                         <div class="offers_item" style="width:110%;">
  505.                         <div class="blog_post_text"style="margin-left:13px;">
  506.                             <p style="font-size: 18px">{{c.servicenoninclus|raw}}</p>
  507.                         </div>
  508.                         </div>
  509.                     
  510.                     </div>
  511.                 </div>
  512.                 {# <!-- Blog Sidebar -->
  513.                 <div class="col-lg-4 sidebar_col">
  514.                     <!-- Sidebar Latest Posts -->
  515.                     <div class="sidebar_latest_posts">
  516.                         <div class="sidebar_title" style="color: #b29b63">À la une</div>
  517.                         <div class="latest_posts_container">
  518.                             <ul>
  519.                                 {% for c in circuit %}
  520.                                     {% if c.id != c.id and loop.index <= 5 %}
  521.                                         <li class="latest_post clearfix">
  522.                                             <div class="latest_post_image">
  523.                                                 <a href="#">
  524.                                                     {% for img in c.imagescircuits %}
  525.                                                         {% if loop.first %}
  526.                                                             <img src="{{ asset('./uploads/circuits/'~img.name) }}" alt="" style="width: 85px; height: 65px" />
  527.                                                         {% endif %}
  528.                                                     {% endfor %}
  529.                                                 </a>
  530.                                             </div>
  531.                                             <div class="latest_post_content">
  532.                                                 <div class="latest_post_title trans_200" style="color: black">
  533.                                                     <i class="fa fa-map-marker"></i>
  534.                                                     {{ c.titre }}
  535.                                                 </div>
  536.                                                 <div class="latest_post_title trans_200" style="color: black">
  537.                                                     <i class="fa fa-clock-o"></i>
  538.                                                     {{c.nbrejour}} jours / {{c.nbrejour-1}} Nuits
  539.                                                 </div>
  540.                                                 <div class="latest_post_title trans_200">
  541.                                                     <a href="{{ path('reserver', {'id': c.id}) }}" style="color: #b29b63;">Voir plus</a>
  542.                                                 </div>
  543.                                             </div>
  544.                                         </li>
  545.                                     {% endif %}
  546.                                 {% endfor %}
  547.                             </ul>
  548.                         </div>
  549.                     </div>
  550.                 </div> #}
  551.             </div>
  552.         </div>
  553.     </div>
  554. {% endblock %}
  555. {% block javascripts %}
  556.     <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  557.     <script>
  558.         $('#myCarousel').carousel({
  559.             interval: false
  560.         });
  561.         $('#carousel-thumbs').carousel({
  562.             interval: false
  563.         });
  564.         $('[id^=carousel-selector-]').click(function() {
  565.             var id_selector = $(this).attr('id');
  566.             var id = parseInt( id_selector.substr(id_selector.lastIndexOf('-') + 1) );
  567.             $('#myCarousel').carousel(id);
  568.         });
  569.         // Only display 3 items in nav on mobile.
  570.         if ($(window).width() < 575) {
  571.             $('#carousel-thumbs .row div:nth-child(4)').each(function() {
  572.                 var rowBoundary = $(this);
  573.                 $('<div class="row mx-0">').insertAfter(rowBoundary.parent()).append(rowBoundary.nextAll().addBack());
  574.             });
  575.             $('#carousel-thumbs .carousel-item .row:nth-child(even)').each(function() {
  576.                 var boundary = $(this);
  577.                 $('<div class="carousel-item">').insertAfter(boundary.parent()).append(boundary.nextAll().addBack());
  578.             });
  579.         }
  580.         // Hide slide arrows if too few items.
  581.         if ($('#carousel-thumbs .carousel-item').length < 2) {
  582.             $('#carousel-thumbs [class^=carousel-control-]').remove();
  583.             $('.machine-carousel-container #carousel-thumbs').css('padding','0 5px');
  584.         }
  585.         // when the carousel slides, auto update
  586.         $('#myCarousel').on('slide.bs.carousel', function(e) {
  587.             var id = parseInt( $(e.relatedTarget).attr('data-slide-number') );
  588.             $('[id^=carousel-selector-]').removeClass('selected');
  589.             $('[id=carousel-selector-'+id+']').addClass('selected');
  590.         });
  591.         // when user swipes, go next or previous
  592.         $('#myCarousel').swipe({
  593.             fallbackToMouseEvents: true,
  594.             swipeLeft: function(e) {
  595.                 $('#myCarousel').carousel('next');
  596.             },
  597.             swipeRight: function(e) {
  598.                 $('#myCarousel').carousel('prev');
  599.             },
  600.             allowPageScroll: 'vertical',
  601.             preventDefaultEvents: false,
  602.             threshold: 75
  603.         });
  604.         $('#myCarousel .carousel-item img').on('click', function(e) {
  605.             var src = $(e.target).attr('data-remote');
  606.             if (src) $(this).ekkoLightbox();
  607.         });
  608.     </script>
  609. {% endblock %}