templates/uniqskills/catalogue/landing_new/landing.html.twig line 1

Open in your IDE?
  1. {% extends '/uniqskills/layout.html.twig' %}
  2. {% block meta %}
  3.     {% if course.metaTitle is not empty %}
  4.         <meta name="title" content="{{ course.metaTitle }}">
  5.     {% endif %}
  6.     {% if course.metaDescription is not empty %}
  7.         <meta name="description" content="{{ course.metaDescription }}">
  8.     {% endif %}
  9. {% endblock %}
  10. {#{% if app.request.locale == 'en' %}#}
  11. {#    {% block title %}#}
  12. {#        {{ course.name }} - UniqSkills#}
  13. {#    {% endblock %}#}
  14. {#{% endif %}#}
  15. {% block customcss %}
  16.     <style>
  17.         body {
  18.             font-size: 16px !important;
  19.         }
  20.         @media (max-width: 767px) {
  21.             .fabs {
  22.                 bottom: 150px;
  23.             }
  24.         }
  25.     </style>
  26.     <link rel="stylesheet" href="/uniqskills/new_landing/stylesheets/main.css?v=1.23">
  27. {% endblock %}
  28. {% block content %}
  29.     {# --- Type of price, default NET ---  #}
  30.     {% set typeParam = app.request.query.get('apivalue') %}
  31.     {% if typeParam is not empty and (typeParam == 'netto' or typeParam == 'brutto') %}
  32.         {% set initialType = typeParam %}
  33.     {% else %}
  34.         {% set initialType = 'netto' %}
  35.     {% endif %}
  36.     {# --- END OF: Type of price, default NET ---  #}
  37.     {% if preview == true %}
  38.         <div class="landing-preview-info">
  39.             LANDING PREVIEW
  40.         </div>
  41.     {% endif %}
  42.     {% if app.request.locale == "es" %}
  43.         <div style="margin-bottom:0px;" class="single-course__bannerSM" id="smb_3798"></div>
  44.     {% endif %}
  45.     {% for module in landing.modules %}
  46.         {% if module.showModule == true %}
  47.             {% if module.type == 'promotionBar' %}
  48.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/promotionBar.html.twig' %}
  49.             {% elseif module.type == 'courseTitle' %}
  50.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/courseTitle.html.twig' %}
  51.             {% elseif module.type == 'basicDescription' and module.descriptionCheckboxes is defined %}
  52.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/basicDescription.html.twig' %}
  53.             {% elseif module.type == 'description' %}
  54.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/description.html.twig' %}
  55.             {% elseif module.type == 'finishCourse' and module.json is defined  %}
  56.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/finishCourse.html.twig' %}
  57.             {% elseif module.type == 'courseContent' and module.points is defined %}
  58.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/courseContent.html.twig' %}
  59.             {% elseif module.type == 'courseProgram' %}
  60.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/courseProgram.html.twig' %}
  61.             {% elseif module.type == 'tutors' and module.tutorsList is defined %}
  62.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/tutors.html.twig' %}
  63.             {% elseif module.type == 'teaching' and module.json is defined  %}
  64.                 {#{% include 'uniqskills/catalogue/landing_partials/teaching.html.twig' %}#}
  65.             {% elseif module.type == 'payment' %}
  66.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/payment.html.twig' %}
  67.             {% elseif module.type == 'faq' and module.list is defined %}
  68.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/faq.html.twig' %}
  69.             {% elseif module.type == 'contact' %}
  70.                 {% include 'uniqskills/catalogue/landing_new/landing_partials/contact.html.twig' %}
  71.             {% elseif module.type == 'clearHtmlSection' %}
  72.                 <section class="clearHtml">
  73.                     <a name="{{ module.type }}-{{ module.id }}"></a>
  74.                     <div class="container">
  75.                         <div class="row">
  76.                             <div class="col">
  77.                                 {{ include(template_from_string(module.text|raw)) }}
  78.                             </div>
  79.                         </div>
  80.                     </div>
  81.                 </section>
  82.             {% endif %}
  83.         {% endif %}
  84.     {% endfor %}
  85. {% if suggestedCourses|length > 0 %}
  86.     {% include 'uniqskills/catalogue/landing_new/landing_partials/forYou.html.twig' %}
  87. {% endif %}
  88. <a href="{{ referer }}"
  89.    class="button button--autoWidth button-blueBorder toCategories"
  90.    style="margin-left: 0;">
  91.     >> {{ 'uniqskills.landing.toCategories'|trans }} <<
  92. </a>
  93. {% endblock %}
  94. {% block customjs %}
  95.     {% if app.environment == 'dev' %}
  96.         <script src="{{ asset('uniqskills/new_landing/js/faq.js') }}"></script>
  97.         <script src="{{ asset('uniqskills/new_landing/js/header.js') }}"></script>
  98.         <script src="{{ asset('uniqskills/new_landing/js/courseprogram.js') }}"></script>
  99.         <script src="{{ asset('uniqskills/new_landing/js/subscriptions.js') }}"></script>
  100.         <script src="{{ asset('uniqskills/new_landing/js/popper.min.js') }}"></script>
  101.         <script src="{{ asset('uniqskills/new_landing/js/bootstrap.min.js') }}"></script>
  102.     {% elseif app.environment == 'prod' %}
  103.         <script src="{{ asset('uniqskills/new_landing/js/dist/all.js?ver=1.1') }}" defer></script>
  104.     {% endif %}
  105.     <script>
  106.         window.dataLayer = window.dataLayer || [];
  107.         window.dataLayer.push({
  108.             'course': {{ course.id }}
  109.         });
  110.         /**
  111.          * Set icon container height in rowIncludes section on mobile screens
  112.          * */
  113.         function setRowIconHeight() {
  114.             var windowWidth = window.innerWidth;
  115.             var iconsBack = document.querySelectorAll('.rowIconBack');
  116.             if( windowWidth <= 575 ) {
  117.                 for( var i = 0; i < iconsBack.length; i++ ) {
  118.                     var backHeight = iconsBack[i].offsetHeight;
  119.                     var frontHeight = iconsBack[i].previousElementSibling.offsetHeight;
  120.                     if( backHeight >= frontHeight ) {
  121.                         iconsBack[i].parentNode.style.height = backHeight + 'px';
  122.                     } else {
  123.                         iconsBack[i].parentNode.style.height = frontHeight + 'px';
  124.                     }
  125.                 }
  126.             }
  127.         }
  128.         /**
  129.          * Rotate icon container in rowincludes section on icon click on mobile screens
  130.          * */
  131.         function flipIconCards() {
  132.             var windowWidth = window.innerWidth;
  133.             var icons = document.querySelectorAll('.bgs--small-xs');
  134.             var cardIconContainers = document.querySelectorAll('.rowIncludes__oneRow');
  135.             var activeIconContainer;
  136.             if( windowWidth <= 575 ) {
  137.                 for (var icon of icons) {
  138.                     icon.addEventListener('click', function () {
  139.                         activeIconContainer = this.closest('.rowIncludes__oneRow');
  140.                         // Remove class hover-manual from all elements .rowIncludes__oneRow
  141.                         for (var cardContainer of cardIconContainers) {
  142.                             cardContainer.classList.remove('hover-manual');
  143.                         }
  144.                         // Add class hover-manual to parent element who has class rowIncludes__oneRow
  145.                         this.closest('.rowIncludes__oneRow').classList.add('hover-manual');
  146.                     });
  147.                 }
  148.                 // Remove class hover-manual when user click outside active icon container
  149.                 document.addEventListener('click', function(e) {
  150.                     if( activeIconContainer !== undefined && !activeIconContainer.contains(e.target) && typeof(activeIconContainer) !== 'undefined' ) {
  151.                         for (var cardContainer of cardIconContainers) {
  152.                             cardContainer.classList.remove('hover-manual');
  153.                         }
  154.                     }
  155.                 });
  156.             }
  157.         }
  158.         /*
  159.         *  Hides pulsing Tap icon in rowincludes section after 10 seconds when the section is visible
  160.         * */
  161.         function hideTapIcon() {
  162.             var windowWidth = window.innerWidth;
  163.             if( windowWidth <= 575 ) {
  164.                 // this is the target which is observed
  165.                 var target = document.querySelector('section.rowIncludes');
  166.                 // configure the intersection observer instance
  167.                 var intersectionObserverOptions = {
  168.                     root: null,
  169.                     rootMargin: '150px',
  170.                     threshold: 1.0
  171.                 };
  172.                 var observer = new IntersectionObserver(onIntersection, intersectionObserverOptions);
  173.                 // provide the observer with a target
  174.                 observer.observe(target);
  175.                 function onIntersection(entries) {
  176.                     entries.forEach(function (entry) {
  177.                         target.classList.toggle('visible', entry.intersectionRatio > 0);
  178.                         // Are we in viewport?
  179.                         if (entry.intersectionRatio > 0) {
  180.                             setTimeout(function () {
  181.                                 document.querySelector('.rowIncludes__tap-icon').classList.add('rowIncludes__tap-icon--none');
  182.                             }, 10000)
  183.                         }
  184.                     });
  185.                 }
  186.             }
  187.         }
  188.     </script>
  189.     <script>
  190.         $(document).ready(function () {
  191.             const openedModules = sessionStorage.getItem('openedModules');
  192.             if (openedModules)
  193.             {
  194.                 openedModules.split(',').forEach(element => $(`#${element}`).show());
  195.                 sessionStorage.removeItem('openedModules');
  196.             }
  197.             $('body').on('click', '.sm-download', function (e) {
  198.                 sendDownloadEvent();
  199.             });
  200.             $('body').on('click', function(){
  201.                 if ($('#vimeoVideoModalIframe').length > 0)
  202.                 {
  203.                     $('#vimeoVideoModalIframe').attr('src','');
  204.                     $('.modal').on('hide.bs.modal', function(){
  205.                         if ($('#vimeoVideoModalIframe').contents().find('.renderSuccessModal').length > 0)
  206.                         {
  207.                             const visibleModules = $('.rowCourseProgram__module__elements:not(:hidden)')
  208.                                 .map(function() {return this.id}).toArray().join();
  209.                             if (visibleModules)
  210.                             {
  211.                                 sessionStorage.setItem('openedModules', visibleModules);
  212.                             }
  213.                             location.reload();
  214.                         }
  215.                     });
  216.                 }
  217.             });
  218.             $('.showFreeLessonVimeo').on('click', function () {
  219.                 var urlVimeo = $(this).attr('data-vimeoUrl');
  220.                 $('#freeVideoModalIframe').attr('src', urlVimeo);
  221.                 $('#freeVideoModal').modal();
  222.             })
  223.             if ($(window).width() <= 768)
  224.             {
  225.                 if ($('.iconArrowFreeLession').find('img').length > 0) $('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-down.svg');
  226.             }
  227.             $('.titleFreeLessonBox').on('click', function(){
  228.                 $('.freeLessonInCourse').slideToggle('400', function(){
  229.                     if ($(this).is(':visible')){
  230.                         $('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-up.svg');
  231.                     } else {
  232.                         $('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-down.svg');
  233.                     }
  234.                 });
  235.             });
  236.             $('.freeAccessModalVimeo').click(function () {
  237.                 if ($(this).hasClass('sm-download'))
  238.                 {
  239.                     sendDownloadEvent();
  240.                 }
  241.                 var currentUrl = $(this).data('free');
  242.                 if ($(this).data('temporary') == true)
  243.                 {
  244.                     currentUrl = currentUrl.replace('vimeo.', 'player.vimeo.');
  245.                     currentUrl = currentUrl.replace('.com/', '.com/video/');
  246.                     $('#vimeoVideoModalIframe').attr('src', currentUrl);
  247.                     $('#vimeoVideoModal').modal();
  248.                 }
  249.                 else
  250.                 {
  251.                     var urlLogin = $(this).data('login');
  252.                         url = window.location.origin,
  253.                         videoUrl = currentUrl.split('com/'),
  254.                         videoNumber =  videoUrl[1];
  255.                     $('#vimeoVideoModalIframe').attr('src', url + urlLogin + '?modalVideo=' + videoNumber + '&modalCourse=' + {{ course.id }});
  256.                     $('#vimeoVideoModal').modal();
  257.                 }
  258.                 return false;
  259.             });
  260.             function sendDownloadEvent() {
  261.                 console.log('clickowanie');
  262.                 $.ajax({
  263.                     type: 'POST',
  264.                     url: '{{ path('fmUniqskillsSalesManagoDownload', {'course': course.id}) }}',
  265.                     success: function (data) {
  266.                         // handle success
  267.                     },
  268.                     error: function (error) {
  269.                         console.error(error);
  270.                     }
  271.                 });
  272.             }
  273.             $('.freeAccessModalPdf').click(function () {
  274.                 var urlLogin = $(this).data('login'),
  275.                     url = window.location.origin;
  276.                 $('#vimeoVideoModalIframe').attr('src', url + urlLogin + '?modalPdf=1');
  277.                 $('#vimeoVideoModal').modal();
  278.                 return false;
  279.             });
  280.             $('.menu-link-scroll').click(function (e) {
  281.                 var width = $(window).width();
  282.                 var offsetAdd = 0;
  283.                 if(width < 768)
  284.                 {
  285.                     offsetAdd = -15;
  286.                 }
  287.                 e.preventDefault();
  288.                 var id = $(this).data('link');
  289.                 $('html,body').animate({
  290.                     scrollTop: ($('a[name="' + id + '"]').offset().top - 80 - offsetAdd)
  291.                 }, 1000);
  292.             });
  293.             // $('#recipeCarousel').carousel({
  294.             //     interval: 10000
  295.             // });
  296.             $('.carousel .carousel-item').each(function () {
  297.                 var minPerSlide = 3;
  298.                 var next = $(this).next();
  299.                 if (!next.length) {
  300.                     next = $(this).siblings(':first');
  301.                 }
  302.                 next.children(':first-child').clone().appendTo($(this));
  303.                 for (var i = 0; i < minPerSlide; i++) {
  304.                     next = next.next();
  305.                     if (!next.length) {
  306.                         next = $(this).siblings(':first');
  307.                     }
  308.                     next.children(':first-child').clone().appendTo($(this));
  309.                 }
  310.             });
  311.             var courseTitleVer2 = $('.rowHeader');
  312.             var courseTitleVer3 = $('.rowHeader-mobile-image');
  313.             $(window).on("resize", function (e) {
  314.                 checkScreenSize(courseTitleVer2);
  315.                 checkScreenSize(courseTitleVer3);
  316.             });
  317.             checkScreenSize(courseTitleVer2);
  318.             checkScreenSize(courseTitleVer3);
  319.             function checkScreenSize(element) {
  320.                 var newWindowWidth = $(window).width();
  321.                 element.each(function () {
  322.                     var courseTitleImage = $(this).data('image');
  323.                     var courseTitleBackground = $(this).data('background');
  324.                     var courseTitleBackgroundMobile = $(this).data('background-mobile');
  325.                     if (courseTitleImage === 'image') {
  326.                         if (newWindowWidth <= 768) {
  327.                             $(this).css({
  328.                                 'background': "url('" + courseTitleBackgroundMobile + "')",
  329.                                 'background-size': '100%',
  330.                                 'background-repeat': 'no-repeat'
  331.                             });
  332.                         } else {
  333.                             $(this).css({
  334.                                 'background': "url('" + courseTitleBackground + "')",
  335.                                 'background-position': 'right top',
  336.                                 'background-repeat': 'no-repeat',
  337.                                 'background-size': 'cover',
  338.                             });
  339.                         }
  340.                     }
  341.                 });
  342.             }
  343.             // Show less description
  344.             function showMore2() {
  345.                 var windowWidth = $(window).width();
  346.                 var content = $(".rowDescription__short-desc");
  347.                 var readMoreButton = $(".rowDescription__read-more");
  348.                 var readMoreText = readMoreButton.data('read-more');
  349.                 var readLessText = readMoreButton.data('read-less');
  350.                 var anchorSection = $('section.rowDescription__normal > a[name]');
  351.                 if( windowWidth < 768 ) {
  352.                     readMoreButton.on('click', function(e) {
  353.                         e.preventDefault();
  354.                         if(content.hasClass('active')) {
  355.                             content.removeClass('rowDescription__short-desc--normal');
  356.                             content.removeClass('active');
  357.                             setTimeout(function() {
  358.                                 $('html,body').animate({
  359.                                     scrollTop: anchorSection.offset().top - 120
  360.                                 }, 1000);
  361.                             }, 70);
  362.                             readMoreButton.text(readMoreText);
  363.                         } else {
  364.                             content.addClass('active');
  365.                             content.addClass('rowDescription__short-desc--normal');
  366.                             readMoreButton.text(readLessText);
  367.                         }
  368.                     });
  369.                 }
  370.             }
  371.             showMore2();
  372.             // Highlight menu link in 2Menu
  373.             function highlightMenuLink() {
  374.                 var lastId = "";
  375.                 var helperHeight = 58;
  376.                 if( $(window).width() <= 768) {
  377.                     helperHeight = 43;
  378.                 }
  379.                 var menuItems = $('.second-menu-slider').find('a');
  380.                 var topMenuHeight = $('.second-menu-slider').outerHeight() + helperHeight;
  381.                 var menuOffsetTop = $('.second-menu-slider').offset().top;
  382.                 // scrollItems - list of links with internal anchors
  383.                 var scrollItems = menuItems.map( function() {
  384.                     var idSelector = $(this).attr('href');
  385.                     idSelector = idSelector.replace(/^#/, '');
  386.                     var itemAnchor = $('a[name='+idSelector+']');
  387.                     if(itemAnchor.length) { return itemAnchor; }
  388.                 });
  389.                 var fromTop = $(this).scrollTop() + topMenuHeight;
  390.                 var cur = scrollItems.map(function(){
  391.                     if ($(this).offset().top < fromTop) {
  392.                         return this;
  393.                     }
  394.                 });
  395.                 cur = cur[cur.length-1];
  396.                 var id = cur && cur.length ? cur[0].name : "";
  397.                 if (fromTop > menuOffsetTop && lastId !== id) {
  398.                     lastId = id;
  399.                     menuItems.removeClass('active-menu-link');
  400.                     var currentItemMenu = menuItems.filter('[href=\\#'+id+']')[0];
  401.                     currentItemMenu.classList.add('active-menu-link');
  402.                 }
  403.             }
  404.             // Sticky menu
  405.             var secondMenu = $('.rowHeader__textRow__linkAndPrice');
  406.             var secondMenuPosition = secondMenu.offset().top;
  407.             $(window).scroll(function() {
  408.                 var currentPosition = $(window).scrollTop();
  409.                 if( currentPosition >=  secondMenuPosition) {
  410.                     secondMenu.addClass('rowHeader__textRow__linkAndPrice--fixed')
  411.                 } else {
  412.                     secondMenu.removeClass('rowHeader__textRow__linkAndPrice--fixed');
  413.                 }
  414.                 hideTapIcon();
  415.                 highlightMenuLink();
  416.             });
  417.             // Tutors slider
  418.             $('.tutors-slider').slick({
  419.                 slidesToShow: {% if app.request.locale == 'en' %}2{% else %}3{% endif %},
  420.                 slidesToScroll: {% if app.request.locale == 'en' %}2{% else %}3{% endif %},
  421.                 infinite: true,
  422.                 autoplay: false,
  423.                 arrows: false,
  424.                 dots: true,
  425.                 responsive: [
  426.                     {
  427.                         breakpoint: 992,
  428.                         settings: {
  429.                             slidesToShow: 2,
  430.                             slidesToScroll: 2,
  431.                         }
  432.                     },
  433.                     {
  434.                         breakpoint: 768,
  435.                         settings: {
  436.                             slidesToShow: 1,
  437.                             slidesToScroll: 1,
  438.                             variableWidth: true,
  439.                         }
  440.                     }
  441.                 ]
  442.             });
  443.             $('.suggestedCurses__slider').slick({
  444.                 slidesToShow: 3,
  445.                 slidesToScroll: 3,
  446.                 infinite: true,
  447.                 autoplay: false,
  448.                 arrows: false,
  449.                 dots: true,
  450.                 responsive: [
  451.                     {
  452.                         breakpoint: 992,
  453.                         settings: {
  454.                             slidesToShow: 2,
  455.                             slidesToScroll: 2,
  456.                         }
  457.                     },
  458.                     {
  459.                         breakpoint: 768,
  460.                         settings: {
  461.                             slidesToShow: 1,
  462.                             slidesToScroll: 1,
  463.                             variableWidth: true,
  464.                         }
  465.                     }
  466.                 ]
  467.             });
  468.             $('.second-menu-slider').slick({
  469.                 slidesToShow: 5,
  470.                 slidesToScroll: 1,
  471.                 infinite: false,
  472.                 autoplay: false,
  473.                 arrows: true,
  474.                 prevArrow: '<i class="fa fa-angle-left" aria-hidden="true"></i>',
  475.                 nextArrow: '<i class="fa fa-angle-right" aria-hidden="true"></i>',
  476.                 responsive: [
  477.                     {
  478.                         breakpoint: 1199,
  479.                         settings: {
  480.                             slidesToShow: 5,
  481.                             slidesToScroll: 1,
  482.                         }
  483.                     },
  484.                     {
  485.                         breakpoint: 768,
  486.                         settings: {
  487.                             slidesToShow: 4,
  488.                             slidesToScroll: 1,
  489.                             arrows: true
  490.                         }
  491.                     }
  492.                 ]
  493.             });
  494.             setRowIconHeight();
  495.             flipIconCards();
  496.         });
  497.         $(window).on('resize', function() {
  498.             setRowIconHeight();
  499.         });
  500.     </script>
  501.     {% if landing.landing.customScripts is not empty %}
  502.         <script>
  503.             {{ landing.landing.customScripts|raw }}
  504.         </script>
  505.     {% endif %}
  506. {% endblock %}