src/Aviatur/TwigBundle/Resources/views/aviatur/Flux/App/front.html.twig line 1

Open in your IDE?
  1. {% extends twig_exists('@AviaturTwig/'~ agency_folder.twigFlux() ~'/App/base.html.twig') %}
  2. {# head #}
  3. {% if pdfGenerator is not defined %}
  4.     {% block head_title %}
  5.         {% if seo_title is defined %}
  6.             {{seo_title}}{% else %}Tiquetes Baratos, Hoteles, Paquetes Turísticos y Viajes | Aviatur
  7.         {% endif %}
  8.     {% endblock head_title %}
  9.     {% block head_description_content %}
  10.         {% if seo_description is defined %}
  11.             {{seo_description}}{% else %}Agencia de viajes Aviatur. Encuentra ofertas de vuelos, hoteles, paquetes turísticos, cruceros, autos y más. Tiquetes baratos Nacionales e Internacionales
  12.         {% endif %}
  13.     {% endblock head_description_content %}
  14.     {%- block head_meta_title -%}
  15.         {%- if seo_meta_title is defined -%}
  16.             {{seo_meta_title}}
  17.         {%- endif -%}
  18.     {%- endblock head_meta_title -%}
  19.     {% if is_mobile() %}
  20.         {% block head_viewport %}
  21.             <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
  22.             <link rel="apple-touch-icon" href="{{ absolute_url(asset('assets/'~ agency_folder.assetStyle() ~'/img/ios/touch-icon-iphone.png')) }}">
  23.             <link rel="apple-touch-icon" sizes="76x76" href="{{ absolute_url(asset('assets/'~ agency_folder.assetStyle() ~'/img/ios/touch-icon-ipad.png')) }}">
  24.             <link rel="apple-touch-icon" sizes="120x120" href="{{ absolute_url(asset('assets/'~ agency_folder.assetStyle() ~'/img/ios/touch-icon-iphone-retina.png')) }}">
  25.             <link rel="apple-touch-icon" sizes="152x152" href="{{ absolute_url(asset('assets/'~ agency_folder.assetStyle() ~'/img/ios/touch-icon-ipad-retina.png')) }}">
  26.             <link rel="apple-touch-icon" sizes="180x180" href="{{ absolute_url(asset('assets/'~ agency_folder.assetStyle() ~'/img/ios/touch-icon-iphone-plus-retina.png')) }}">
  27.         {% endblock head_viewport %}
  28.     {% endif %}
  29. {% endif %}
  30. {#{% block stylesheets %}
  31.     <link type="text/css" rel="stylesheet" href="{{ absolute_url(asset('assets/common_assets/css/vendor/owl-carousel/owl.carousel.css')) }}"/>
  32.     <link type="text/css" rel="stylesheet" href="{{ absolute_url(asset('assets/common_assets/css/vendor/owl-carousel/owl.theme.css')) }}"/>
  33.     {{ parent() }}
  34. {% endblock stylesheets %}#}
  35. {# END head #}
  36. {% block base_content %}
  37.     {% if pdfGenerator is not defined %}
  38.         <!--[if (!IE)|(gt IE 8)]><!-->
  39.         {% block header %}
  40.             {% set somepromoimage = false %}
  41.             {% set linkHeader = path('homepage') %}
  42.             {% set specialStyle = '' %}
  43.             {% set classMainNav = '' %}
  44.             {% set logoVersion = '' %}
  45.             {% set onPromo = false %}
  46.             {# {% set headerPromoStart = app.session.get('headerPromoStart')|date('U') %}
  47.                                                                                                                                                                         {% set headerPromoEnd = app.session.get('headerPromoEnd')|date('U') %} #}
  48.             {% set nowDateU = "now"|date('U') %}
  49.             {% if background_home is defined %}
  50.                 {% if background_home.active == 'true' %}
  51.                     {% set videoType ='-day' %}
  52.                     {% set imgType = background_home.name %}
  53.                 {% endif %}
  54.             {% else %}
  55.                 {% set videoType = '-day' %}
  56.                 {% set imgType = '_background_default' %}
  57.             {% endif %}
  58.             {% if blackFriday is defined %}
  59.                 {% if blackFriday == 'true' %}
  60.                     {% set videoType = 'NO_VID' %}
  61.                     {% set imgType = '_black_friday' %}
  62.                     <input type="hidden" class="js-hdBlackFriday" value="{{blackFriday}}">
  63.                 {% endif %}
  64.             {% endif %}
  65.             <header class="page-head{{ specialStyle }}">
  66.                 {% if app.user != "" and (is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_EDIT_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  67.                     {% if background_home is defined %}
  68.                         <div class="page-head-edit-background">
  69.                             <a href="#" class="js-ajax-homechange" data-toggle="modal" data-target="#js-promo-editModal">Editar</a>
  70.                         </div>
  71.                     {% endif %}
  72.                 {% endif %}
  73.                 <div class="page-head__bg-container">
  74.                     {% if videoType is not defined %}
  75.                         {% set curHour = 'now'|localizeddate("medium", "none", null, null, "Hmm") %}
  76.                         {% if curHour >= '500' and curHour < '900' %}
  77.                             {# 05:00 - 08:59 #}
  78.                             {% set videoType = '-day' %}
  79.                         {% elseif curHour >= '900' and curHour < '1300' %}
  80.                             {# 09:00 - 12:59 #}
  81.                             {% set videoType = '-day' %}
  82.                         {% elseif curHour >= '1300' and curHour < '1700' %}
  83.                             {# 13:00 - 16:59 #}
  84.                             {% set videoType = '-day' %}
  85.                         {% elseif curHour >= '1700' and curHour < '2100' %}
  86.                             {# 17:00 - 20:59 #}
  87.                             {% set videoType = '-day' %}
  88.                         {% else %}
  89.                             {# 21:00 - 04:59 #}
  90.                             {% set videoType = '-day' %}
  91.                         {% endif %}
  92.                     {% endif %}
  93.                     {% if videoType != 'NO_VID' %}
  94.                         {% block headerVideo %}{% endblock headerVideo %}
  95.                         <div class="page-head__bg__img bg-img{{ videoType }} js-headerImg"></div>
  96.                     {% else %}
  97.                         <div class="page-head__bg__img bg-img{{ imgType }} js-headerImg"></div>
  98.                     {% endif %}
  99.                 </div>
  100.                 {% if app.session.has('operatorId') != 1 %}
  101.                     {% include twig_exists('@AviaturTwig/'~ agency_folder.twigStyle() ~'/App/header.html.twig') %}
  102.                 {% endif %}
  103.                 {% block searcher_header %}{% endblock %}
  104.             </header>
  105.         {% endblock %}
  106.     {% else %}
  107.         <section></section>
  108.     {% endif %}
  109.     {% set displayState = '' %}
  110.     {% if 'aviatur_general_homepage' in app.request.attributes.get('_route') and not app.request.query.has('anchor') %}
  111.         {% set displayState = 'hidden-palm' %}
  112.     {% endif %}
  113.     <div class="page__body pt-[17px]">
  114.         <div class="ajax-loader spinOverlay sp-offset--big js-loadingChangeCoin" style="display: none;"></div>
  115.         {% block body %}{% endblock body %}
  116.         {# {% embed twig_exists('@AviaturTwig/'~ agency_folder.twigFlux() ~'/General/Components/component_contactWidget.html.twig') %}
  117.             {% block contactWidget_banner %}
  118.                 <img class="icon-contact" src="{{ absolute_url(asset('assets/'~ agency_folder.assetStyle() ~'/img/header/lo-llamamos.svg')) }}" alt="Whatsapp">
  119.             {% endblock %}
  120.             {% block contactWidget_disclaimer %}
  121.                 Cerrar
  122.             {% endblock %}
  123.         {% endembed %} #}
  124.     {% if app.session.has('operatorId') != 1  %}
  125.         <div class="hidden-portable">
  126.             {% include twig_exists('@AviaturTwig/'~ agency_folder.twigFlux() ~'/App/needHelp.html.twig') %}
  127.         </div>
  128.         {# <a class="hide" href="https://www.aviatur.com/contenidos/asesor-en-linea" style="position: fixed; right: 132px; width: 106px;bottom:20px"><img target="_blank" class="btn_adviser schedule-appointment_icon" src="https://aviaturcdndev.z5.web.core.windows.net/assets/aviatur_assets/img/header/asesor.webp" alt="Whatsapp"></a> #}
  129.     {% endif %}
  130.         {# <a class="hide" href="https://www.aviatur.com/contenidos/asesor-en-linea" style="position: fixed; right: 132px; width: 106px;bottom:20px"><img target="_blank" class="btn_adviser schedule-appointment_icon" src="{{ absolute_url(asset('assets/'~ agency_folder.assetStyle() ~'/img/header/asesor.svg')) }}" alt="Whatsapp"></a> #}
  131.     </div>
  132.     {% if pdfGenerator is not defined %}
  133.         {% if app.session.has('operatorId') != 1 and app.session.has('whitemark') != 1 %}
  134.             {% block footer %}
  135.                 {% include twig_exists('@AviaturTwig/'~ agency_folder.twigStyle() ~'/App/footer.html.twig') %}
  136.             {% endblock footer %}
  137.         {% endif %}
  138.         {% block modal %}
  139.             {{ parent()}}
  140.             {% include twig_exists('@AviaturTwig/'~ agency_folder.twigFlux() ~'/General/Components/callUsModal.html.twig') %}
  141.             {% include twig_exists('@AviaturTwig/'~ agency_folder.twigFlux() ~'/General/Templates/modalLogin.html.twig') with {'redirectLogin': path('aviatur_customer_edit_info')} %}
  142.         {% endblock modal %}
  143.     {% endif %}
  144. {% endblock base_content %}
  145. {% block javascripts_bottom %}
  146.     {{ parent() }}
  147.     <script>
  148.         // Verificación de existencia de los elementos
  149.         let miBoton = document.getElementById("miBoton");
  150.         let help = document.getElementById("needHelp");
  151.         let iconCall = document.getElementById("iconCall");
  152.         let openCall = document.getElementById("openCall");
  153.         let callDarkOpen = document.getElementById("callDarkOpen");
  154.         let callMenu = document.getElementById("callMenu");
  155.         let loLlamamos = document.getElementById("loLlamamos");
  156.         let loLlamamos_soporte_linea = document.getElementById("loLlamamos_soporte_linea");
  157.         let loLlamamos_palm = document.getElementById("loLlamamos_palm");
  158.         let loLlamamos_palm_soporte_linea = document.getElementById("loLlamamos_palm_soporte_linea");
  159.         let wsp = document.getElementById("wsp");
  160.         let comuniquese = document.getElementById("comuniquese");
  161.         let comuniquese_palm = document.getElementById("comuniquese_palm");
  162.         let showLoLlamamos = document.getElementById("showLoLlamamos");
  163.         let divFormLoLlamamos = document.getElementById("divFormLoLlamamos");
  164.         let formLoLlamamos = document.getElementById("formLoLlamamos");
  165.         let resultLoLlamamos = document.getElementById("resultLoLlamamos");
  166.         let closeModal = document.getElementById("closeModal");
  167.         let okCloseModal = document.getElementById("okCloseModal");
  168.         let showComuniquese = document.getElementById("showComuniquese");
  169.         let closeModalComuniquese = document.getElementById("closeModalComuniquese");
  170. let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = '';
  171.         // Verificación general antes de ejecutar el código
  172.         let screenWidth = window.innerWidth;
  173.         // Solo ejecutar si los elementos existen
  174.         if (miBoton && help && iconCall && openCall && callDarkOpen && callMenu) {
  175.             // Funcionalidad del botón de ayuda
  176.             let activeCall = false;
  177.             miBoton.addEventListener("click", () => {
  178.                 activeCall = !activeCall;
  179.                 if (activeCall) {
  180.                     miBoton.classList.add("call-btn--close_active");
  181.                     help.style.display = "none";
  182.                     iconCall.setAttribute("width", "38");
  183.                     iconCall.setAttribute("height", "30");
  184.                     iconCall.style.viewBox = "0 -2 20 23";
  185.                     openCall.classList.add("call_bg--open");
  186.                     callDarkOpen.classList.add("call_bg-dark__open");
  187.                     callMenu.classList.add("call-menu--active");
  188.                 } else {
  189.                     miBoton.classList.remove("call-btn--close_active");
  190.                     help.style.display = "block";
  191.                     iconCall.setAttribute("width", "22");
  192.                     iconCall.setAttribute("height", "20");
  193.                     openCall.classList.remove("call_bg--open");
  194.                     callDarkOpen.classList.remove("call_bg-dark__open");
  195.                     callMenu.classList.remove("call-menu--active");
  196.                 }
  197.             });
  198.         }
  199.         // Verificación de existencia de wsp
  200.         if (wsp) {
  201.             wsp.addEventListener("click", () => {
  202.                 if (screenWidth < 723) {
  203.                     wsp.setAttribute("href", "https://api.whatsapp.com/send?phone=5713821616&text=");
  204.                 } else {
  205.                     wsp.setAttribute("href", "https://web.whatsapp.com/send?phone=5713821616&amp;text=");
  206.                 }
  207.             });
  208.         }
  209.         let modalLoLlamamos = false;
  210.         const openModalLollamamos = () => {
  211.             modalLoLlamamos = !modalLoLlamamos;
  212.             showLoLlamamos.style.display = modalLoLlamamos ? "flex" : "none";
  213.         };
  214.         // Modal "Lo Llamamos"
  215.         if (showLoLlamamos && divFormLoLlamamos && formLoLlamamos && resultLoLlamamos) {
  216.             
  217.             // Validar el formulario y manejar el submit
  218.             formLoLlamamos.addEventListener('submit', function (event) {
  219.                 event.preventDefault();
  220.                 modalLoLlamamos = false;
  221.                 if (formLoLlamamos.checkValidity()) {
  222.                     const nombre = formLoLlamamos.elements['Nombre'].value;
  223.                     const numeroCelular = formLoLlamamos.elements['NumeroCelular'].value;
  224.                     resultLoLlamamos.style.display = "block";
  225.                     divFormLoLlamamos.style.display = "none";
  226.                     // Enviar los datos a través de jQuery
  227.                     jQuery.post("/formularios/llamar", ({
  228.                         "name": nombre,
  229.                         "phone": numeroCelular
  230.                     }), function (res) {
  231.                         // alert(res);
  232.                     }).fail(function (xhr, status, error) {
  233.                         console.log('Error en la petición POST');
  234.                         console.error('Error en la petición POST:', error);
  235.                     });
  236.                 } else {
  237.                     formLoLlamamos.reportValidity();
  238.                 }
  239.             });
  240.             // Cerrar el modal
  241.             if (closeModal) {
  242.                 closeModal.addEventListener("click", () => {
  243.                     modalLoLlamamos = false;
  244.                     showLoLlamamos.style.display = "none";
  245.                 });
  246.             }
  247.             // Confirmar cierre del modal
  248.             if (okCloseModal) {
  249.                 okCloseModal.addEventListener("click", () => {
  250.                     resultLoLlamamos.style.display = "none";
  251.                     divFormLoLlamamos.style.display = "block";
  252.                     formLoLlamamos.elements['Nombre'].value = '';
  253.                     formLoLlamamos.elements['NumeroCelular'].value = '';
  254.                     modalLoLlamamos = false;
  255.                     showLoLlamamos.style.display = "none";
  256.                 });
  257.             }
  258.         }
  259.             let modalComuniquese = false;
  260.             const openModalComuniquese = () => {
  261.                 modalComuniquese = !modalComuniquese;
  262.                 showComuniquese.style.display = modalComuniquese ? "flex" : "none";
  263.             };
  264.             // Modal "Comuniquese"
  265.             if (showComuniquese && closeModalComuniquese) {
  266.                 
  267.                 closeModalComuniquese.addEventListener("click", () => {
  268.                     modalComuniquese = false;
  269.                     showComuniquese.style.display = "none";
  270.                 });
  271.             }
  272.             // Desktop lo llamamos
  273.             if (loLlamamos) {
  274.                 loLlamamos.addEventListener("click", openModalLollamamos);
  275.                 if (loLlamamos_soporte_linea) {
  276.                     loLlamamos_soporte_linea.addEventListener("click", openModalLollamamos);
  277.                 }
  278.             }
  279.             // Desktop comuniquese
  280.             if (comuniquese) {
  281.                 comuniquese.addEventListener("click", openModalComuniquese);
  282.             }
  283.             // Verificación de dispositivos móviles
  284.             if (screenWidth < 1024) {
  285.                 // Verificar elementos de móviles antes de agregar eventos
  286.                 if (comuniquese_palm) {
  287.                     comuniquese_palm.addEventListener("click", openModalComuniquese);
  288.                 }
  289.                 if (loLlamamos_palm) {
  290.                     loLlamamos_palm.addEventListener("click", openModalLollamamos);
  291.                 }
  292.                 if (loLlamamos_palm_soporte_linea) {
  293.                     loLlamamos_palm_soporte_linea.addEventListener("click", openModalLollamamos);
  294.                 }
  295.             }
  296.     </script>
  297. {% endblock javascripts_bottom %}