src/Aviatur/TwigBundle/Resources/views/aval/Flux/Edition/Default/content_homePromoSlider.html.twig line 1

Open in your IDE?
  1. <script type="text/javascript">
  2.     jQuery(document).ready(function () {
  3.         jQuery(".lazy").lazyload({
  4.             effect: "fadeIn",
  5.             threshold: 300
  6.         });
  7.     });
  8. </script>
  9. {% block javascripts %}
  10.     {# <script type="text/javascript">
  11.         jQuery(document).ready(function () {
  12.             jQuery('.carousel').carousel({hAlign: 'center', vAlign: 'center', hMargin: 0.4, directionNav: true, buttonNav: 'bullets'});
  13.         });
  14.     </script> #}
  15.     {% if app.user != "" and (is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_EDIT_' ~ app.session.get('agencyId')) or is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_CREATE_' ~ app.session.get('agencyId')) or is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_DELETE_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') and promoType is defined) %}
  16.         <script type="text/javascript">
  17.             jQuery(document).ready(function () {
  18.                 jQuery('.js-ajax-homePromo').on('click', function () {
  19.                     jQuery('.modal-title').html('Edit Promo');
  20.                     jQuery('#js-form-homePromo').empty();
  21.                     _loadSpinner("js-form-homePromo");
  22.                     var url = "{{ path('aviatur_edit_homepromo', {promoType: promoType, id: 'xx', size: 'yy'}) }}";
  23.                     var id = jQuery(this).data("id");
  24.                     var size = jQuery(this).data("size");
  25.                     var url = url.replace(/\xx/g, id);
  26.                     var url = url.replace(/\yy/g, size);
  27.                     jQuery.get(url, function (data) {
  28.                         jQuery('#js-form-homePromo').html(data);
  29.                         _removeSpinner("js-form-homePromo");
  30.                     });
  31.                 });
  32.                 jQuery('.js-ajax-homechange').on('click', function () {
  33.                     jQuery('.modal-title').html('Editar Background');
  34.                     jQuery('#js-form-homePromo').empty();
  35.                     _loadSpinner("js-form-homePromo");
  36.                     var url = "{{ path('aviatur_edit_home_changebackground') }}";
  37.                     jQuery.get(url, function (data) {
  38.                         jQuery('#js-form-homePromo').html(data);
  39.                         _removeSpinner("js-form-homePromo");
  40.                     });
  41.                 });
  42.             });
  43.         </script>
  44.     {% endif %}
  45.     {% javascripts
  46.         '@AviaturGeneralBundle/Resources/public/js/jquery.mousewheel.min.js'
  47.         '@AviaturGeneralBundle/Resources/public/js/slider.js'  %}
  48.     <script type="text/javascript" src="{{ asset_url }}"></script>
  49.     {% endjavascripts %}
  50. {% endblock %}
  51. {# {% if not is_mobile() %}
  52.     <section class="hide-palm">
  53.         {% if app.user != "" and (is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_CREATE_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN')) %}
  54.             <a href="#" class="js-ajax-homePromo" data-id="0" data-size="banner_slider" style="margin-bottom: 5px; display: block; font-size: 16px; font-weight: bold;" data-toggle="modal" data-target="#js-promo-editModal">CREAR UNA NUEVO SLIDER</a>
  55.             {% for homePromo in homePromos %}
  56.                 {% if homePromo.size == "banner_slider" %}
  57.                     <div class="promo-banner" style="margin-bottom: 20px;">
  58.                         {% if app.user != "" and (is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_EDIT_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  59.                             <a href="#" class="js-ajax-homePromo" data-id="{{ homePromo.id }}" data-size="banner_slider" style="margin-bottom: 2px"  data-toggle="modal" data-target="#js-promo-editModal">EDITAR</a> -
  60.                         {% endif %}
  61.                         {% if app.user != "" and (is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_DELETE_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  62.                             <a href="{{ path('aviatur_edit_homepromo_delete', {id: homePromo.id, promoType: promoType}) }}">BORRAR</a>
  63.                         {% endif %}
  64.                         {% if homePromo.switch == false %}
  65.                             {% set imageGuessedName = (homePromo.link|split('?')|first)|split('/')|last ~ "_" ~ homePromo.id ~ ".jpeg" %}
  66.                             {% set pathToImage = "https://" ~ app.session.get('domainsecure') ~ "/assets/" ~ agency_folder.assetStyle() ~ "/img/promo/box/"%}
  67.                             {% if file_exists(pathToImage ~ imageGuessedName)%}
  68.                                 {% set imageLink = pathToImage ~ imageGuessedName %}
  69.                             {% else %}
  70.                                 {% set imageLink = pathToImage ~ homePromo.id ~ ".jpeg" %}
  71.                             {% endif %}
  72.                             <a href="{{ homePromo.link }}" target="_blank">
  73.                                 <img class="center-block img-responsive lazy" data-original="{{ imageLink }}?timestamp={{ homePromo.date| date('U') }}" alt=""/>
  74.                             </a>
  75.                         {% else %}
  76.                             {% set imageGuessedName = (homePromo.link|split('?')|first)|split('/')|last ~ "_" ~ homePromo.id ~ ".jpeg" %}
  77.                             {% set imageGuessedName2 = (homePromo.linkSwitch|split('?')|first)|split('/')|last ~ "_" ~ homePromo.id ~ "-2.jpeg" %}
  78.                             {% set pathToImage = "assets/" ~ agency_folder.assetStyle() ~ "/img/promo/box/"%}
  79.                             {% if file_exists(pathToImage ~ imageGuessedName)%}
  80.                                 {% set imageLink = pathToImage ~ imageGuessedName %}
  81.                             {% else %}
  82.                                 {% set imageLink = pathToImage ~ homePromo.id ~ ".jpeg" %}
  83.                             {% endif %}
  84.                             {% if file_exists(pathToImage ~ imageGuessedName2)%}
  85.                                 {% set imageLink2 = pathToImage ~ imageGuessedName2 %}
  86.                             {% else %}
  87.                                 {% set imageLink2 = pathToImage ~ homePromo.id ~ "-2.jpeg" %}
  88.                             {% endif %}
  89.                             <a class="center-block promo-crossFading" href="#" target="_blank"
  90.                                data-href1="{{ homePromo.link }}"
  91.                                data-href2="{{ homePromo.linkSwitch }}">
  92.                                 <img class="img-responsive js-fadeInOut lazy" data-original="/{{ imageLink }}?timestamp={{ homePromo.date| date('U') }}" alt="" />
  93.                                 <img class="img-responsive lazy" data-original="/{{ imageLink2 }}?timestamp={{ homePromo.date| date('U') }}" alt="" />
  94.                             </a>
  95.                         {% endif %}
  96.                     </div>
  97.                 {% endif %}
  98.             {% endfor %}
  99.         {% endif %}
  100.     </section>
  101. {% endif%} #}
  102.         {% if parameters['promocionales_aval'] == 'true' %}
  103. <style>
  104.   /* Estilos generales para el carrusel */
  105.   .carousel.one {
  106.     width: 100%;
  107.     overflow: hidden;
  108.     position: relative;
  109.   }
  110.   .slides {
  111.     display: flex;
  112.     flex-wrap: wrap;
  113.     justify-content: center;
  114.     gap: 15px;
  115.     width: 100% !important;
  116.     height: auto !important;
  117.     padding: 15px;
  118.     transform: none !important;
  119.   }
  120.   .promo-box {
  121.     position: relative !important;
  122.     width: 220px !important;
  123.     height: 336px !important;
  124.     opacity: 1 !important;
  125.     display: block !important;
  126.     right: auto !important;
  127.     bottom: auto !important;
  128.     margin: 0 !important;
  129.     flex: 0 0 calc(50% - 15px);
  130.     transition: all 0.3s ease;
  131.   }
  132.   .promo-box .inner img {
  133.     width: 100% !important;
  134.     height: auto !important;
  135.     max-height: 336px;
  136.     object-fit: fill;
  137.   }
  138.   .buttonNav {
  139.     display: none !important;
  140.   }
  141.   /* Media queries para diferentes tamaños de pantalla */
  142.   @media (min-width: 480px) {
  143.     .promo-box {
  144.       flex: 0 0 calc(50% - 15px);
  145.     }
  146.   }
  147.   @media (min-width: 768px) {
  148.     .promo-box {
  149.       flex: 0 0 calc(33.333% - 15px);
  150.     }
  151.   }
  152.   @media (min-width: 1024px) {
  153.     .carousel.one {
  154.       overflow: visible;
  155.     }
  156.     .slides {
  157.       flex-wrap: nowrap;
  158.       justify-content: flex-start;
  159.       padding: 0;
  160.       transform: translateX(0) !important;
  161.     }
  162.     .promo-box {
  163.       flex: 0 0 auto;
  164.       margin-right: 15px;
  165.     }
  166.     .buttonNav {
  167.       display: table !important;
  168.     }
  169.   }
  170. </style>
  171. <!-- quemado por urgencia de salir a prod se debe refactorizar toda esta sección-->
  172. <div class="carousel one">
  173.     <div id="slide-promo" class="slides" style="width: 1075px; height: 400px;">
  174.         <!-- Promo 1 -->
  175.         <div class="promo1 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: -320px; opacity: 0; z-index: 5; display: none;">
  176.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/irotama" target="_blank">
  177.                 <div class="inner">
  178.                     <div>
  179.                         <img src="https://aviaturcdndev.z5.web.core.windows.net/assets/aval_assets/img/promo/promo1.webp?"
  180.                              ondragstart="return false;"
  181.                              alt="Promociones viajestuplus.com"
  182.                              style="width: 220px; height: 336px; display: inline-block;">
  183.                     </div>
  184.                 </div>
  185.             </a>
  186.         </div>
  187.         <!-- Promo 2 -->
  188.         <div class="promo2 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: -555px; opacity: 0; z-index: 4; display: none;">
  189.             <a href="https://www.viajestuplus.com.co/paquetes/detalle/32279-3-1/aviatur-grand-palladium-punta-cana-resort-yamp;-spa-todo-incluido" target="_blank">
  190.                 <div class="inner">
  191.                     <div>
  192.                         <img src="https://aviaturcdndev.z5.web.core.windows.net/assets/aval_assets/img/promo/promo2.webp?"
  193.                              ondragstart="return false;"
  194.                              alt="Promociones viajestuplus.com"
  195.                              style="width: 220px; height: 336px; display: inline-block;">
  196.                     </div>
  197.                 </div>
  198.             </a>
  199.         </div>
  200.         <!-- Promo 3 -->
  201.         <div class="promo3 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 1325px; opacity: 0; z-index: 4; display: none;">
  202.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/turkish" target="_blank">
  203.                 <div class="inner">
  204.                     <div>
  205.                         <img src="https://aviaturcdndev.z5.web.core.windows.net/assets/aval_assets/img/promo/promo3.webp?"
  206.                              ondragstart="return false;"
  207.                              alt="Promociones viajestuplus.com"
  208.                              style="width: 220px; height: 336px; display: inline-block;">
  209.                     </div>
  210.                 </div>
  211.             </a>
  212.         </div>
  213.         <!-- Promo 4 -->
  214.         <div class="promo4 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 1090px; opacity: 0; z-index: 5; display: none;">
  215.             <a href="https://www.viajestuplus.com.co/paquetes/detalle/31458-6-1/aviatur-special-tours-tailandia-bangkok-chiang-mai" target="_blank">
  216.                 <div class="inner">
  217.                     <div>
  218.                         <img src="https://aviaturcdndev.z5.web.core.windows.net/assets/aval_assets/img/promo/promo4.webp?"
  219.                              ondragstart="return false;"
  220.                              alt="Promociones viajestuplus.com"
  221.                              style="width: 220px; height: 336px; display: inline-block;">
  222.                     </div>
  223.                 </div>
  224.             </a>
  225.         </div>
  226.         <!-- Promo 5 -->
  227.         <div class="promo5 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 855px; opacity: 1; z-index: 6;">
  228.             <a href="https://www.viajestuplus.com.co/paquetes/detalle/28662-7-1/aviatur-peru-lima-y-cusco-especial-padres" target="_blank">
  229.                 <div class="inner">
  230.                     <div>
  231.                         <img src="https://aviaturcdndev.z5.web.core.windows.net/assets/aval_assets/img/promo/promo5.webp?"
  232.                              ondragstart="return false;"
  233.                              alt="Promociones viajestuplus.com"
  234.                              style="width: 220px; height: 336px; display: inline-block;">
  235.                     </div>
  236.                 </div>
  237.             </a>
  238.         </div>
  239.         {# <!-- Promo 6 -->
  240.         <div class="promo6 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 620px; opacity: 1; z-index: 7;">
  241.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/turkish" target="_blank">
  242.                 <div class="inner">
  243.                     <div>
  244.                         <img src="https://www.viajestuplus.com.co/version/1743111921/assets/aval_assets/img/promo/box/turkish_202.jpeg"
  245.                              ondragstart="return false;"
  246.                              alt="Promociones viajestuplus.com"
  247.                              style="width: 220px; height: 336px; display: inline-block;">
  248.                     </div>
  249.                 </div>
  250.             </a>
  251.         </div>
  252.         <!-- Promo 7 -->
  253.         <div class="promo7 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 385px; opacity: 1; z-index: 8;">
  254.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/realmadrid" target="_blank">
  255.                 <div class="inner">
  256.                     <div>
  257.                         <img src="https://www.viajestuplus.com.co/version/1743111895/assets/aval_assets/img/promo/box/199.jpeg"
  258.                              ondragstart="return false;"
  259.                              alt="Promociones viajestuplus.com"
  260.                              style="width: 220px; height: 336px; display: inline-block;">
  261.                     </div>
  262.                 </div>
  263.             </a>
  264.         </div>
  265.         <!-- Promo 8 -->
  266.         <div class="promo8 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 150px; opacity: 1; z-index: 7;">
  267.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/turkish" target="_blank">
  268.                 <div class="inner">
  269.                     <div>
  270.                         <img src="https://www.viajestuplus.com.co/version/1743111880/assets/aval_assets/img/promo/box/200.jpeg"
  271.                              ondragstart="return false;"
  272.                              alt="Promociones viajestuplus.com"
  273.                              style="width: 220px; height: 336px; display: inline-block;">
  274.                     </div>
  275.                 </div>
  276.             </a>
  277.         </div>
  278.         <!-- Promo 9 -->
  279.         <div class="promo9 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: -85px; opacity: 1; z-index: 6;">
  280.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/turkish" target="_blank">
  281.                 <div class="inner">
  282.                     <div>
  283.                         <img src="https://www.viajestuplus.com.co/version/1743111868/assets/aval_assets/img/promo/box/turkish_201.jpeg"
  284.                              ondragstart="return false;"
  285.                              alt="Promociones viajestuplus.com"
  286.                              style="width: 220px; height: 336px; display: inline-block;">
  287.                     </div>
  288.                 </div>
  289.             </a>
  290.         </div>
  291.     </div> #}
  292.     <!-- Navegación (bullets) -->
  293.     <div class="buttonNav" style="display: table; margin-top: 18px;">
  294.         <div class="bullet" style="text-align: center;"></div>
  295.         <div class="bullet" style="text-align: center;"></div>
  296.         <div class="bullet" style="text-align: center;"></div>
  297.         <div class="bullet" style="text-align: center;"></div>
  298.         <div class="bullet" style="text-align: center;"></div>
  299.         <div class="bullet" style="text-align: center;"></div>
  300.         <div class="bullet bulletActive" style="text-align: center;"></div>
  301.         <div class="bullet" style="text-align: center;"></div>
  302.         <div class="bullet" style="text-align: center;"></div>
  303.     </div>
  304. </div>
  305.         {% endif %}
  306. <!--Solo muestra promos-->
  307. {# {% set promosPicture = 0 %}
  308. {% if homePromos is defined %}
  309.     {% for homePromo in homePromos %}
  310.         {% if homePromo.size == "picture" %}
  311.             {% set promosPicture = promosPicture+1 %}
  312.         {% endif %}
  313.     {% endfor %}
  314. {% endif %}
  315. {% if promosPicture is defined and promosPicture>0%}
  316.     <section id="home-promos" class="wrapper-susy" style="margin-top:35px; margin-bottom: 0px">
  317.         <div class="carousel one"> <!-- BEGIN CAROUSEL -->
  318.             <div id="slide-promo" class="slides"> <!-- BEGIN SLIDES -->
  319.                 {% if homePromos is defined %}
  320.                     {% for homePromo in homePromos %}
  321.                         {% if homePromo.size == "picture" %}
  322.                             <div class="promo{{ loop.index }} promo-box">
  323.                                 {% if homePromo.link|length > 0 or homePromo.link != null %}
  324.                                     {% if 'www.lasislas.com' in homePromo.link or 'www.parquetayrona.com' in homePromo.link%}
  325.                                         <a href="{{ homePromo.link }}" target="_blank" rel=”nofollow”>
  326.                                         {% else %}
  327.                                             <a href="{{ homePromo.link }}" target="_blank">
  328.                                             {% endif %}
  329.                                         {% else %}
  330.                                             <a href="#" target="_blank">
  331.                                             {% endif %}
  332.                                             {% set imageGuessedName = (homePromo.link|split('?')|first)|split('/')|last ~ "_" ~ homePromo.id ~ ".jpeg" %}
  333.                                             {% set pathToImage = "assets/" ~ agency_folder.assetStyle() ~ "/img/promo/box/"%}
  334.                                             {% if file_exists(pathToImage ~ imageGuessedName)%}
  335.                                                 {% set imageLink = pathToImage ~ imageGuessedName %}
  336.                                             {% else %}
  337.                                                 {% set imageLink = pathToImage ~ homePromo.id ~ ".jpeg" %}
  338.                                             {% endif %}
  339.                                             <div class="inner">
  340.                                                 <div><img src="/version/{{ homePromo.date| date('U') }}/{{ imageLink }}" ondragstart="return false;" alt="{% if homePromo.title is defined and  homePromo.title!=""%}{{homePromo.title|replace({'/': ' '})}} {% else %}Promociones viajestuplus.com{% endif %}"/></div>
  341.                                                 {% if homePromo.title != null%}
  342.                                                     <div class="texto-encima" style="position: absolute; top: 10px;width: 100%; text-align: center; padding: 1em; line-height: 1.3; text-shadow: -2px 2px 2px #000;">
  343.                                                         <div class="promo-box__title">
  344.                                                             {% if app.user != "" and ( is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_EDIT_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  345.                                                                 <a href="#" class="js-ajax-homePromo" data-id="{{ homePromo.id }}" data-size="picture" data-toggle="modal" data-target="#js-promo-editModal" style="text-shadow: none;">EDITAR</a>
  346.                                                             {% endif %}
  347.                                                             {% if app.user != "" and ( is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_DELETE_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  348.                                                                 <a href="{{ path('aviatur_edit_homepromo_delete', {id: homePromo.id, promoType: promoType}) }}" style="text-shadow: none;">BORRAR</a>
  349.                                                             {% endif %}
  350.                                                             {%if '/' in homePromo.title %}
  351.                                                                 {% set promoTitle= homePromo.title|split('/')%}
  352.                                                                 <h4 style="color: white;line-height: 1.2;">{{promoTitle[0]}}<br>{{promoTitle[1]}}</h4>
  353.                                                                 {% else %}
  354.                                                                 <h4 style="color: white;line-height: 1.2;">{{ homePromo.title }}</h4>
  355.                                                             {% endif %}
  356.                                                         </div>
  357.                                                     </div>
  358.                                                 {% elseif homePromo.title == null and app.user != "" %}
  359.                                                     <div class="texto-encima" style="position: absolute; top: 10px;width: 100%; text-align: center; padding: 1em; line-height: 1.3; text-shadow: -2px 2px 2px #000;">
  360.                                                         <div class="promo-box__title">
  361.                                                             {% if app.user != "" and ( is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_EDIT_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  362.                                                                 <a href="#" class="js-ajax-homePromo" data-id="{{ homePromo.id }}" data-size="picture" data-toggle="modal" data-target="#js-promo-editModal" style="text-shadow: none;">EDITAR</a>
  363.                                                             {% endif %}
  364.                                                             {% if app.user != "" and ( is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_DELETE_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  365.                                                                 <a href="{{ path('aviatur_edit_homepromo_delete', {id: homePromo.id, promoType: promoType}) }}" style="text-shadow: none;">BORRAR</a>
  366.                                                             {% endif %}
  367.                                                         </div>
  368.                                                     </div>
  369.                                                 {% endif %}
  370.                                                 {% if homePromo.titleSwitch != null %}
  371.                                                     <div class="pic-tit">
  372.                                                         <h4>{{ homePromo.price }}<br>{{ homePromo.titleSwitch }}</h4>
  373.                                                     </div>
  374.                                                 {% elseif homePromo.price!=null and homePromo.titleSwitch == null%}
  375.                                                     <div class="pic-tit">
  376.                                                         <h4>{{ homePromo.price }}</h4>
  377.                                                     </div>
  378.                                                 {% endif %}
  379.                                                 {% if homePromo.content != null %}
  380.                                                     <div class="promo-box__conditions">
  381.                                                         {{ homePromo.content }}
  382.                                                     </div>
  383.                                                 {% endif %}
  384.                                                 {% if homePromo.link == null and app.user == ""%}
  385.                                                     <div class="promo-box__link">
  386.                                                         Encuentra esta oferta en el buscador !
  387.                                                     </div>
  388.                                                 {% endif %}
  389.                                                 {% if homePromo.link|length > 0 or homePromo.link != null %}
  390.                                             </a>
  391.                                         {% else %}
  392.                                         </a>
  393.                                     {% endif %}
  394.                             </div>
  395.                             </a>
  396.                         </div>
  397.                     {% endif %}
  398.                 {% endfor %}
  399.             {% endif %}
  400.         </div>
  401.     </div>
  402. </section>
  403. {% endif %} #}