templates/building_detail/building_details_index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{companyName}} | {% trans %}Accueil{% endtrans %}{% endblock %}
  3. {% block stylesheets %}
  4.     {{ parent() }}
  5.     <link href="{{ asset('css/home.func.css') }}" rel="stylesheet" />
  6.     <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
  7.     <style>
  8.         .truncate-overflow {
  9.             display: -webkit-box;
  10.             -webkit-line-clamp: 4;
  11.             -webkit-box-orient: vertical;
  12.             overflow: hidden;
  13.             font-size: 14px;
  14.         }
  15.         .truncate-overflow:hover {
  16.              cursor: pointer;
  17.         }
  18.         .zoom {
  19.             transition: transform .2s; /* Animation */
  20.             cursor: pointer;
  21.         }
  22.         .slick-next{
  23.             width: 20px;
  24.             height: 20px;
  25.         }
  26.         .slick-prev{
  27.             width: 20px;
  28.             height: 20px;
  29.         }
  30.         .zoom:hover {
  31.             transform: scale(1.5); /* (150% zoom - Note: if the zoom is too large, it will go outside of the viewport) */
  32.         }
  33.         .modal { width:75% !important ; height: 75% !important ; }
  34.         div.ex3 {
  35.             background-color: #ffffff;
  36.             height: 250px;
  37.             width: 100%;
  38.             overflow-y: auto;
  39.         }
  40.         div.ex4 {
  41.             background-color: #ffffff;
  42.             height: 300px;
  43.             border-radius: 30px;
  44.             width: 100%;
  45.             overflow-y: auto;
  46.         }
  47.     </style>
  48.     <style>
  49.        .pagination li{
  50.             display:inline-block;
  51.             margin: 0 2px;
  52.             width: 30px;
  53.             height: 30px;
  54.             border-radius: 50%;
  55.             text-align: center;
  56.             font-size: 18px;
  57.             font-weight: 400;
  58.             line-height: 30px;
  59.             cursor: pointer;
  60.            background-position: 0 -45px;
  61.            transition: background-position 0.5s;
  62.         }
  63.        .pagination li.active{
  64.            color:#fff;
  65.            background-image: linear-gradient(#ff4568, #ff4568);
  66.            background-repeat: no-repeat;
  67.            background-position: 0 0;
  68.        }
  69.         .container-caroussel {
  70.             position: relative;
  71.             width: 50%;
  72.         }
  73.         .image-caroussel {
  74.             display: block;
  75.             width: 100%;
  76.             height: auto;
  77.         }
  78.         .overlay-caroussel {
  79.             position: absolute;
  80.             bottom: 0;
  81.             left: 0;
  82.             right: 0;
  83.             background-color: #008CBA;
  84.             overflow: hidden;
  85.             width: 100%;
  86.             height: 0;
  87.             transition: .5s ease;
  88.         }
  89.         .container-caroussel:hover .overlay {
  90.             height: 100%;
  91.         }
  92.         .text-caroussel {
  93.             color: white;
  94.             font-size: 20px;
  95.             position: absolute;
  96.             top: 50%;
  97.             left: 50%;
  98.             -webkit-transform: translate(-50%, -50%);
  99.             -ms-transform: translate(-50%, -50%);
  100.             transform: translate(-50%, -50%);
  101.             text-align: center;
  102.         }
  103.     </style>
  104. {% endblock %}
  105. {% block body %}
  106.     {{ parent() }}
  107.     <div class="row" id="content" style="margin-top: 80px; ">
  108.         {% if type is not null%}
  109.                         {% if type.enable ==true %}
  110.                             <div id="building_{{type.id }}"
  111.                                  class="col s12 " style=" margin-top: 40px;;
  112.                                    z-index: 100; position: relative" >
  113.                                 <div class="col s12 card z-depth-3" style="   border-radius: 50px; background: -webkit-linear-gradient(90deg, rgba(192,220,126,0.7), rgba(192,220,126,0.73)) !important;; ">
  114.                                     <div class="input-field col m6 s12 l3 m6" style="">
  115.                                         <div class="col s12" >
  116.                                             <i class="fas fa-bed" style=" font-size: 18px; position: absolute; margin-left: -25px;margin-top: 10px; float: right; z-index: 100 "></i>
  117.                                             <select class="js-example-basic-single" name="destinationTown" id="destinationTown_{{type.id  }}" style="width: 100%;   ">
  118.                                                 {% for town in towns %}
  119.                                                     <option value="{{ town.id }}">{{ town.townName }}</option>
  120.                                                 {%endfor %}
  121.                                             </select>
  122.                                         </div>
  123.                                     </div>
  124.                                     <div class="col m6 s12 l4  m6 ">
  125.                                         <div class="col s12">
  126.                                             <div class="col s6">
  127.                                                 <h6>Arrivée Le</h6>
  128.                                                 <input style="margin-top: -10px" type="datetime-local"  onchange="updateStartDate({{ type.id  }})"  value="{{ startDate }}" id="startDate_{{ type.id }}"  placeholder="Date d'arrivée" name="startDate"  class="col s12  "/>
  129.                                             </div>
  130.                                             <div class="col s6">
  131.                                                 <h6>Départ Le</h6>
  132.                                                 <input   style="margin-top: -10px" type="datetime-local"  onchange="updateEndDate({{ type.id  }})" value="{{ endDate }}" id="endDate_{{ type.id }}"  placeholder="Date de départ"  name="endDate"  class="col s12  "/>
  133.                                             </div>
  134.                                         </div>
  135.                                     </div>
  136.                                     <div class="col s12 l3 m6 ">
  137.                                         <div class="col s12">
  138.                                             <div class="col s3 pull-l1 "  style="margin-top: 20px">
  139.                                                 <h6 style="margin-left: -10px">
  140.                                                     <i class="fas fa-user-friends " style="position: absolute; float: right; margin-left: -10px" ></i>
  141.                                                     <span style="margin-left: 15px">Adultes</span>
  142.                                                 </h6>
  143.                                             </div>
  144.                                             <div class="s3 col"   style="margin-top: 20px">
  145.                                                 <input style="margin-top: -10px" min="1" value="{{ adult }}"  onchange="updateAdult({{type.id  }})"  type="number" id="adult_{{ type.id }}"   name="adult_{{ type.id }}"  class="col s12  "/>
  146.                                             </div>
  147.                                             <div class="s3 col "  style="margin-top: 20px">
  148.                                                 <h6 style="margin-left: -10px">
  149.                                                     <i class="fas fa-baby " style="position: absolute; float: right; margin-left: -10px" ></i>
  150.                                                     <span style="margin-left: 15px">Enfants</span>
  151.                                                 </h6>
  152.                                             </div>
  153.                                             <div class="s3 col"   style="margin-top: 20px">
  154.                                                 <input style="margin-top: -10px; margin-left: 10px; font-weight: 20;" min="0" value="{{ child  }}"  onchange="updateChild({{type.id  }})"  type="number" id="child_{{ type.id }}"   name="child_{{ type.id }}"  class="col s12  "/>
  155.                                             </div>
  156.                                         </div>
  157.                                     </div>
  158.                                     <a id="btn_search_{{ type.id }}" onclick="findBuilding({{ type.id }}, '{{ type.type }}')" href="#!" class="   card black-text  col m6 s12 l2 m6 button  waves-ripple waves-effect " style=" padding: 10px; border-radius: 20px; margin-top: 20px">
  159.                                         <i class="fas fa-search" style="margin-left: 5px; margin-right:  5px"></i>
  160.                                         <span class="" id="btn_text_{{ type.id }}">Rechercher</span>
  161.                                         <img id="btn_loading_{{ type.id }}" src="{{ asset('img/loading.webp') }}" class="hide" style="max-height: 20px; position: absolute; float: right; right: 0; padding-right: 10px" alt="">
  162.                                     </a>
  163.                                 </div>
  164.                             </div>
  165.                         {% endif %}
  166.             {% else %}
  167.                 <div class="col s10 offset-s1" style="margin-top: 30px;  ">
  168.                     <ul class="tabs" style=" background-color: rgba(192,220,126,0);">
  169.                         {% for buildingType in buildingTypes %}
  170.                             {% if buildingType.enable ==true %}
  171.                                 <li class="tab col s3  " style="
  172.                    margin: 5px;
  173.  background-color: rgba(192,220,126,0.7);
  174.                       ">
  175.                                     <a href="#building_{{buildingType.id }}" class="black-text waves-ripple waves-effect">
  176.                                         <i class="fas fa-hotel  " style="margin-left: -5px; margin-right:  50px"></i>
  177.                                         {{buildingType.type }}
  178.                                     </a></li>
  179.                             {% endif %}
  180.                         {%endfor %}
  181.                     </ul>
  182.                 </div>
  183.                 {% for buildingType in buildingTypes %}
  184.                     {% if buildingType.enable ==true %}
  185.                         <div id="building_{{buildingType.id }}"
  186.                              class="col s10 offset-s1  " style=" margin-top: 0px;
  187.                      " >
  188.                             <div class="col s12 card" style="  background-color: rgba(192,220,126,0.57);">
  189.                                 <div class="input-field col m6 s12 l3 m6">
  190.                                     <div class="col s12" >
  191.                                         <i class="fas fa-bed" style=" font-size: 18px; position: absolute; margin-left: -30px;margin-top: 10px; float: right; z-index: 100 "></i>
  192.                                         <select class="js-example-basic-single" name="destinationTown" id="destinationTown_{{buildingType.id  }}" style="width: 100%;   ">
  193.                                             {% for town in towns %}
  194.                                                 <option value="{{ town.id }}">{{ town.townName }}</option>
  195.                                             {%endfor %}
  196.                                         </select>
  197.                                     </div>
  198.                                 </div>
  199.                                 <div class="col m6 s12 l4  m6 ">
  200.                                     <div class="col s12">
  201.                                         <div class="col s6">
  202.                                             <h6>Arrivée Le</h6>
  203.                                             <input style="margin-top: -10px" onchange="updateStartDate({{ buildingType.id  }})" type="datetime-local" id="startDate_{{ buildingType.id }}"  placeholder="Date d'arrivée" name="startDate"  class="col s12  "/>
  204.                                         </div>
  205.                                         <div class="col s6">
  206.                                             <h6>Départ Le</h6>
  207.                                             <input   style="margin-top: -10px"  onchange="updateEndDate({{ buildingType.id  }})" type="datetime-local" id="endDate_{{ buildingType.id }}"  placeholder="Date de départ"  name="endDate"  class="col s12  "/>
  208.                                         </div>
  209.                                     </div>
  210.                                 </div>
  211.                                 <div class="col s12 l3 m6 ">
  212.                                     <div class="col s12">
  213.                                         <div class="col s3 pull-l1 "  style="margin-top: 20px">
  214.                                             <h6 style="margin-left: -10px">
  215.                                                 <i class="fas fa-user-friends " style="position: absolute; float: right; margin-left: -10px" ></i>
  216.                                                 <span style="margin-left: 15px">Adultes</span>
  217.                                             </h6>
  218.                                         </div>
  219.                                         <div class="s3 col"   style="margin-top: 20px">
  220.                                             <input style="margin-top: -10px" min="1" onchange="updateAdult({{buildingType.id  }})"  value="1" type="number" id="adult_{{ buildingType.id }}"   name="adult_{{ buildingType.id }}"  class="col s12  "/>
  221.                                         </div>
  222.                                         <div class="s3 col "  style="margin-top: 20px">
  223.                                             <h6 style="margin-left: -10px">
  224.                                                 <i class="fas fa-baby " style="position: absolute; float: right; margin-left: -10px" ></i>
  225.                                                 <span style="margin-left: 15px">Enfants</span>
  226.                                             </h6>
  227.                                         </div>
  228.                                         <div class="s3 col"   style="margin-top: 20px">
  229.                                             <input style="margin-top: -10px; margin-left: 10px; font-weight: 20;" min="0"  onchange="updateChild({{buildingType.id  }})"  value="0" type="number" id="child_{{ buildingType.id }}"   name="child_{{ buildingType.id }}"  class="col s12  "/>
  230.                                         </div>
  231.                                     </div>
  232.                                 </div>
  233.                                 <a id="btn_search_{{ buildingType.id }}" onclick="findBuilding({{ buildingType.id }}, '{{ buildingType.type }}')" href="#!" class="   card black-text  col m6 s12 l2 m6 button  waves-ripple waves-effect " style=" padding: 10px; border-radius: 20px; margin-top: 20px">
  234.                                     <i class="fas fa-search" style="margin-left: 5px; margin-right:  5px"></i>
  235.                                     <span class="" id="btn_text_{{ buildingType.id }}">Rechercher</span>
  236.                                     <img id="btn_loading_{{ buildingType.id }}" src="{{ asset('img/loading.webp') }}" class="hide" style="max-height: 20px; position: absolute; float: right; right: 0; padding-right: 10px" alt="">
  237.                                 </a>
  238.                             </div>
  239.                         </div>
  240.                     {% endif %}
  241.                 {%endfor %}
  242.             {% endif %}
  243.         <div class="col s10 offset-s1 b" style="margin-top: -2px">
  244.             <a href="{{ path('app_home') }}" class="  ">Accueil</a>
  245.             <i class="fas fa-chevron-right"></i>
  246.             <img class="responsive-img circle"  style="max-height: 18px; margin-top: 1px; position: absolute"  src="{{ onlinePath }}/media/{{  town.country.countryFlag }}" alt="">
  247.             <a href="#!" style="margin-left: 30px" class="  ">{{ town.country.countryName }}</a>
  248.             <i class="fas fa-chevron-right"></i>
  249.             <a href="#!" class="  ">{{ town.townName }}</a>
  250.             <i class="fas fa-chevron-right"></i>
  251.             {% if type is not null%}
  252.             <a href="#!" class=" ">{{ type.type }}</a>
  253.             {% else %}
  254.                 <a href="#!" class=" ">All</a>
  255.             {% endif %}
  256.         </div>
  257.         <div class="col s12">
  258.             <div class="col s12 l3 card">
  259.                 <div class="col s12" >
  260.                     <div class="col s12 divider" style="margin-bottom: 10px"></div>
  261.                     <b><h5  id="displayAmount" style="font-size: 16px; margin-top: 10px">
  262.                             Prix max par nuité      </h5></b>
  263.                     <p class="range-field">
  264.                         <input onchange="displayAmount()" type="range" id="maxAmount" min="0" value="10000" max="400000" />
  265.                     </p>
  266.                 </div>
  267.                 <br>
  268.                 <div class="col s12" >
  269.                     <div class="col s12 divider" style="margin-bottom: 10px"></div>
  270.                     <b>
  271.                         <h5 style="font-size: 18px; margin-top: 15px">
  272.                             Notiriété:
  273.                             <i onmouseover="notority(1)" onmouseleave="unCheckNotority()" onclick="notorityShoose(1)" class="fas fa-star zoom-in animated" id="star_1" style="cursor: pointer ; color: palegoldenrod; margin-left: 10px"></i>
  274.                             <i  onmouseover="notority(2)" onmouseleave="unCheckNotority()" onclick="notorityShoose(2)" class="fas fa-star" id="star_2" style="cursor: pointer ; color: palegoldenrod"></i>
  275.                             <i   onmouseover="notority(3)" onmouseleave="unCheckNotority()" onclick="notorityShoose(3)" class="fas fa-star" id="star_3" style="cursor: pointer ; color: palegoldenrod"></i>
  276.                             <i onmouseover="notority(4)" onmouseleave="unCheckNotority()" onclick="notorityShoose(4)" class="fas fa-star" id="star_4" style="cursor: pointer ; color: palegoldenrod"></i>
  277.                             <i  onmouseover="notority(5)" onmouseleave="unCheckNotority()" onclick="notorityShoose(5)" class="fas fa-star" id="star_5" style="cursor: pointer ; color: palegoldenrod"></i>
  278.                             <i  onmouseover="notority(6)" onmouseleave="unCheckNotority()" onclick="notorityShoose(6)" class="fas fa-star" id="star_6" style="cursor: pointer ; color: palegoldenrod"></i>
  279.                         </h5></b>
  280.                 </div>
  281.                 <div class="col s12" >
  282.                     <div class="col s12 divider" style="margin-bottom: 10px"></div>
  283.                     <b><h5 style="font-size: 16px; margin-top: 10px">Promotions</h5></b>
  284.                     <p>
  285.                         <input type="checkbox" id="breakFast" />
  286.                         <label for="breakFast">Petit déjeuner Gratuit</label>
  287.                         <img class="responsive-img zoom"  style="float: right; margin-right:  5px; max-height: 25px" src="{{ asset('img/icon_restaurant.png') }}" alt="">
  288.                     </p>
  289.                 </div>
  290.                 <div class="col s12" >
  291.                     <div class="col s12 divider" style="margin-bottom: 10px"></div>
  292.                     <b><h5 style="font-size: 16px; margin-top: 10px">Conditions de réservations</h5></b>
  293.                     <p>
  294.                         <input type="checkbox" id="cancelableBooking" />
  295.                         <label for="cancelableBooking">Annulation Gratuite</label>
  296.                     </p>
  297.                     <p>
  298.                         <input type="checkbox" id="payBefore" />
  299.                         <label for="payBefore">Paiement à l'avance</label>
  300.                     </p>
  301.                 </div>
  302.                 <div class="col s12">
  303.                     <div class="col s12 divider" style="margin-bottom: 10px"></div>
  304.                     <b><h5 style="font-size: 16px; margin-top: 10px">Les équipements</h5></b>
  305.                     <p>
  306.                         <input type="checkbox" id="pool" />
  307.                         <label for="pool">Piscine  </label>
  308.                         <img class="responsive-img zoom"  style="float: right; margin-right:  5px; max-height: 30px" src="{{ asset('img/icon_swimming.png') }}" alt="">
  309.                     </p>
  310.                     <p>
  311.                         <input type="checkbox" id="mini_bar" />
  312.                         <label for="mini_bar">Mini Bar  </label>
  313.                         <img class="responsive-img zoom "   style="float: right; margin-right:  5px; max-height: 25px" src="{{ asset('img/icon_bar.png') }}" alt="">
  314.                     </p>
  315.                     <p>
  316.                         <input type="checkbox" id="restaurant" />
  317.                         <label for="restaurant">Restaurant   </label>
  318.                         <img class="responsive-img zoom"  style="float: right; margin-right:  5px; max-height: 25px" src="{{ asset('img/icon_restaurant.png') }}" alt="">
  319.                     </p>
  320.                     <p>
  321.                         <input type="checkbox" id="parking" />
  322.                         <label for="parking">Parking</label>
  323.                         <img class="responsive-img zoom"  style="float: right; margin-right:  5px; max-height: 25px" src="{{ asset('img/icon_parking.png') }}" alt="">
  324.                     </p>
  325.                     <p>
  326.                         <input type="checkbox" id="conference_room" />
  327.                         <label for="conference_room">
  328.                             Salle de conference
  329.                         </label>
  330.                         <img class="responsive-img zoom"  style="float: right; margin-right:  5px; max-height: 25px" src="{{ asset('img/icon_conf_off.png') }}" alt="">
  331.                     </p>
  332.                 </div>
  333.             </div>
  334.             <div class="col s12 l9">
  335.                 <div class="col s12">
  336.                     {% if type is not null%}
  337.                     <h5 style="font-weight: 20">{{ town.townName }}: {{ result|length }} {{ type.type}}  trouvé(e)s</h5>
  338.                     {% else %}
  339.                     <h5 style="font-weight: 20">{{ town.townName }}: {{ result|length }}  offre(s) trouvé(e)s</h5>
  340.                     {% endif %}
  341.                 </div>
  342.                 <div class="col s12">
  343.                     {% set buildingLenght=result|length %}
  344.                     {%  if buildingLenght !=1 %}
  345.                         {% set list=1 %}
  346.                     {% for k in range(0, buildingLenght, showItem) %}
  347.                        <div class="row hide " id="building_slide_{{ list }}">
  348.                            {% for building in result|slice(k,k+showItem) %}
  349.                            <div class="col s12 card " style="border-radius: 10px">
  350.                                <div class="m3 l4 s12   col">
  351.                                    <ul class="autoplayPack_{{ list }}">
  352.                                        {% if building.picture1 is not empty %}
  353.                                            <li>
  354.                                                <img class=" zoom circle  image-n-margin  responsive-img halfway-fab hoverable"   src="{{ onlinePath }}/media/{{ building.picture1 }}" style=" width: 200px; height: 200px" alt="">
  355.                                            </li>
  356.                                        {% endif %}
  357.                                        {% if building.picture2 is not empty %}
  358.                                            <li>
  359.                                                <img class="zoom  circle  image-n-margin responsive-img halfway-fab hoverable"  src="{{ onlinePath }}/media/{{ building.picture2 }}"  style=" width: 200px; height: 200px" alt="">
  360.                                            </li>
  361.                                        {% endif %}
  362.                                        {% if building.picture3 is not empty %}
  363.                                            <li>
  364.                                                <img class="  zoom  circle    image-n-margin responsive-img halfway-fab hoverable"  src="{{ onlinePath }}/media/{{ building.picture3 }}"  style=" width: 200px; height: 200px" alt="">
  365.                                            </li>
  366.                                        {% endif %}
  367.                                    </ul>
  368.                                </div>
  369.                                <div class=" col s12 m9 l8">
  370.                                    <div class="col s12">
  371.                                        <h5>
  372.                                            {{ building.designation }}
  373.                                        </h5>
  374.                                        <p style="margin-top: -10px">
  375.                                            {% for i in 0.. building.options.notiriety %}
  376.                                                <i class="fas fa-star " style="font-size: 14px; color: gold"></i>
  377.                                            {%endfor %}
  378.                                        </p>
  379.                                    </div>
  380.                                    <div class="col s12" style="margin-top: -10px">
  381.                                        <h6>Situé à {{ building.address.location }}</h6>
  382.                                    </div>
  383.                                    <div class="col s12">
  384.                                        <p class="truncate-overflow">{{ building.description }}</p>
  385.                                    </div>
  386.                                    <div class="col s12 " style="margin-top: -20px">
  387.                                        {% if building.options is not null %}
  388.                                            <h5 class="left-align ">
  389.                                                {% if building.options.miniBar == true %}
  390.                                                    <img class="responsive-img zoom "   style="margin: 5px; max-height: 25px" src="{{ asset('img/icon_bar.png') }}" alt="">
  391.                                                {% endif %}
  392.                                                {% if building.options.restaurant == true %}
  393.                                                    <img class="responsive-img zoom"  style="margin: 5px; max-height: 25px" src="{{ asset('img/icon_restaurant.png') }}" alt="">
  394.                                                {% endif %}
  395.                                                {% if building.options.parking == true  %}
  396.                                                    <img class="responsive-img zoom"  style="margin: 5px; max-height: 25px" src="{{ asset('img/icon_parking.png') }}" alt="">
  397.                                                {% endif %}
  398.                                                {% if building.options.pool == true  %}
  399.                                                    <img class="responsive-img zoom"  style="margin: 5px; max-height: 30px" src="{{ asset('img/icon_swimming.png') }}" alt="">
  400.                                                {% endif %}
  401.                                                {% if building.options.conferenceRoom == true  %}
  402.                                                    <img class="responsive-img zoom"  style="margin: 5px; max-height: 25px" src="{{ asset('img/icon_conf_off.png') }}" alt="">
  403.                                                {% endif %}
  404.                                            </h5>
  405.                                        {% endif %}
  406.                                        <div class="col s12 right right-align right-aligned">
  407.                                            <a id="btn_building_{{ building.id }}"  onclick="gotToBook({{ building.id }} )"  href="#!" class=" right right-align right-aligned  card black-text    button  waves-ripple waves-effect " style="margin-right: 30px;  padding: 10px; border-radius: 20px; margin-top: -20px; width: fit-content">
  408.                                                <span class="" id="btn_text_{{ building.id }}">{{ building.rooms|length }} offre(s) disponible(s)</span>
  409.                                                <i class="fas fa-eye" style="margin-left: 5px; margin-right:  5px"></i>
  410.                                                <img id="building_loading_{{ building.id }}" src="{{ asset('img/loading.webp') }}" class="hide" style="max-height: 20px; position: absolute; float: right; right: 0; padding-right: 10px" alt="">
  411.                                            </a>
  412.                                        </div>
  413.                                        <img class="responsive-img "  style="margin-top: -15px; max-height: 30px; position: absolute; z-index: 100; right: 0; margin-right: 20px" src="{{ onlinePath }}/media/{{ building.company.companyLogoMain }}" alt="">
  414.                                    </div>
  415.                                </div>
  416.                            </div>
  417.                            {%endfor %}
  418.                        </div>
  419.                  {%  set list=list+1 %}
  420.                     {%endfor %}
  421.                     {% else %}
  422.                         {% for building in result %}
  423.                             <div class="col s12 card " style="border-radius: 10px">
  424.                                 <div class="m3 l4 s12   col">
  425.                                     {% set list=1 %}
  426.                                     <ul class="autoplayPack_{{ list }}">
  427.                                         {% if building.picture1 is not empty %}
  428.                                             <li>
  429.                                                 <img class=" zoom circle  image-n-margin  responsive-img halfway-fab hoverable"   src="{{ onlinePath }}/media/{{ building.picture1 }}" style=" width: 200px; height: 200px" alt="">
  430.                                             </li>
  431.                                         {% endif %}
  432.                                         {% if building.picture2 is not empty %}
  433.                                             <li>
  434.                                                 <img class="zoom  circle  image-n-margin responsive-img halfway-fab hoverable"  src="{{ onlinePath }}/media/{{ building.picture2 }}"  style=" width: 200px; height: 200px" alt="">
  435.                                             </li>
  436.                                         {% endif %}
  437.                                         {% if building.picture3 is not empty %}
  438.                                             <li>
  439.                                                 <img class="  zoom  circle    image-n-margin responsive-img halfway-fab hoverable"  src="{{ onlinePath }}/media/{{ building.picture3 }}"  style=" width: 200px; height: 200px" alt="">
  440.                                             </li>
  441.                                         {% endif %}
  442.                                     </ul>
  443.                                 </div>
  444.                                 <div class=" col s12 m9 l8">
  445.                                     <div class="col s12">
  446.                                         <h5>
  447.                                             {{ building.designation }}
  448.                                         </h5>
  449.                                         <p style="margin-top: -10px">
  450.                                             {% for i in 0.. building.options.notiriety %}
  451.                                                 <i class="fas fa-star " style="font-size: 14px; color: gold"></i>
  452.                                             {%endfor %}
  453.                                         </p>
  454.                                     </div>
  455.                                     <div class="col s12" style="margin-top: -10px">
  456.                                         <h6>Situé à {{ building.address.location }}</h6>
  457.                                     </div>
  458.                                     <div class="col s12">
  459.                                         <p class="truncate-overflow">{{ building.description }}</p>
  460.                                     </div>
  461.                                     <div class="col s12 " style="margin-top: -20px">
  462.                                         {% if building.options is not null %}
  463.                                             <h5 class="left-align ">
  464.                                                 {% if building.options.miniBar == true %}
  465.                                                     <img class="responsive-img zoom "   style="margin: 5px; max-height: 25px" src="{{ asset('img/icon_bar.png') }}" alt="">
  466.                                                 {% endif %}
  467.                                                 {% if building.options.restaurant == true %}
  468.                                                     <img class="responsive-img zoom"  style="margin: 5px; max-height: 25px" src="{{ asset('img/icon_restaurant.png') }}" alt="">
  469.                                                 {% endif %}
  470.                                                 {% if building.options.parking == true  %}
  471.                                                     <img class="responsive-img zoom"  style="margin: 5px; max-height: 25px" src="{{ asset('img/icon_parking.png') }}" alt="">
  472.                                                 {% endif %}
  473.                                                 {% if building.options.pool == true  %}
  474.                                                     <img class="responsive-img zoom"  style="margin: 5px; max-height: 30px" src="{{ asset('img/icon_swimming.png') }}" alt="">
  475.                                                 {% endif %}
  476.                                                 {% if building.options.conferenceRoom == true  %}
  477.                                                     <img class="responsive-img zoom"  style="margin: 5px; max-height: 25px" src="{{ asset('img/icon_conf_off.png') }}" alt="">
  478.                                                 {% endif %}
  479.                                             </h5>
  480.                                         {% endif %}
  481.                                         <div class="col s12 right right-align right-aligned">
  482.                                             <a id="btn_building_{{ building.id }}"  onclick="gotToBook({{ building.id }} )"  href="#!" class=" right right-align right-aligned  card black-text    button  waves-ripple waves-effect " style="margin-right: 30px;  padding: 10px; border-radius: 20px; margin-top: -20px; width: fit-content">
  483.                                                 <span class="" id="btn_text_{{ building.id }}">{{ building.rooms|length }} offre(s) disponible(s)</span>
  484.                                                 <i class="fas fa-eye" style="margin-left: 5px; margin-right:  5px"></i>
  485.                                                 <img id="building_loading_{{ building.id }}"  src="{{ asset('img/loading.webp') }}" class="hide" style="max-height: 20px; position: absolute; float: right; right: 0; padding-right: 10px" alt="">
  486.                                             </a>
  487.                                         </div>
  488.                                         <img class="responsive-img "  style="margin-top: -15px; max-height: 30px; position: absolute; z-index: 100; right: 0; margin-right: 20px" src="{{ onlinePath }}/media/{{ building.company.companyLogoMain }}" alt="">
  489.                                     </div>
  490.                                 </div>
  491.                             </div>
  492.                         {%endfor %}
  493.                     {% endif %}
  494.                 </div>
  495.             <div class="col s12" style="border-radius: 10px; border-width: 2px; border-style: solid; border-color: lightgray">
  496.             {% set lastPage = result|length/showItem + buildingLenght%showItem %}
  497.                 {% set currentPage = 1 %}
  498.                 {% set showAlwaysFirstAndLast = true %}
  499.                 {% set currentFilters = {} %}
  500.                     {% if lastPage > 1 %}
  501.                         {# the number of first and last pages to be displayed #}
  502.                         {% set extremePagesLimit = 5 %}
  503.                         {# the number of pages that are displayed around the active page #}
  504.                         {% set nearbyPagesLimit = 5 %}
  505.                         {% set j = currentPage - nearbyPagesLimit %}
  506.                         <ul class="pagination">
  507.                             {% if currentPage > 1 %}
  508.                                 <li class=" " onclick="backBtn()"><i class="fas fa-chevron-left"></i></li>
  509.                                 {% for i in range(1, extremePagesLimit) %}
  510.                                     {%  if ( i < currentPage - nearbyPagesLimit ) %}
  511.                                         <li class=" links_{{ i }}" value="{{ i }}" onclick=" activeLink({{ i }})">{{ i }}</li>
  512.                                 {% endif %}
  513.                                 {% endfor %}
  514.                                 {% if extremePagesLimit + 1 < currentPage - nearbyPagesLimit %}
  515.                                     <span class="sep-dots">...</span>
  516.                                 {% endif %}
  517.                                 {% for i in range(currentPage-nearbyPagesLimit, currentPage-1) %}
  518.                                     {%  if ( i > 0 ) %}
  519.                                         <li class=" links_{{ i }}" value="{{ i }}" onclick=" activeLink({{ i }})">{{ i }}</li>
  520.                                     {% endif %}
  521.                                 {% endfor %}
  522.                             {% elseif showAlwaysFirstAndLast %}
  523.                                 <li class=" " onclick="backBtn()"><i class="fas fa-chevron-left"></i></li>
  524.                             {% endif %}
  525.                             <span class="sep-dots_start hide">...</span>
  526.                             <li class=" active links_{{ currentPage}}" value="{{ currentPage }}" onclick=" activeLink({{ currentPage }})">{{ currentPage }}</li>
  527.                             {% if currentPage < lastPage %}
  528.                                 {% for i in range(currentPage+1, currentPage + nearbyPagesLimit) %}
  529.                                     {%     if ( i <= lastPage ) %}
  530.                                         <span class="sep-dots_prev_{{ i }} hide">...</span>
  531.                                         <li class=" links_{{ i }}" value="{{ i }}" onclick=" activeLink({{ i }})">{{ i }}</li>
  532.                                     {% endif %}
  533.                                 {% endfor %}
  534.                                 {% if  (lastPage - extremePagesLimit) > (currentPage + nearbyPagesLimit) %}
  535.                                     {% for j in currentPage + nearbyPagesLimit+1 .. lastPage - extremePagesLimit  %}
  536.                                         <span class="sep-dots_prev_{{ j }} hide">...</span>
  537.                                     <li class=" hide links_{{ j }}" value="{{ j }}" onclick=" activeLink({{ j }})">{{ j }}</li>
  538.                                     {% endfor %}
  539.                                     <span class="sep-dots_middle">...</span>
  540.                                 {% endif %}
  541.                                 <span class="sep-dots_end hide">...</span>
  542.                                 {% for i in range(lastPage - extremePagesLimit+1, lastPage)%}
  543.                             {% if ( i > currentPage + nearbyPagesLimit ) %}
  544.                                 <span class="sep-dots_prev_{{ i }} hide">...</span>
  545.                                 <li class=" links_{{ i }}" value="{{ i }}" onclick=" activeLink({{ i }})">{{ i }}</li>
  546.                             {% endif %}
  547.                                 {% endfor %}
  548.                                 <li class=" links" onclick="nextBtn()"><i class="fas fa-chevron-right"></i></li>
  549.                             {% elseif showAlwaysFirstAndLast %}
  550.                                 <li class=" links" onclick="nextBtn()"><i class="fas fa-chevron-right"></i></li>
  551.                             {% endif %}
  552.                         </ul>
  553.                     {% endif %}
  554.             </div>
  555.         </div>
  556.     </div>
  557.   </div>
  558. {% endblock %}
  559.   {% block javascripts %}
  560.       {{ parent() }}
  561.       <script src="{{ asset('js/home.func.js') }}"></script>
  562.       <script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
  563.       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
  564.       <script type="text/javascript">
  565.           var currentStartDate="{{ startDate }}";
  566.           var currentEndDate="{{ endDate }}";
  567.           var currentChild="{{ child }}";
  568.           var currentAdult="{{ adult }}";
  569.           function updateChild(type) {
  570.               currentChild= $("#child_"+type).val()
  571.           }
  572.           function updateAdult(type) {
  573.               currentAdult= $("#adult_"+type).val()
  574.           }
  575.           function updateEndDate(type) {
  576.               currentEndDate= $("#endDate_"+type).val()
  577.           }
  578.           function updateStartDate(type) {
  579.               currentStartDate= $("#startDate_"+type).val()
  580.             }
  581.           
  582.           function gotToBook(building) {
  583.               let timerInterval
  584.               var isvalid_currentStartDate= moment(currentStartDate, 'DD/MM/YYYY',true).isValid();
  585.               var isvalid_currentEndDate= moment(currentEndDate, 'DD/MM/YYYY',true).isValid();
  586.               if(currentStartDate==="" && currentEndDate==="" ){
  587.                   var currentDate=moment().format('DD/MM/YYYY');
  588.                   var currentDatePlus=moment(). add(1, 'days').format('DD/MM/YYYY');
  589.                   Swal.mixin({
  590.                       imageUrl: '{{ asset('img/calendar-cancel.svg') }}',
  591.                       imageHeight: 60,
  592.                       imageAlt: 'Date not choose',
  593.                       allowOutsideClick: false,
  594.                       allowEscapeKey: false,
  595.                       reverseButtons: true,
  596.                       confirmButtonText:
  597.                           '{% trans %}Suivant{% endtrans %} <i class="fa fa-arrow-right"></i>',
  598.                       showCancelButton: true,
  599.                       progressSteps: ['A','D'],
  600.                       cancelButtonText:
  601.                           '<i class="fa fa-trash"></i> Annuler',
  602.                       cancelButtonAriaLabel: '{% trans %}Annuler{% endtrans %}'
  603.                   }).
  604.                   queue([
  605.                       {
  606.                           title: '{% trans %}Date d\'arrivée {% endtrans %}',
  607.                           text: 'Enter a valid date like ('+currentDate+')',
  608.                           inputPlaceholder: currentDate,
  609.                           input: 'text',
  610.                           inputValue: currentDate,
  611.                           inputValidator: (result) => {
  612.                               var now = moment(moment().format('DD/MM/YYYY'), 'DD/MM/YYYY');
  613.                               var provideDate = moment(result, 'DD/MM/YYYY');
  614.                               var isValid= moment(result, 'DD/MM/YYYY',true).isValid();
  615.                               var isSame = provideDate.isSame(now);
  616.                               var isafter = provideDate.isAfter(now);
  617.                               console.log("provideDate 1",provideDate.format('DD/MM/YYYY'));
  618.                               console.log("DAY 1",now.format('DD/MM/YYYY'));
  619.                               console.log("isafter 1",isafter);
  620.                               console.log("isSame 1",isSame);
  621.                               currentStartDate=result;
  622.                               if(!isValid){
  623.                                   return 'Invalid date format should be DD/MM/YYYY'
  624.                               }
  625.                               if(isSame==false && isafter==false){
  626.                                   return 'Invalid arrival date, It shall far from this day'
  627.                               }
  628.                           }
  629.                       },
  630.                       {
  631.                           title: '{% trans %}Date de retour {% endtrans %}',
  632.                           text: 'Enter a valid date like ('+currentDatePlus+')',
  633.                           inputPlaceholder: currentDatePlus,
  634.                           input: 'text',
  635.                           inputValue: currentDatePlus,
  636.                           inputValidator: (result) => {
  637.                               var mEnd = moment(result,"DD/MM/YYYY");
  638.                               var isValid= moment(result, 'DD/MM/YYYY',true).isValid();
  639.                               console.log("isvalid",isValid)
  640.                               console.log("currentStartDate",currentStartDate)
  641.                               if(!isValid){
  642.                                   return 'Invalid date format should be DD/MM/YYYY'
  643.                               }
  644.                               if(!mEnd.isAfter(currentStartDate)){
  645.                                   return 'Invalid Arrival date, it is far from departure date'
  646.                               }
  647.                           }
  648.                       },
  649.                   ]).then((result) => {
  650.                       if (result.value) {
  651.                           console.log(result);
  652.                           if(result.value[0]!==undefined){
  653.                               currentStartDate=result.value[0];
  654.                           }
  655.                           if(result.value[1]!==undefined){
  656.                               currentEndDate=result.value[1];
  657.                           }
  658.                           gotToBook(building);
  659.                       }
  660.                   });
  661.                   return;
  662.               }else
  663.               if(currentStartDate==="" || !isvalid_currentStartDate || currentStartDate===undefined){
  664.                   var currentDatePlus=moment( ).format('DD/MM/YYYY');
  665.                   Swal.mixin({
  666.                       imageUrl: '{{ asset('img/calendar-cancel.svg') }}',
  667.                       imageHeight: 60,
  668.                       imageAlt: 'Date not choosed',
  669.                       allowOutsideClick: false,
  670.                       allowEscapeKey: false,
  671.                       reverseButtons: true,
  672.                       confirmButtonText:
  673.                           '{% trans %}Suivant{% endtrans %} <i class="fa fa-arrow-right"></i>',
  674.                       showCancelButton: true,
  675.                       progressSteps: ['1'],
  676.                       cancelButtonText:
  677.                           '<i class="fa fa-trash"></i> Annuler',
  678.                       cancelButtonAriaLabel: '{% trans %}Annuler{% endtrans %}'
  679.                   }).
  680.                   queue([
  681.                       {
  682.                           title: '{% trans %}Date d\'arrivée {% endtrans %}',
  683.                           text: 'Enter a valid date like ('+currentDatePlus+')',
  684.                           inputPlaceholder: currentDatePlus,
  685.                           input: 'text',
  686.                           inputValue:currentDatePlus,
  687.                           inputValidator: (result) => {
  688.                               var provideDate = moment(result);
  689.                                var isValid= moment(result, 'DD/MM/YYYY',true).isValid();
  690.                               var isSame = provideDate.isSame(moment().format('DD/MM/YYYY'));
  691.                               var isafter = provideDate.isAfter(moment().format('DD/MM/YYYY'));
  692.                               console.log("isvalid 2",isValid)
  693.                               console.log("isafter 2",isafter)
  694.                               if(!isValid){
  695.                                   return 'Invalid date format should be DD/MM/YYYY'
  696.                               }
  697.                               if(isafter==false && isSame==false ){
  698.                                   currentStartDate="";
  699.                                   return 'Invalid arrival date, It shall far from this day'
  700.                               }
  701.                           }
  702.                       },
  703.                   ]).then((result) => {
  704.                       if (result.value) {
  705.                           console.log(result);
  706.                           if(result.value[0]!==undefined){
  707.                               currentStartDate=result.value[0];
  708.                           }
  709.                           gotToBook(building);
  710.                       }
  711.                   });
  712.                   $(".swal2-input").css("max-width","100%")
  713.                   return
  714.               }
  715.               else if(currentEndDate==="" || !isvalid_currentEndDate || currentEndDate===undefined ){
  716.                   var currentDatePlus=moment(currentStartDate, 'DD/MM/YYYY',true). add(1, 'days').format('DD/MM/YYYY');
  717.                   Swal.mixin({
  718.                       imageUrl: '{{ asset('img/calendar-cancel.svg') }}',
  719.                       imageHeight: 60,
  720.                       imageAlt: 'Date not choose',
  721.                       allowOutsideClick: false,
  722.                       allowEscapeKey: false,
  723.                       reverseButtons: true,
  724.                       confirmButtonText:
  725.                           '{% trans %}Suivant{% endtrans %} <i class="fa fa-arrow-right"></i>',
  726.                       showCancelButton: true,
  727.                       progressSteps: ['1'],
  728.                       cancelButtonText:
  729.                           '<i class="fa fa-trash"></i> Annuler',
  730.                       cancelButtonAriaLabel: '{% trans %}Annuler{% endtrans %}'
  731.                   }).
  732.                   queue([
  733.                       {
  734.                           title: '{% trans %}Date de retour {% endtrans %}',
  735.                           text: 'Enter a valid date like ('+currentDatePlus+')',
  736.                           inputValue: currentDatePlus,
  737.                           inputPlaceholder: currentDatePlus,
  738.                           input: 'text',
  739.                           inputValidator: (result) => {
  740.                               var mEnd = moment(result , "DD/MM/YYYY");
  741.                               var isvalid= moment(result, 'DD/MM/YYYY',true).isValid();
  742.                               var isafter = mEnd.isAfter(moment(currentStartDate , "DD/MM/YYYY"));
  743.                               console.log("currentStartDate 3", currentStartDate)
  744.                               console.log("currentEndDate 3", result)
  745.                               console.log("isAfter", mEnd.isAfter(moment(currentStartDate , "DD/MM/YYYY")))
  746.                               if(!isvalid){
  747.                                   return 'Invalid date format should be DD/MM/YYYY'
  748.                               }
  749.                               if(!isafter){
  750.                                   currentStartDate="";
  751.                                   return 'Arrival date is far from departure date'
  752.                               }
  753.                           }
  754.                       },
  755.                   ]).then((result) => {
  756.                       if (result.value) {
  757.                           console.log(result);
  758.                           if(result.value[0]!==undefined){
  759.                               currentEndDate=result.value[0];
  760.                           }
  761.                           gotToBook(building)
  762.                       }
  763.                   });
  764.                   $(".swal2-input").css("max-width","100%")
  765.                   return;
  766.               }
  767.              else if(currentAdult===""){
  768.                   Swal.mixin({
  769.                       imageUrl: '{{ asset('img/adults-icon-5.jpg') }}',
  770.                       imageHeight: 60,
  771.                       imageAlt: 'Adult not provide',
  772.                       allowOutsideClick: false,
  773.                       allowEscapeKey: false,
  774.                       reverseButtons: true,
  775.                       confirmButtonText:
  776.                           '{% trans %}Suivant{% endtrans %} <i class="fa fa-arrow-right"></i>',
  777.                       showCancelButton: true,
  778.                       progressSteps: ['1'],
  779.                       cancelButtonText:
  780.                           '<i class="fa fa-trash"></i> Annuler',
  781.                       cancelButtonAriaLabel: '{% trans %}Annuler{% endtrans %}'
  782.                   }).
  783.                   queue([
  784.                       {
  785.                           title: '{% trans %}Nombre d\'aldute {% endtrans %}',
  786.                           text: 'Combien d\'adulte pour cette location?',
  787.                           inputValue: "01",
  788.                           inputPlaceholder: '01',
  789.                           input: 'number',
  790.                           inputValidator: (result) => {
  791.                               if(result===""){
  792.                                   return "empty field";
  793.                               }
  794.                               if(parseInt(result)<1){
  795.                                   return 'invalid number';
  796.                               }
  797.                           }
  798.                       },
  799.                   ]).then((result) => {
  800.                       if (result.value) {
  801.                           console.log(result);
  802.                               currentAdult=result.value[0]
  803.                           gotToBook(building)
  804.                       }
  805.                   });
  806.                   $(".swal2-input").css("max-width","100%")
  807.                   return
  808.               }
  809.              else if(currentChild===""){
  810.                   Swal.mixin({
  811.                       imageUrl: '{{ asset('img/children-icon-green.png') }}',
  812.                       imageHeight: 60,
  813.                       imageAlt: 'Child not provide',
  814.                       allowOutsideClick: false,
  815.                       allowEscapeKey: false,
  816.                       reverseButtons: true,
  817.                       confirmButtonText:
  818.                           '{% trans %}Suivant{% endtrans %} <i class="fa fa-arrow-right"></i>',
  819.                       showCancelButton: true,
  820.                       progressSteps: ['1'],
  821.                       cancelButtonText:
  822.                           '<i class="fa fa-trash"></i> Annuler',
  823.                       cancelButtonAriaLabel: '{% trans %}Annuler{% endtrans %}'
  824.                   }).
  825.                   queue([
  826.                       {
  827.                           title: '{% trans %}Nombre d\'enfants {% endtrans %}',
  828.                           text: 'Combien d\'enfants pour cette location?',
  829.                           inputValue: "0",
  830.                           inputPlaceholder: '01',
  831.                           input: 'number',
  832.                           inputValidator: (result) => {
  833.                               if(result===""){
  834.                                   return "empty field";
  835.                               }
  836.                               if(parseInt(result)<0){
  837.                                   return 'invalid number';
  838.                               }
  839.                           }
  840.                       },
  841.                   ]).then((result) => {
  842.                       if (result.value) {
  843.                           console.log(result);
  844.                               currentChild=result.value[0]
  845.                           gotToBook(building)
  846.                       }
  847.                   });
  848.                   $(".swal2-input").css("max-width","100%")
  849.                   return
  850.               }
  851.               $("#building_loading_"+building).removeClass("hide");
  852.               setTimeout(function () {
  853.                   window.location.assign("{{ path('app_building_navigation')}}"+"?building="+building+"&startDate="+currentStartDate+" 12:00&endDate="+currentEndDate+"12:00&adult="+currentAdult+"&child="+currentChild);
  854.               }, 2000);
  855.           }
  856.           function formatNumber(number)
  857.           {
  858.               number = number.toFixed(2) + '';
  859.               x = number.split('.');
  860.               x1 = x[0];
  861.               x2 = x.length > 1 ? ',' + x[1] : '';
  862.               var rgx = /(\d+)(\d{3})/;
  863.               while (rgx.test(x1)) {
  864.                   x1 = x1.replace(rgx, '$1' + '.' + '$2');
  865.               }
  866.               return x1 + x2;
  867.           }
  868.           var  link=document.getElementsByClassName("links");
  869.           var currentValue=1,i=0, lastPage={{ result|length  }}/{{ showItem }} + {{ result|length }}%{{ showItem }};
  870.           $("#maxAmount").addClass("active");
  871.           var amount= parseInt($("#maxAmount").val());
  872.           $("#displayAmount").html("Coût Max Pour une Nuité <br>"+formatNumber(amount))
  873.           function displayAmount() {
  874.               var amount= parseInt($("#maxAmount").val());
  875.               $("#displayAmount").html("Coût Max Pour une Nuité<br> "+formatNumber(amount))
  876.           }
  877.           var star=0;
  878.           function notority(index) {
  879.               var i=1;
  880.               for(i=1; i<=index; i++){
  881.                   $("#star_"+i).css("color","gold")
  882.               }
  883.               for(i=index+1; i<=6; i++){
  884.                   $("#star_"+i).css("color","palegoldenrod")
  885.               }
  886.           }
  887.           function notorityShoose(index) {
  888.               star=index;
  889.               var i=1;
  890.               for(i=1; i<=index; i++){
  891.                   $("#star_"+i).css("color","gold")
  892.               }
  893.               for(i=index+1; i<=6; i++){
  894.                   $("#star_"+i).css("color","palegoldenrod")
  895.               }
  896.           }
  897.           function unCheckNotority() {
  898.               if(star!==0){
  899.                   for(i=1; i<=star; i++){
  900.                       $("#star_"+i).css("color","gold")
  901.                   }
  902.               }else{
  903.                   for(i=1; i<=6; i++){
  904.                       $("#star_"+i).css("color","palegoldenrod")
  905.                   }
  906.               }
  907.           }
  908.           $("#building_slide_1").removeClass("hide");
  909.           $('.autoplayPack_1').slick({
  910.               slidesToShow: 1,
  911.               slidesToScroll: 1,
  912.               autoplay: true,
  913.               autoplaySpeed: 10000,
  914.               responsive: [
  915.                   {
  916.                       breakpoint: 1024,
  917.                       settings: {
  918.                           slidesToShow: 1,
  919.                           slidesToScroll: 1,
  920.                           infinite: true,
  921.                           dots: true
  922.                       }
  923.                   },
  924.                   {
  925.                       breakpoint: 600,
  926.                       settings: {
  927.                           slidesToShow: 1,
  928.                           slidesToScroll: 1
  929.                       }
  930.                   },
  931.                   {
  932.                       breakpoint: 480,
  933.                       settings: {
  934.                           slidesToShow: 1,
  935.                           slidesToScroll: 1
  936.                       }
  937.                   }
  938.               ]
  939.           });
  940.           function activeLink(index) {
  941.               for (i =1; i<=lastPage; i++){
  942.                   $(".links_"+i).removeClass("active");
  943.                   $("#building_slide_"+i).addClass("hide");
  944.               }
  945.               $("#building_slide_"+index).removeClass("hide");
  946.               $(".links_"+index).addClass("active")
  947.               currentValue=$(".links_"+index).val();
  948.               console.log(currentValue);
  949.               $('.autoplayPack_'+(index)).slick({
  950.                   slidesToShow: 1,
  951.                   slidesToScroll: 1,
  952.                   autoplay: true,
  953.                   autoplaySpeed: 10000,
  954.                   responsive: [
  955.                       {
  956.                           breakpoint: 1024,
  957.                           settings: {
  958.                               slidesToShow: 1,
  959.                               slidesToScroll: 1,
  960.                               infinite: true,
  961.                               dots: true
  962.                           }
  963.                       },
  964.                       {
  965.                           breakpoint: 600,
  966.                           settings: {
  967.                               slidesToShow: 1,
  968.                               slidesToScroll: 1
  969.                           }
  970.                       },
  971.                       {
  972.                           breakpoint: 480,
  973.                           settings: {
  974.                               slidesToShow: 1,
  975.                               slidesToScroll: 1
  976.                           }
  977.                       }
  978.                   ]
  979.               });
  980.                   $(".links_"+(currentValue-1)).removeClass("hide");
  981.                   $(".links_"+(currentValue+1)).removeClass("hide");
  982.           }
  983.           function backBtn() {
  984.               if(currentValue>1){
  985.                   for (i =1; i<=lastPage; i++){
  986.                       $(".links_"+i).removeClass("active");
  987.                       $("#building_slide_"+i).addClass("hide");
  988.                   }
  989.                   $(".links_"+(currentValue-1)).addClass("active").removeClass("hide")
  990.                   $("#building_slide_"+currentValue-1).removeClass("hide");
  991.                   $('.autoplayPack_'+(currentValue-1)).slick({
  992.                       slidesToShow: 1,
  993.                       slidesToScroll: 1,
  994.                       autoplay: true,
  995.                       autoplaySpeed: 10000,
  996.                       responsive: [
  997.                           {
  998.                               breakpoint: 1024,
  999.                               settings: {
  1000.                                   slidesToShow: 1,
  1001.                                   slidesToScroll: 1,
  1002.                                   infinite: true,
  1003.                                   dots: true
  1004.                               }
  1005.                           },
  1006.                           {
  1007.                               breakpoint: 600,
  1008.                               settings: {
  1009.                                   slidesToShow: 1,
  1010.                                   slidesToScroll: 1
  1011.                               }
  1012.                           },
  1013.                           {
  1014.                               breakpoint: 480,
  1015.                               settings: {
  1016.                                   slidesToShow: 1,
  1017.                                   slidesToScroll: 1
  1018.                               }
  1019.                           }
  1020.                       ]
  1021.                   });
  1022.                   if(lastPage-currentValue>5){
  1023.                       $(".links_"+(currentValue-2)).removeClass("hide");
  1024.                     if(lastPage-currentValue>=10){
  1025.                         $(".links_"+(currentValue+6)).addClass("hide");
  1026.                     }
  1027.                   }
  1028.                   if(currentValue>6){
  1029.                       $(".dots_prev_"+(currentValue+1)).addClass("hide");
  1030.                       $(".dots_prev_"+(currentValue-1)).removeClass("hide");
  1031.                   }
  1032.                   if(lastPage-currentValue>6){
  1033.                       $(".sep-dots_start").addClass("hide");
  1034.                       $(".sep-dots_middle").removeClass("hide");
  1035.                       $(".dots_prev_"+(currentValue+1)).addClass("hide");
  1036.                   }
  1037.                   currentValue--;
  1038.               }
  1039.           }
  1040.           function nextBtn() {
  1041.               if(currentValue<lastPage){
  1042.                   for (i =1; i<=lastPage; i++){
  1043.                       $(".links_"+i).removeClass("active");
  1044.                       $("#building_slide_"+i).addClass("hide");
  1045.                   }
  1046.                   $(".links_"+(currentValue+1)).addClass("active");
  1047.                   $("#building_slide_"+(currentValue+1)).removeClass("hide");
  1048.                   $('.autoplayPack_'+(currentValue+1)).slick({
  1049.                       slidesToShow: 1,
  1050.                       slidesToScroll: 1,
  1051.                       autoplay: true,
  1052.                       autoplaySpeed: 10000,
  1053.                       responsive: [
  1054.                           {
  1055.                               breakpoint: 1024,
  1056.                               settings: {
  1057.                                   slidesToShow: 1,
  1058.                                   slidesToScroll: 1,
  1059.                                   infinite: true,
  1060.                                   dots: true
  1061.                               }
  1062.                           },
  1063.                           {
  1064.                               breakpoint: 600,
  1065.                               settings: {
  1066.                                   slidesToShow: 1,
  1067.                                   slidesToScroll: 1
  1068.                               }
  1069.                           },
  1070.                           {
  1071.                               breakpoint: 480,
  1072.                               settings: {
  1073.                                   slidesToShow: 1,
  1074.                                   slidesToScroll: 1
  1075.                               }
  1076.                           }
  1077.                       ]
  1078.                   });
  1079.                   if(currentValue>5){
  1080.                       if(lastPage-currentValue>=10){
  1081.                   $(".links_"+(currentValue-6)).addClass("hide");}
  1082.                   $(".links_"+(currentValue+1)).removeClass("hide");
  1083.                   }
  1084.                   if(lastPage-currentValue<=6){
  1085.                       $(".sep-dots_middle").addClass("hide");
  1086.                       $(".sep-dots_start").removeClass("hide");
  1087.                   }
  1088.                   currentValue++;
  1089.                   console.log(currentValue);
  1090.               }
  1091.           }
  1092.           
  1093.           $(function() {
  1094.               var startDay = moment().format('MM/YYYY/DD');
  1095.               $('input[name="datetimes"]').daterangepicker({
  1096.                   timePicker: true,
  1097.                   startDate: moment().startOf('hour'),
  1098.                   endDate: moment().startOf('hour').add(32, 'hour'),
  1099.                   locale: {
  1100.                       format: 'M/DD hh:mm A'
  1101.                   },
  1102.                   minDate:  startDay,
  1103.                   minYear:  parseInt(moment().format('YYYY'),0),
  1104.                   maxYear: parseInt(moment().format('YYYY'),10)
  1105.               });
  1106.           });
  1107.           $(document).ready(function() {
  1108.               $('.js-example-basic-single').select2();
  1109.               $('.materialboxed').materialbox();
  1110.               $('.datepicker').pickadate({
  1111.                   selectMonths: true, // Creates a dropdown to control month
  1112.                   selectYears: 15, // Creates a dropdown of 15 years to control year,
  1113.                   today: 'Today',
  1114.                   clear: 'Clear',
  1115.                   close: 'Ok',
  1116.                   closeOnSelect: false, // Close upon selecting a date,
  1117.                   container: undefined, // ex. 'body' will append picker to body
  1118.               });
  1119.               $('.modal').modal({
  1120.                       dismissible: true, // Modal can be dismissed by clicking outside of the modal
  1121.                       opacity: .4, // Opacity of modal background
  1122.                       inDuration: 300, // Transition in duration
  1123.                       outDuration: 200, // Transition out duration
  1124.                       startingTop: '4%', // Starting top style attribute
  1125.                       endingTop: '15%', // Ending top style attribute
  1126.                       ready: function(modal, trigger) { // Callback for Modal open. Modal and trigger parameters available.
  1127.                       },
  1128.                       complete: function() {
  1129.                       } // Callback for Modal close
  1130.                   }
  1131.               );
  1132.               $('.autoplayTestimony').slick({
  1133.                   slidesToShow: 3,
  1134.                   slidesToScroll: 1,
  1135.                   autoplay: true,
  1136.                   autoplaySpeed: 2000,
  1137.                   responsive: [
  1138.                       {
  1139.                           breakpoint: 2024,
  1140.                           settings: {
  1141.                               slidesToShow: 4,
  1142.                               slidesToScroll: 4,
  1143.                               infinite: true,
  1144.                               dots: true
  1145.                           }
  1146.                       },
  1147.                       {
  1148.                           breakpoint: 1424,
  1149.                           settings: {
  1150.                               slidesToShow: 3,
  1151.                               slidesToScroll: 3,
  1152.                               infinite: true,
  1153.                               dots: true
  1154.                           }
  1155.                       },
  1156.                       {
  1157.                           breakpoint: 900,
  1158.                           settings: {
  1159.                               slidesToShow: 2,
  1160.                               slidesToScroll: 2
  1161.                           }
  1162.                       },
  1163.                       {
  1164.                           breakpoint: 480,
  1165.                           settings: {
  1166.                               slidesToShow: 1,
  1167.                               slidesToScroll: 1
  1168.                           }
  1169.                       }
  1170.                   ]
  1171.               })
  1172.               $('.autoplayPack').slick({
  1173.                   slidesToShow: 1,
  1174.                   slidesToScroll: 1,
  1175.                   autoplay: true,
  1176.                   autoplaySpeed: 10000,
  1177.                   responsive: [
  1178.                       {
  1179.                           breakpoint: 1024,
  1180.                           settings: {
  1181.                               slidesToShow: 1,
  1182.                               slidesToScroll: 1,
  1183.                               infinite: true,
  1184.                               dots: true
  1185.                           }
  1186.                       },
  1187.                       {
  1188.                           breakpoint: 600,
  1189.                           settings: {
  1190.                               slidesToShow: 1,
  1191.                               slidesToScroll: 1
  1192.                           }
  1193.                       },
  1194.                       {
  1195.                           breakpoint: 480,
  1196.                           settings: {
  1197.                               slidesToShow: 1,
  1198.                               slidesToScroll: 1
  1199.                           }
  1200.                       }
  1201.                   ]
  1202.               });
  1203.               $('.autoplayPack').slick({
  1204.                   slidesToShow: 1,
  1205.                   slidesToScroll: 1,
  1206.                   autoplay: true,
  1207.                   autoplaySpeed: 10000,
  1208.                   responsive: [
  1209.                       {
  1210.                           breakpoint: 1024,
  1211.                           settings: {
  1212.                               slidesToShow: 1,
  1213.                               slidesToScroll: 1,
  1214.                               infinite: true,
  1215.                               dots: true
  1216.                           }
  1217.                       },
  1218.                       {
  1219.                           breakpoint: 600,
  1220.                           settings: {
  1221.                               slidesToShow: 1,
  1222.                               slidesToScroll: 1
  1223.                           }
  1224.                       },
  1225.                       {
  1226.                           breakpoint: 480,
  1227.                           settings: {
  1228.                               slidesToShow: 1,
  1229.                               slidesToScroll: 1
  1230.                           }
  1231.                       }
  1232.                   ]
  1233.               });
  1234.               $('.autoplayBestProd').slick({
  1235.                   slidesToShow: 2,
  1236.                   slidesToScroll: 2,
  1237.                   autoplay: true,
  1238.                   autoplaySpeed: 2000,
  1239.                   responsive: [
  1240.                       {
  1241.                           breakpoint: 1024,
  1242.                           settings: {
  1243.                               slidesToShow: 2,
  1244.                               slidesToScroll: 2,
  1245.                               infinite: true,
  1246.                               dots: true
  1247.                           }
  1248.                       },
  1249.                       {
  1250.                           breakpoint: 600,
  1251.                           settings: {
  1252.                               slidesToShow: 1,
  1253.                               slidesToScroll: 1
  1254.                           }
  1255.                       },
  1256.                       {
  1257.                           breakpoint: 480,
  1258.                           settings: {
  1259.                               slidesToShow: 1,
  1260.                               slidesToScroll: 1
  1261.                           }
  1262.                       }
  1263.                   ]
  1264.               });
  1265.           });
  1266.           var apiBaseUrl="{{ host }}"
  1267.           var loginUrl="{{ path('authentication_token') }}";
  1268.           getClientLocation ();
  1269.           function submitComment() {
  1270.               setTimeout(function () {
  1271.                   Swal.mixin({
  1272.                       imageUrl: '{{ asset('img/logo-logercm.png') }}',
  1273.                       imageHeight: 60,
  1274.                       background: '#fff url({{ asset('img/trees.png') }})',
  1275.                       imageAlt: 'Logo {{ companyName }}',
  1276.                       allowOutsideClick: false,
  1277.                       allowEscapeKey: false,
  1278.                       reverseButtons: true,
  1279.                       confirmButtonText:
  1280.                           '{% trans %}Suivant{% endtrans %} <i class="fa fa-arrow-right"></i>',
  1281.                       showCancelButton: true,
  1282.                       progressSteps: ['1', '2', '3','4','5'],
  1283.                       cancelButtonText:
  1284.                           '<i class="fa fa-trash"></i> Annuler',
  1285.                       cancelButtonAriaLabel: '{% trans %}Annuler{% endtrans %}'
  1286.                   }).
  1287.                   queue([
  1288.                       {
  1289.                           title: '{% trans %}Laissez-nous un témoignage{% endtrans %}',
  1290.                           text: '{% trans %}Votre Nom{% endtrans %}:',
  1291.                           inputPlaceholder: 'John Doe.',
  1292.                           input: 'text',
  1293.                           inputValidator: (result) => {
  1294.                               return !result && '{% trans %}Vous devez indiquer votre nom {% endtrans %}'
  1295.                           }
  1296.                       },
  1297.                       {
  1298.                           title: '{% trans %}Laissez-nous un témoignage{% endtrans %}',
  1299.                           text: '{% trans %}Votre contact{% endtrans %}:',
  1300.                           inputPlaceholder: '23760000000.',
  1301.                           input: 'text',
  1302.                           inputValidator: (result) => {
  1303.                               return !result && '{% trans %}Vous devez indiquer votre contact{% endtrans %}'
  1304.                           }
  1305.                       },
  1306.                       {
  1307.                           title: "{% trans %}Que pensez des produits et services biocarrylife?{% endtrans %}",
  1308.                           text: '{% trans %}Un petit commentaire{% endtrans %}',
  1309.                           inputAttributes: {
  1310.                               'maxlength': 1255,
  1311.                           },
  1312.                           inputPlaceholder: '{% trans %}Je suis satisfait des produits biocarrylife{% endtrans %}.',
  1313.                           input: 'textarea',
  1314.                           inputValidator: (result) => {
  1315.                               return !result && '{% trans %}Vous avez oublié votre appréciation{% endtrans %}.'
  1316.                           }
  1317.                       },
  1318.                       {
  1319.                           title: '{% trans %}Sur une echelle de 1 à 10 quelle est votre note?{% endtrans %}',
  1320.                           text: '{% trans %}Votre note{% endtrans %}:',
  1321.                           input: 'number',
  1322.                           inputPlaceholder: '5',
  1323.                           inputAttributes: {
  1324.                               min: 0,
  1325.                               max: 10
  1326.                           },
  1327.                           inputValidator: (value) => {
  1328.                               if (!value) {
  1329.                                   return '{% trans %}Ce champ est obligatoire{% endtrans %}!'
  1330.                               }
  1331.                               if(parseInt(value)<0 || parseInt(value)>10){
  1332.                                   return '{% trans %}Votre note doit être comprise entre 1 et 10{% endtrans %}!'
  1333.                               }
  1334.                           }
  1335.                       },
  1336.                       {
  1337.                           title: "{% trans %}Nous avons besoin d'une jolie photo de vous{% endtrans %}?",
  1338.                           text: '{% trans %}Cliquez ici pour charger une photo{% endtrans %}:',
  1339.                           input: 'file',
  1340.                           inputAttributes: {
  1341.                               'accept': 'image/*',
  1342.                               'aria-label': 'Upload your profile picture'
  1343.                           },
  1344.                       }
  1345.                   ]).then((result) => {
  1346.                       if (result.value) {
  1347.                           var form = new FormData();
  1348.                           form.append("file",  result.value[4]);
  1349.                           console.log(form);
  1350.                           var settings = {
  1351.                               "url": apiBaseUrl+"media_objects",
  1352.                               "method": "POST",
  1353.                               "timeout": 0,
  1354.                               "headers": {
  1355.                                   "Accept": "application/json",
  1356.                                   "Authorization": "Bearer "+ getCookie("{{ companyName }}_user_token")
  1357.                               },
  1358.                               "processData": false,
  1359.                               "mimeType": "multipart/form-data",
  1360.                               "contentType": false,
  1361.                               "data": form
  1362.                           };
  1363.                           $.ajax(settings).done(function (response) {
  1364.                               console.log(response);
  1365.                               var picture=JSON.parse(response);
  1366.                               $.ajax({
  1367.                                   method: "POST",
  1368.                                   tryCount  : 0,
  1369.                                   retryLimit  : 4,
  1370.                                   "url": apiBaseUrl+"testimonies",
  1371.                                   "headers": {
  1372.                                       "Content-Type":  "application/json",
  1373.                                       "Authorization": "Bearer "+ getCookie("{{ companyName }}_user_token")
  1374.                                   },
  1375.                                   data: JSON.stringify({
  1376.                                       "picture": apiBaseUrl+"media_objects/"+picture.id,
  1377.                                       "client": result.value[0],
  1378.                                       "message": result.value[2],
  1379.                                       "contact": result.value[1],
  1380.                                       "appreciation": parseInt(result.value[3]),
  1381.                                       "approved": false }),
  1382.                                   beforeSend:function () {
  1383.                                   },
  1384.                                   success: function(data){
  1385.                                       console.log(data);
  1386.                                       Swal.fire(
  1387.                                           '{% trans %}Super{% endtrans %}!',
  1388.                                           '{% trans %}Votre témoignage à été pris en compte{% endtrans %}!',
  1389.                                           'success'
  1390.                                       )
  1391.                                   },
  1392.                                   error:function (xhr, textStatus, errorThrown) {
  1393.                                   }
  1394.                               });
  1395.                           });
  1396.                       }
  1397.                   });
  1398.                   $(".swal2-input").css("max-width","100%")
  1399.               },500)
  1400.           }
  1401.           function getClientLocation () {
  1402.               var locationUrl="{{ path('client_location') }}";
  1403.               $.ajax({
  1404.                   method: "GET",
  1405.                   tryCount  : 0,
  1406.                   retryLimit  : 4,
  1407.                   url: "https://api.ipify.org?format=json",
  1408.                   "headers": {
  1409.                       "Content-Type": "application/json"
  1410.                   },
  1411.                   beforeSend:function () {
  1412.                   },
  1413.                   success: function(data){
  1414.                       console.log(data);
  1415.                       var api_address=data.ip;
  1416.                       $.ajax({
  1417.                           method: "POST",
  1418.                           tryCount  : 0,
  1419.                           retryLimit  : 4,
  1420.                           url: host+locationUrl,
  1421.                           "headers": {
  1422.                               "Content-Type": "application/json"
  1423.                           },
  1424.                           data: JSON.stringify({
  1425.                               "api_address":api_address}),
  1426.                           beforeSend:function () {
  1427.                           },
  1428.                           success: function(data){
  1429.                               setCookie("visitor",data,20)
  1430.                               console.log(data);
  1431.                           },
  1432.                           error:function (xhr, textStatus, errorThrown) {
  1433.                               console.log(xhr);
  1434.                           }
  1435.                       });
  1436.                   },
  1437.                   error:function (xhr, textStatus, errorThrown) {
  1438.                   }
  1439.               });
  1440.           }
  1441.           function refreshToken() {
  1442.               $.ajax({
  1443.                   method: "POST",
  1444.                   tryCount  : 0,
  1445.                   retryLimit  : 4,
  1446.                   url: host+loginUrl,
  1447.                   "headers": {
  1448.                       "Content-Type": "application/json"
  1449.                   },
  1450.                   data: JSON.stringify({
  1451.                       "username":getCookie("{{ companyName }}_user_username"),
  1452.                       "password":getCookie("{{ companyName }}_user_userpass")}),
  1453.                   beforeSend:function () {
  1454.                   },
  1455.                   success: function(data){
  1456.                       setCookie("{{ companyName }}_user_token",data.token,1);
  1457.                   },
  1458.                   error:function (xhr, textStatus, errorThrown) {
  1459.                   }
  1460.               });
  1461.           }
  1462.           function findBuilding(buildingType, type) {
  1463.               var destinationTown=$("#destinationTown_"+buildingType).val();
  1464.               var startDate=currentStartDate;
  1465.               var endDate=currentEndDate;
  1466.               var adult=$("#adult_"+buildingType).val();
  1467.               var child=$("#child_"+buildingType).val();
  1468.               $.ajax({
  1469.                   method: "POST",
  1470.                   tryCount  : 0,
  1471.                   retryLimit  : 4,
  1472.                   url: "{{ path("find_buildings") }}",
  1473.                   "headers": {
  1474.                       "Content-Type": "application/json"
  1475.                   },
  1476.                   data: JSON.stringify({
  1477.                       "town":destinationTown ,
  1478.                       "buildType": buildingType,
  1479.                       "startedDate": startDate,
  1480.                       "endDate": endDate,
  1481.                   }),
  1482.                   beforeSend:function () {
  1483.                       //btn_text_/btn_loading_/btn_search_
  1484.                       const button = document.getElementById("btn_search_"+buildingType);
  1485. // Disable the button
  1486.                       button.disabled = true;
  1487.                       $("#btn_search_"+buildingType).addClass("disabled");
  1488.                       $("#btn_loading_"+buildingType).removeClass("hide");
  1489.                       $("#btn_text_"+buildingType).html("Patientez... ");
  1490.                   },
  1491.                   success: function(data){
  1492.                       const button = document.getElementById("btn_search_"+buildingType);
  1493. // Disable the button
  1494.                       button.disabled = false;
  1495.                       console.log(data);
  1496.                       if(data.length===0){
  1497.                           var Toast = Swal.mixin({
  1498.                               toast: true,
  1499.                               position: 'top-end',
  1500.                               showConfirmButton: false,
  1501.                               timer: 14000,
  1502.                               timerProgressBar: true,
  1503.                               didOpen: (toast) => {
  1504.                                   toast.addEventListener('mouseenter', Swal.stopTimer)
  1505.                                   toast.addEventListener('mouseleave', Swal.resumeTimer)
  1506.                               }
  1507.                           })
  1508.                           {% if type is not null %}
  1509.                           Toast.fire({
  1510.                               icon: 'warning',
  1511.                               title: 'Aucun (e) '+type+" trouvé(e)"
  1512.                           });
  1513.                           {% else %}
  1514.                           Toast.fire({
  1515.                               icon: 'warning',
  1516.                               title: "Aucune offre trouvée"
  1517.                           });
  1518.                           {% endif %}
  1519.                       }else{
  1520.                           window.location.assign("{{ onlinePath}}/building/detail?destination="+destinationTown+"&buildingType="+buildingType+"&startDate="+startDate+"&endDate="+endDate+"&child="+child+"&=adult="+adult);
  1521.                       }
  1522.                       $("#btn_search_"+buildingType).removeClass("disabled");
  1523.                       $("#btn_loading_"+buildingType).addClass("hide");
  1524.                       $("#btn_text_"+buildingType).html("Rechercher");
  1525.                   },
  1526.                   error:function (xhr, textStatus, errorThrown) {
  1527.                       const button = document.getElementById("btn_search_"+buildingType);
  1528. // Disable the button
  1529.                       button.disabled = false;
  1530.                       $("#btn_search_"+buildingType).removeClass("disabled");
  1531.                       $("#btn_loading_"+buildingType).addClass("hide");
  1532.                       $("#btn_text_"+buildingType).html("Rechercher");
  1533.                   }
  1534.               });
  1535.           }
  1536.           /*  E-commerce part   */
  1537.           function reduceItem(productId){
  1538.               var currentQuantity=parseInt($("#item_"+productId).val());
  1539.               if(currentQuantity>1){
  1540.                   document.getElementById("item_"+productId).value =  (currentQuantity-1);
  1541.               }
  1542.           }
  1543.           function adjustItem(productId, stock){
  1544.               var currentQuantity=parseInt($("#item_"+productId).val());
  1545.               if(currentQuantity<parseInt(stock)){
  1546.                   document.getElementById("item_"+productId).value =  (currentQuantity+1);
  1547.               }
  1548.           }
  1549.           const nodeList = document.querySelectorAll(".ml12");
  1550.           for (let i = 0; i < nodeList.length; i++) {
  1551.               nodeList[i].innerHTML = nodeList[i].textContent.replace(/\S/g, "<span class='letter'>$&</span>");
  1552.           }
  1553.           const nodeList13 = document.querySelectorAll(".ml13");
  1554.           for (let i = 0; i < nodeList13.length; i++) {
  1555.               nodeList13[i].innerHTML = nodeList13[i].textContent.replace(/\S/g, "<span class='letter'>$&</span>");
  1556.           }
  1557.           anime.timeline({loop: true})
  1558.               .add({
  1559.                   targets: '.ml12 .letter',
  1560.                   scale: [2,1],
  1561.                   opacity: [0,1],
  1562.                   translateZ: 0,
  1563.                   easing: "easeInExpo",
  1564.                   duration: 950,
  1565.                   delay: (el, i) => 70*i
  1566.               }).add({
  1567.               targets: '.ml12',
  1568.               opacity: 0,
  1569.               duration: 13000,
  1570.               easing: "easeInExpo",
  1571.               delay: 800
  1572.           });
  1573.           anime.timeline({loop: true})
  1574.               .add({
  1575.                   targets: '.ml13 .letter',
  1576.                   translateX: [40,0],
  1577.                   translateZ: 0,
  1578.                   opacity: [0,1],
  1579.                   easing: "easeOutExpo",
  1580.                   duration: 1200,
  1581.                   delay: (el, i) => 500 + 30 * i
  1582.               }).add({
  1583.               targets: '.ml13 .letter',
  1584.               translateX: [0,-30],
  1585.               opacity: [1,0],
  1586.               easing: "easeInExpo",
  1587.               duration: 10500,
  1588.               delay: (el, i) => 100 + 30 * i
  1589.           });
  1590.       </script>
  1591.   {% endblock %}