templates/front/theme1/base.html.twig line 98

Open in your IDE?
  1. <!doctype html>
  2. <html lang="{{ app.request.locale }}">
  3.     <head>
  4.         <meta charset="utf-8" />
  5.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.         <meta name="viewport" content="width=device-width, initial-scale=1">
  7.         {# <link rel="apple-touch-icon" sizes="60x60" href="{{asset('public/favicon/apple-touch-icon.png')}}">
  8.         <link rel="icon" type="image/png" sizes="32x32" href="{{asset('public/favicon/favicon-32x32.png')}}">
  9.         <link rel="icon" type="image/png" sizes="16x16" href="{{asset('public/favicon/favicon-16x16.png')}}"> #}
  10.         <link rel="icon" type="image/x-icon" href="{{ asset('public/favicon/favicon.ico') }}" />
  11.         {# <link rel="manifest" href="{{asset('public/favicon/site.webmanifest')}}"> #}
  12.         {{ leogout_seo() }} 
  13.         <link rel="preconnect" href="https://code.jquery.com" crossorigin>
  14.         <link rel="preconnect" href="https://apps.elfsight.com" crossorigin>
  15.         {# <link rel="preconnect" href="https://matomo.hrz.fr/" crossorigin> #}
  16.         
  17.         {# {% include 'front/preload_fonts.html.twig' %} #}
  18.         {# <link href="https://cdn.jsdelivr.net/npm/vanillajs-datepicker@1.1.4/dist/css/datepicker.min.css" rel="stylesheet"> #}
  19.   
  20.         
  21.         {% block metaTag %}
  22.                 {% if meta_robots is defined and meta_robots is not empty %}
  23.                         <meta name="robots" content="{{meta_robots}}">
  24.                     {% else %}
  25.                         <meta name="robots" content= "{% if ParametreSite().metaindex == 1 %}INDEX{% else %}NOINDEX{% endif %} , {% if ParametreSite().metafollow == 1 %}FOLLOW{% else %}NOFOLLOW{% endif %}"> 
  26.                 {% endif %}
  27.                 {% set currentPath = '/' %}
  28.                 {% if app.request.attributes.get('_route_params')['slug'] is defined and app.request.attributes.get('_route_params')['slug'] == 'home' %}
  29.                     <link href="{{app.request.schemeAndHttpHost}}" rel="canonical"/>
  30.                 {% else %}
  31.                     {% if canonical is defined and canonical != null  %}
  32.                         <link href="{{app.request.schemeAndHttpHost ~ canonical}}" rel="canonical"/>
  33.                     {% else %}
  34.                         <link href="{{app.request.uri}}" rel="canonical" />
  35.                     {% endif %} 
  36.                 {% endif %}
  37.              
  38.                 {# <link rel="alternate" hreflang="x-default" href="{{app.request.schemeAndHttpHost ~ currentPath}}" />  #}
  39.                 {# {% if ActifLanguage() %}
  40.                     {% for item in ActifLanguage() %}
  41.                         <link rel="alternate" hreflang="{{item.languagecode}}" href="{{app.request.schemeAndHttpHost ~ currentPath}}"/>
  42.                     {% endfor %}
  43.                 {% endif %} #}
  44.                 {% if custom_schemaOrg is defined and custom_schemaOrg != null  %}
  45.                     {{custom_schemaOrg|raw}}
  46.                 {% endif %}
  47.                 
  48.                 {% if schemaOrg is defined %}
  49.                      {{schemaOrg|replace({"\\": "/"})|replace({"//": "/"})|raw}}
  50.                 {% endif %}
  51.                 {% if schema_breadcrumb is defined %}
  52.                     {{schema_breadcrumb|replace({"\\": "/"})|replace({"//": "/"})|raw}}
  53.                 {% endif %}
  54.         {% endblock %}
  55.         {% if ParametreSite().googleverification and ParametreSite().googleverification is not empty %}
  56.                 <meta name="google-site-verification" content="{{ParametreSite().googleverification|raw}}" />
  57.         {% endif %}
  58.         {% if ParametreSite().codehead and ParametreSite().codehead is not empty %}
  59.             {{ParametreSite().codehead|raw}}
  60.         {% endif %}
  61.        
  62.         {% block preload %}{% endblock %}
  63.         {% block stylesheets %}
  64.         {#  {{ encore_entry_link_tags('app-theme') }} #}
  65.             <style>
  66.                 {{ source ('front/'~ app.request.server.get('APP_THEME') ~'/assets/css/_fonts.css')}}
  67.                 {{ source ('front/'~ app.request.server.get('APP_THEME') ~'/assets/css/_variables.min.css')}}
  68.                 {# {% include 'front/config_theme.html.twig' %} #}
  69.                 {% for file in encore_entry_css_files('app-theme') %}
  70.                     {{ source('@PUBLIC' ~ file) }}
  71.                 {% endfor %}
  72.                 {{ source ('front/'~ app.request.server.get('APP_THEME') ~'/assets/css/style.min.css')}}
  73.             </style>
  74.         {% endblock %}
  75.         
  76.     </head>
  77.     {% apply spaceless %}
  78.     <body {% if app.request.attributes.get('_route') is null %}class="page-404"{% endif %}>
  79.         {% if ParametreSite().codebody and ParametreSite().codebody is not empty %}
  80.             {{ParametreSite().codebody|raw}}
  81.         {% endif %}
  82.         {% block navbar %}
  83.             {% set className = app.request.attributes.get('_route') == 'index_page_home'?'home_page':'' %}
  84.             {{ render(controller('App\\Controller\\Front\\FunctionController::renderMenu',{'className': className })) }} 
  85.         {% endblock %}
  86.         <main class="{{app.request.attributes.get('_route') == 'index_page_home'?'home_page':''}} {{custom_class_page()!= null?custom_class_page():''}}">
  87.           {% block body %}{% endblock %} 
  88.         </main>
  89.         <a href="javascript:void(0);" class="scroll-to-top" title="{{ 'label.haut'|trans({} , 'textes' ) }}" style="display: none;"><span>{{ 'label.haut'|trans({} , 'textes' ) }}</span></a>
  90.         <div id="myOverlay" class="overlay">
  91.             <span class="closebtn" onclick="closeSearch()" title="Close Overlay">×</span>
  92.             <div class="overlay-content">
  93.                 <form action="{{path('page_search')}}" method="GET">
  94.                     <div class="position-relative w-100">
  95.                         <input type="text" placeholder="Rechercher..." name="search" class="resRecord" required>
  96.                         <div id="recButton" class="w-md waves-effect waves-light"><i class="fa fa-microphone"></i></div>
  97.                     </div>
  98.                    <button type="submit"><i class="fa fa-search"></i></button>
  99.                 </form>
  100.             </div>
  101.         </div>
  102.   
  103.         {{ render(controller('App\\Controller\\Front\\FunctionController::renderDefaultBloc')) }}
  104.         {% block footer %}
  105.             {{ render(controller('App\\Controller\\Front\\FunctionController::renderFooter',{ 'TypeMenu': 'Footer' })) }}
  106.         {% endblock %}
  107.         {% block javascripts %}
  108.             <script src="{{asset('templates/front/theme1/assets/js/jquery-3.6.0.min.js')}}" ></script>
  109.             <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js" async></script>
  110.             {# <script src="{{asset('templates/front/theme1/assets/plugins/wow-animate/js/wow.min.js')}}"></script> #}
  111.             {# <script src="{{asset('templates/front/theme1/assets/plugins/galerie-isotope-wow/js/isotope.pkgd.min.js')}}"></script> #}
  112.             <script src="{{asset('templates/front/theme1/assets/plugins/galerie-isotope-wow/js/plugins.js')}}"></script>
  113.             {# <script src="https://cdn.jsdelivr.net/npm/vanillajs-datepicker@1.1.4/dist/js/datepicker-full.min.js"></script>
  114.             <script src="https://cdn.jsdelivr.net/npm/vanillajs-datepicker@1.2.0/dist/js/locales/fr.js"></script> #}
  115.             {{ encore_entry_script_tags('app-theme') }} 
  116.     
  117.             <script>
  118.                     function openSearch() {
  119.                         document.getElementById("myOverlay").style.display = "block";
  120.                         setTimeout(function() {
  121.                             document.getElementById("myOverlay").style.opacity = "1";
  122.                         }, 2); 
  123.                     
  124.                     }
  125.                     function closeSearch() {
  126.                         document.getElementById("myOverlay").style.display = "none";
  127.                         setTimeout(function() {
  128.                             document.getElementById("myOverlay").style.opacity = "0";
  129.                         }, 2); 
  130.                     }
  131.                   // new WOW().init();
  132.                    (function () {
  133.                         'use strict'
  134.                         // Fetch all the forms we want to apply custom Bootstrap validation styles to
  135.                         var forms = document.querySelectorAll('.needs-validation')
  136.                         // Loop over them and prevent submission
  137.                         Array.prototype.slice.call(forms)
  138.                             .forEach(function (form) {
  139.                             form.addEventListener('submit', function (event) {
  140.                                 form.classList.add('was-validated')
  141.                                 if (!form.checkValidity()) {
  142.                                     event.preventDefault()
  143.                                     event.stopPropagation()
  144.                                     return false;
  145.                                 }
  146.                                 event.preventDefault();
  147.                                 $(form).find('button[type="submit"]').attr('disabled','true');
  148.                                 grecaptcha.execute('{{ParametreSite().clekey}}', {action: 'create_comment'}).then(token => {
  149.                                     $(form).find('[name=g-recaptcha-response]').val(token);
  150.                                     form.submit();
  151.                                 });
  152.                             }, false)
  153.                             })
  154.                     })()  
  155.                     function reCaptchaOnFocus() {
  156.                         var head = document.getElementsByTagName('head')[0]
  157.                         var script = document.createElement('script')
  158.                         script.type = 'text/javascript';
  159.                         script.src = 'https://www.google.com/recaptcha/api.js?render={{ParametreSite().clekey}}'
  160.                         head.appendChild(script);
  161.                     };  
  162.                     if(document.getElementsByClassName('form-recap')){
  163.                         for (let i = 0; i < document.getElementsByClassName('form-recap').length; i++) {
  164.                             document.getElementsByClassName('form-recap')[i].addEventListener('focus', (event) => {
  165.                                 reCaptchaOnFocus()
  166.                             }, true);
  167.                         }
  168.                     }
  169.             </script>
  170.             <script>
  171.                 $(document).ready(function(){
  172.                     /* const elems = document.querySelectorAll('.datepicker_input');
  173.                     for (const elem of elems) {
  174.                         const datepicker = new Datepicker(elem, {
  175.                             'format': 'dd/mm/yyyy',
  176.                             'language' : 'fr',
  177.                            // title: getDatePickerTitle(elem)
  178.                         });
  179.                     } */
  180.              
  181.                     $(window).on("scroll", function () {
  182.                         if ($(this).scrollTop() > $(window).height() / 2) {
  183.                             $(".scroll-to-top").fadeIn();
  184.                         } else {
  185.                              $(".scroll-to-top").fadeOut();
  186.                         }
  187.                     });
  188.                     $('.header-savoir-plus').on("click", function () {
  189.                         $("html, body").animate({ scrollTop: $('#bloc-content').offset().top - 100 }, "slow" );
  190.                         return false;
  191.                     });
  192.                     $(".scroll-to-top").on("click", function () {
  193.                         $("html, body").animate({ scrollTop: 0 }, 500);
  194.                         return false;
  195.                     });
  196.                     $('input[name="prestation[]"]').change(function(){
  197.                         if(this.hasAttribute('checked')){
  198.                             $(this).attr('checked',false);
  199.                         }else{
  200.                             $(this).attr('checked',true);
  201.                         }
  202.                         $.each($("input[name='prestation[]']"), function () {
  203.                             if (this.value == 'Autre' && this.hasAttribute('checked')) {
  204.                                 $('.autre_prestation').removeClass('d-none');
  205.                                 $('input[name="autre_prestation"]').attr('required',true);
  206.                             }else{
  207.                                 $('.autre_prestation').addClass('d-none');
  208.                                 $('input[name="autre_prestation"]').attr('required',false);
  209.                             }
  210.                         });
  211.                     
  212.                     });
  213.                     $('input[name="vous_etes"]').change(function(){
  214.                         if (this.value == 'Autre') {
  215.                             $('.autre_coordonne').removeClass('d-none');
  216.                             $('input[name="autre_coordonne"]').attr('required',true);
  217.                         }else{
  218.                             $('.autre_coordonne').addClass('d-none');
  219.                             $('input[name="autre_coordonne"]').attr('required',false);
  220.                         }
  221.                     });
  222.                 });
  223.             </script>
  224.             
  225.             {% if parametreProduits() and parametreProduits().actifpanier %}
  226.                 <script>
  227.                     // Fonction pour mettre à jour le panier côté client
  228.                     function updatePanier(panier) {
  229.                         $.ajax({
  230.                             url: '{{ path('cart_content') }}',
  231.                             type: 'GET',
  232.                             success: function(response) {
  233.                                 var panier = response.panier;
  234.                                 var commandeDiv = $('.commande_div');
  235.                                 commandeDiv.empty();
  236.                                 var commandeTable = $('.table-panier tbody');
  237.                                 if(commandeTable.length){
  238.                                     commandeTable.empty();
  239.                                 }
  240.                                 var total = 0;
  241.                                 $('#nb_span').text(Object.keys(panier).length);
  242.                                 for (var key in panier) {
  243.                                     if (panier.hasOwnProperty(key)) {
  244.                                         var item = panier[key];
  245.                                         var id = item['product'].id;
  246.                                         var name = item['product'].title;
  247.                                         var prix = item['product'].prix_produit;
  248.                                         var qte = item.qte;
  249.                                         var nameDiv = $('<div>', { class: 'name_div', 'data-id': id });
  250.                                         var nameSpan = $('<span>', { class: 'name_span' }).text(name);
  251.                                         var content_prix = prix ? ' - '+prix+' €' : ''
  252.                                         var condSpan = $('<span>', { class: 'cond_span' }).text(content_prix);
  253.                                         var qteSpan = $('<span>', { class: 'qte_span' }).text(' - ' + qte);
  254.                                         total +=  prix * qte;
  255.                                         var viderLink = $('<button>', { class: 'vider_selection_prod cart-remove', 'data-qte': qte, 'data-id-produit': id }).html('<i class="fa fa-trash-o"></i>');
  256.                                         var clearDiv = $('<div>', { class: 'clear' });
  257.                                         nameSpan.append(condSpan);
  258.                                         nameDiv.append(nameSpan, qteSpan, viderLink, clearDiv);
  259.                                         commandeDiv.append(nameDiv);
  260.                                         if(commandeTable.length){
  261.                                             
  262.                                             var inputQte = $('<input>', { class: 'form-control input-qte', 'type': 'number', 'value': qte,'name': 'qte','id': 'qte','min': '0','max': '1000', 'data-id-produit': id });
  263.                                             var btnQteUpdate = $('<button>', { class: 'btn-update-qte disabled', 'disabled' : '' }).html('Modifier');
  264.                                             var nameTr = $('<tr>', { class: 'name_div', 'data-id': id });
  265.                                             var nameTd = $('<td>', { class: 'name_span' }).text(name);
  266.                                             var qteTd = $('<td>', { class: 'qte_span' }).append(inputQte,btnQteUpdate);
  267.                                             var prixTd = $('<td>', { class: 'cond_span' }).text(prix);
  268.                                             var viderLinkTd = $('<button>', { class: 'vider_selection_prod cart-remove float-none', 'data-qte': qte, 'data-id-produit': id }).html('<i class="fa fa-trash-o"></i>');
  269.                                             var actionsTd = $('<td>', { class: 'actions' }).append(viderLinkTd);
  270.                                             nameTr.append(nameTd, qteTd,prixTd, actionsTd);
  271.                                             commandeTable.append(nameTr);
  272.                                         }
  273.                                     }
  274.                                 }
  275.                                 var totalTr = $('<tr>', { class: 'total' });
  276.                                 var totalTd1 = $('<td>', { class: 'text-right' , 'colspan' : '2' }).html('<strong>Total(€) :</strong>');
  277.                                 var totalTd2 = $('<td>', { class: 'total-prix' }).html('<strong>'+ total +'</strong>');
  278.                                 totalTr.append(totalTd1,totalTd2);
  279.                                 if(commandeTable.length){
  280.                                     commandeTable.append(totalTr);
  281.                                 }
  282.                             },
  283.                             error: function(xhr, status, error) {
  284.                                 console.log(error);
  285.                             }
  286.                         });
  287.                     }
  288.                     function removeFromCart(id_produit){
  289.                                 $.ajax({
  290.                                     url: '/panier/remove/'+escape(id_produit),
  291.                                     type: 'POST',
  292.                                     dataType: 'JSON',
  293.                                     success: function(response) {
  294.                                         var panier = response;
  295.                                         updatePanier(panier);
  296.                                     },
  297.                                     error: function(xhr, status, error) {
  298.                                         console.log(error); // Affichez l'erreur pour le débogage
  299.                                     }
  300.                                 });
  301.                             
  302.                     }
  303.                     function updateQtePanier(id_produit,qte){
  304.                         
  305.                         $.ajax({
  306.                             url: '/panier/update/'+escape(id_produit)+'/'+escape(qte),
  307.                             type: 'POST',
  308.                             dataType: 'JSON',
  309.                             success: function(response) {
  310.                                 var panier = response.panier;
  311.                                 updatePanier(panier);
  312.                             },
  313.                             error: function(xhr, status, error) {
  314.                                 console.log(error); // Affichez l'erreur pour le débogage
  315.                             }
  316.                         });
  317.                     }
  318.                     
  319.                     $(document).ready(function() {
  320.                         
  321.                         $(document).on('click', '.cart-remove', function() {
  322.                             var id_produit = $(this).data('id-produit');
  323.                             removeFromCart(id_produit);
  324.                         });
  325.                         $(document).on('change', '.input-qte', function() {
  326.                             $(this).closest('tr.name_div').find('.btn-update-qte').removeClass('disabled');
  327.                             $(this).closest('tr.name_div').find('.btn-update-qte').removeAttr('disabled');
  328.                         });
  329.                         $(document).on('click', '.btn-update-qte', function() {
  330.                             var productId = $(this).closest('tr.name_div').data('id');
  331.                             var qte = $(this).closest('tr.name_div').find('input.input-qte').val();
  332.                             updateQtePanier(productId,qte);
  333.                         });
  334.                     });
  335.                 </script>
  336.             {% endif %}
  337.             {% if Cookies() != null %}
  338.                   {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/cookies/cookie.html.twig',{}, with_context = false)}}
  339.             {% endif %}
  340.             <script>
  341.                 {{ source ('front/'~ app.request.server.get('APP_THEME') ~'/assets/js/script.js')}}
  342.             </script>
  343.         {% endblock %} 
  344.     </body>
  345.     {% endapply %}
  346. </html>