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.   
  111.   .slides {
  112.     display: flex;
  113.     flex-wrap: wrap;
  114.     justify-content: center;
  115.     gap: 15px;
  116.     width: 100% !important;
  117.     height: auto !important;
  118.     padding: 15px;
  119.     transform: none !important;
  120.   }
  121.   
  122.   .promo-box {
  123.     position: relative !important;
  124.     width: 220px !important;
  125.     height: 336px !important;
  126.     opacity: 1 !important;
  127.     display: block !important;
  128.     right: auto !important;
  129.     bottom: auto !important;
  130.     margin: 0 !important;
  131.     flex: 0 0 calc(50% - 15px);
  132.     transition: all 0.3s ease;
  133.   }
  134.   
  135.   .promo-box .inner img {
  136.     width: 100% !important;
  137.     height: auto !important;
  138.     max-height: 336px;
  139.     object-fit: cover;
  140.   }
  141.   
  142.   .buttonNav {
  143.     display: none !important;
  144.   }
  145.   
  146.   /* Media queries para diferentes tamaños de pantalla */
  147.   @media (min-width: 480px) {
  148.     .promo-box {
  149.       flex: 0 0 calc(50% - 15px);
  150.     }
  151.   }
  152.   
  153.   @media (min-width: 768px) {
  154.     .promo-box {
  155.       flex: 0 0 calc(33.333% - 15px);
  156.     }
  157.   }
  158.   
  159.   @media (min-width: 1024px) {
  160.     .carousel.one {
  161.       overflow: visible;
  162.     }
  163.     
  164.     .slides {
  165.       flex-wrap: nowrap;
  166.       justify-content: flex-start;
  167.       padding: 0;
  168.       transform: translateX(0) !important;
  169.     }
  170.     
  171.     .promo-box {
  172.       flex: 0 0 auto;
  173.       margin-right: 15px;
  174.     }
  175.     
  176.     .buttonNav {
  177.       display: table !important;
  178.     }
  179.   }
  180. </style>
  181. <!-- quemado por urgencia de salir a prod se debe refactorizar toda esta sección-->
  182. <div class="carousel one"> 
  183.     <div id="slide-promo" class="slides" style="width: 1075px; height: 400px;"> 
  184.         <!-- Promo 1 -->
  185.         <div class="promo1 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: -320px; opacity: 0; z-index: 5; display: none;">
  186.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/maseuropa" target="_blank">
  187.                 <div class="inner">
  188.                     <div>
  189.                         <img src="https://www.viajestuplus.com.co/version/1743112187/assets/aval_assets/img/promo/box/204.jpeg" 
  190.                              ondragstart="return false;" 
  191.                              alt="Promociones Aviatur.com" 
  192.                              style="width: 220px; height: 336px; display: inline-block;">
  193.                     </div>
  194.                 </div>
  195.             </a>
  196.         </div>
  197.         <!-- Promo 2 -->
  198.         <div class="promo2 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: -555px; opacity: 0; z-index: 4; display: none;">
  199.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/formula" target="_blank">
  200.                 <div class="inner">
  201.                     <div>
  202.                         <img src="https://www.viajestuplus.com.co/version/1743112170/assets/aval_assets/img/promo/box/198.jpeg" 
  203.                              ondragstart="return false;" 
  204.                              alt="Promociones Aviatur.com" 
  205.                              style="width: 220px; height: 336px; display: inline-block;">
  206.                     </div>
  207.                 </div>
  208.             </a>
  209.         </div>
  210.         <!-- Promo 3 -->
  211.         <div class="promo3 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 1325px; opacity: 0; z-index: 4; display: none;">
  212.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/zuana" target="_blank">
  213.                 <div class="inner">
  214.                     <div>
  215.                         <img src="https://www.viajestuplus.com.co/version/1743111993/assets/aval_assets/img/promo/box/zuana_206.jpeg" 
  216.                              ondragstart="return false;" 
  217.                              alt="Promociones Aviatur.com" 
  218.                              style="width: 220px; height: 336px; display: inline-block;">
  219.                     </div>
  220.                 </div>
  221.             </a>
  222.         </div>
  223.         <!-- Promo 4 -->
  224.         <div class="promo4 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 1090px; opacity: 0; z-index: 5; display: none;">
  225.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/maseuropa" target="_blank">
  226.                 <div class="inner">
  227.                     <div>
  228.                         <img src="https://www.viajestuplus.com.co/version/1743111974/assets/aval_assets/img/promo/box/maseuropa_205.jpeg" 
  229.                              ondragstart="return false;" 
  230.                              alt="Promociones Aviatur.com" 
  231.                              style="width: 220px; height: 336px; display: inline-block;">
  232.                     </div>
  233.                 </div>
  234.             </a>
  235.         </div>
  236.         <!-- Promo 5 -->
  237.         <div class="promo5 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 855px; opacity: 1; z-index: 6;">
  238.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/hardrock" target="_blank">
  239.                 <div class="inner">
  240.                     <div>
  241.                         <img src="https://www.viajestuplus.com.co/version/1743111940/assets/aval_assets/img/promo/box/hardrock_203.jpeg" 
  242.                              ondragstart="return false;" 
  243.                              alt="Promociones Aviatur.com" 
  244.                              style="width: 220px; height: 336px; display: inline-block;">
  245.                     </div>
  246.                 </div>
  247.             </a>
  248.         </div>
  249.         {# <!-- Promo 6 -->
  250.         <div class="promo6 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 620px; opacity: 1; z-index: 7;">
  251.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/turkish" target="_blank">
  252.                 <div class="inner">
  253.                     <div>
  254.                         <img src="https://www.viajestuplus.com.co/version/1743111921/assets/aval_assets/img/promo/box/turkish_202.jpeg" 
  255.                              ondragstart="return false;" 
  256.                              alt="Promociones Aviatur.com" 
  257.                              style="width: 220px; height: 336px; display: inline-block;">
  258.                     </div>
  259.                 </div>
  260.             </a>
  261.         </div>
  262.         <!-- Promo 7 -->
  263.         <div class="promo7 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 385px; opacity: 1; z-index: 8;">
  264.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/realmadrid" target="_blank">
  265.                 <div class="inner">
  266.                     <div>
  267.                         <img src="https://www.viajestuplus.com.co/version/1743111895/assets/aval_assets/img/promo/box/199.jpeg" 
  268.                              ondragstart="return false;" 
  269.                              alt="Promociones Aviatur.com" 
  270.                              style="width: 220px; height: 336px; display: inline-block;">
  271.                     </div>
  272.                 </div>
  273.             </a>
  274.         </div>
  275.         <!-- Promo 8 -->
  276.         <div class="promo8 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: 150px; opacity: 1; z-index: 7;">
  277.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/turkish" target="_blank">
  278.                 <div class="inner">
  279.                     <div>
  280.                         <img src="https://www.viajestuplus.com.co/version/1743111880/assets/aval_assets/img/promo/box/200.jpeg" 
  281.                              ondragstart="return false;" 
  282.                              alt="Promociones Aviatur.com" 
  283.                              style="width: 220px; height: 336px; display: inline-block;">
  284.                     </div>
  285.                 </div>
  286.             </a>
  287.         </div>
  288.         <!-- Promo 9 -->
  289.         <div class="promo9 promo-box slideItem" style="width: 220px; height: 336px; bottom: 0px; right: -85px; opacity: 1; z-index: 6;">
  290.             <a href="https://www.viajestuplus.com.co/paquetes/personalizada/turkish" target="_blank">
  291.                 <div class="inner">
  292.                     <div>
  293.                         <img src="https://www.viajestuplus.com.co/version/1743111868/assets/aval_assets/img/promo/box/turkish_201.jpeg" 
  294.                              ondragstart="return false;" 
  295.                              alt="Promociones Aviatur.com" 
  296.                              style="width: 220px; height: 336px; display: inline-block;">
  297.                     </div>
  298.                 </div>
  299.             </a>
  300.         </div>
  301.     </div> #}
  302.     <!-- Navegación (bullets) -->
  303.     <div class="buttonNav" style="display: table; margin-top: 18px;">
  304.         <div class="bullet" style="text-align: center;"></div>
  305.         <div class="bullet" style="text-align: center;"></div>
  306.         <div class="bullet" style="text-align: center;"></div>
  307.         <div class="bullet" style="text-align: center;"></div>
  308.         <div class="bullet" style="text-align: center;"></div>
  309.         <div class="bullet" style="text-align: center;"></div>
  310.         <div class="bullet bulletActive" style="text-align: center;"></div>
  311.         <div class="bullet" style="text-align: center;"></div>
  312.         <div class="bullet" style="text-align: center;"></div>
  313.     </div>
  314. </div>
  315.         {% endif %}
  316. <!--Solo muestra promos-->
  317. {# {% set promosPicture = 0 %}
  318. {% if homePromos is defined %}
  319.     {% for homePromo in homePromos %}
  320.         {% if homePromo.size == "picture" %}
  321.             {% set promosPicture = promosPicture+1 %}
  322.         {% endif %}
  323.     {% endfor %}
  324. {% endif %}
  325. {% if promosPicture is defined and promosPicture>0%}
  326.     <section id="home-promos" class="wrapper-susy" style="margin-top:35px; margin-bottom: 0px">
  327.         <div class="carousel one"> <!-- BEGIN CAROUSEL -->
  328.             <div id="slide-promo" class="slides"> <!-- BEGIN SLIDES -->
  329.                 {% if homePromos is defined %}
  330.                     {% for homePromo in homePromos %}
  331.                         {% if homePromo.size == "picture" %}
  332.                             <div class="promo{{ loop.index }} promo-box">
  333.                                 {% if homePromo.link|length > 0 or homePromo.link != null %}
  334.                                     {% if 'www.lasislas.com' in homePromo.link or 'www.parquetayrona.com' in homePromo.link%}
  335.                                         <a href="{{ homePromo.link }}" target="_blank" rel=”nofollow”>
  336.                                         {% else %}
  337.                                             <a href="{{ homePromo.link }}" target="_blank">
  338.                                             {% endif %}
  339.                                         {% else %}
  340.                                             <a href="#" target="_blank">
  341.                                             {% endif %}
  342.                                             {% set imageGuessedName = (homePromo.link|split('?')|first)|split('/')|last ~ "_" ~ homePromo.id ~ ".jpeg" %}
  343.                                             {% set pathToImage = "assets/" ~ agency_folder.assetStyle() ~ "/img/promo/box/"%}
  344.                                             {% if file_exists(pathToImage ~ imageGuessedName)%}
  345.                                                 {% set imageLink = pathToImage ~ imageGuessedName %}
  346.                                             {% else %}
  347.                                                 {% set imageLink = pathToImage ~ homePromo.id ~ ".jpeg" %}
  348.                                             {% endif %}
  349.                                             <div class="inner">
  350.                                                 <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 Aviatur.com{% endif %}"/></div>
  351.                                                 {% if homePromo.title != null%}
  352.                                                     <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;">
  353.                                                         <div class="promo-box__title">
  354.                                                             {% if app.user != "" and ( is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_EDIT_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  355.                                                                 <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>
  356.                                                             {% endif %}
  357.                                                             {% if app.user != "" and ( is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_DELETE_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  358.                                                                 <a href="{{ path('aviatur_edit_homepromo_delete', {id: homePromo.id, promoType: promoType}) }}" style="text-shadow: none;">BORRAR</a>
  359.                                                             {% endif %}
  360.                                                             {%if '/' in homePromo.title %}
  361.                                                                 {% set promoTitle= homePromo.title|split('/')%}
  362.                                                                 <h4 style="color: white;line-height: 1.2;">{{promoTitle[0]}}<br>{{promoTitle[1]}}</h4>
  363.                                                                 {% else %}
  364.                                                                 <h4 style="color: white;line-height: 1.2;">{{ homePromo.title }}</h4>
  365.                                                             {% endif %}
  366.                                                         </div>
  367.                                                     </div>
  368.                                                 {% elseif homePromo.title == null and app.user != "" %}
  369.                                                     <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;">
  370.                                                         <div class="promo-box__title">
  371.                                                             {% if app.user != "" and ( is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_EDIT_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  372.                                                                 <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>
  373.                                                             {% endif %}
  374.                                                             {% if app.user != "" and ( is_granted('ROLE_AVIATUR_ADMIN_ADMIN_PROMO_PRODUCT_DELETE_' ~ app.session.get('agencyId')) or is_granted('ROLE_SUPER_ADMIN') ) %}
  375.                                                                 <a href="{{ path('aviatur_edit_homepromo_delete', {id: homePromo.id, promoType: promoType}) }}" style="text-shadow: none;">BORRAR</a>
  376.                                                             {% endif %}
  377.                                                         </div>
  378.                                                     </div>
  379.                                                 {% endif %}
  380.                                                 {% if homePromo.titleSwitch != null %}
  381.                                                     <div class="pic-tit">
  382.                                                         <h4>{{ homePromo.price }}<br>{{ homePromo.titleSwitch }}</h4>
  383.                                                     </div>
  384.                                                 {% elseif homePromo.price!=null and homePromo.titleSwitch == null%}
  385.                                                     <div class="pic-tit">
  386.                                                         <h4>{{ homePromo.price }}</h4>
  387.                                                     </div>
  388.                                                 {% endif %}
  389.                                                 {% if homePromo.content != null %}
  390.                                                     <div class="promo-box__conditions">
  391.                                                         {{ homePromo.content }}
  392.                                                     </div>
  393.                                                 {% endif %}
  394.                                                 {% if homePromo.link == null and app.user == ""%}
  395.                                                     <div class="promo-box__link">
  396.                                                         Encuentra esta oferta en el buscador !
  397.                                                     </div>
  398.                                                 {% endif %}
  399.                                                 {% if homePromo.link|length > 0 or homePromo.link != null %}
  400.                                             </a>
  401.                                         {% else %}
  402.                                         </a>
  403.                                     {% endif %}
  404.                             </div>
  405.                             </a>
  406.                         </div>
  407.                     {% endif %}
  408.                 {% endfor %}
  409.             {% endif %}
  410.         </div>
  411.     </div>
  412. </section>
  413. {% endif %} #}