<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* /uniqskills/catalogue/landing_new/landing.html.twig */
class __TwigTemplate_3f210ef0e0032e522a48c48b5f84fb4a extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'meta' => [$this, 'block_meta'],
'customcss' => [$this, 'block_customcss'],
'content' => [$this, 'block_content'],
'customjs' => [$this, 'block_customjs'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "/uniqskills/layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "/uniqskills/catalogue/landing_new/landing.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "/uniqskills/catalogue/landing_new/landing.html.twig"));
$this->parent = $this->load("/uniqskills/layout.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_meta(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "meta"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "meta"));
// line 4
yield " ";
if ((($tmp = !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 4, $this->source); })()), "metaTitle", [], "any", false, false, false, 4))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 5
yield " <meta name=\"title\" content=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 5, $this->source); })()), "metaTitle", [], "any", false, false, false, 5), "html", null, true);
yield "\">
";
}
// line 7
yield " ";
if ((($tmp = !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 7, $this->source); })()), "metaDescription", [], "any", false, false, false, 7))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 8
yield " <meta name=\"description\" content=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 8, $this->source); })()), "metaDescription", [], "any", false, false, false, 8), "html", null, true);
yield "\">
";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 17
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_customcss(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "customcss"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "customcss"));
// line 18
yield " <style>
body {
font-size: 16px !important;
}
@media (max-width: 767px) {
.fabs {
bottom: 150px;
}
}
</style>
<link rel=\"stylesheet\" href=\"/uniqskills/new_landing/stylesheets/main.css?v=1.23\">
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 32
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 33
yield " ";
// line 34
yield " ";
$context["typeParam"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 34, $this->source); })()), "request", [], "any", false, false, false, 34), "query", [], "any", false, false, false, 34), "get", ["apivalue"], "method", false, false, false, 34);
// line 35
yield " ";
if (( !Twig\Extension\CoreExtension::testEmpty((isset($context["typeParam"]) || array_key_exists("typeParam", $context) ? $context["typeParam"] : (function () { throw new RuntimeError('Variable "typeParam" does not exist.', 35, $this->source); })())) && (((isset($context["typeParam"]) || array_key_exists("typeParam", $context) ? $context["typeParam"] : (function () { throw new RuntimeError('Variable "typeParam" does not exist.', 35, $this->source); })()) == "netto") || ((isset($context["typeParam"]) || array_key_exists("typeParam", $context) ? $context["typeParam"] : (function () { throw new RuntimeError('Variable "typeParam" does not exist.', 35, $this->source); })()) == "brutto")))) {
// line 36
yield " ";
$context["initialType"] = (isset($context["typeParam"]) || array_key_exists("typeParam", $context) ? $context["typeParam"] : (function () { throw new RuntimeError('Variable "typeParam" does not exist.', 36, $this->source); })());
// line 37
yield " ";
} else {
// line 38
yield " ";
$context["initialType"] = "netto";
// line 39
yield " ";
}
// line 40
yield " ";
// line 41
yield "
";
// line 43
if (((isset($context["preview"]) || array_key_exists("preview", $context) ? $context["preview"] : (function () { throw new RuntimeError('Variable "preview" does not exist.', 43, $this->source); })()) == true)) {
// line 44
yield " <div class=\"landing-preview-info\">
LANDING PREVIEW
</div>
";
}
// line 48
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 48, $this->source); })()), "request", [], "any", false, false, false, 48), "locale", [], "any", false, false, false, 48) == "es")) {
// line 49
yield " <div style=\"margin-bottom:0px;\" class=\"single-course__bannerSM\" id=\"smb_3798\"></div>
";
}
// line 51
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["landing"]) || array_key_exists("landing", $context) ? $context["landing"] : (function () { throw new RuntimeError('Variable "landing" does not exist.', 51, $this->source); })()), "modules", [], "any", false, false, false, 51));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["module"]) {
// line 52
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "showModule", [], "any", false, false, false, 52) == true)) {
// line 53
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 53) == "promotionBar")) {
// line 54
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/promotionBar.html.twig", 54)->unwrap()->yield($context);
// line 55
yield " ";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 55) == "courseTitle")) {
// line 56
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/courseTitle.html.twig", 56)->unwrap()->yield($context);
// line 57
yield " ";
} elseif (((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 57) == "basicDescription") && CoreExtension::getAttribute($this->env, $this->source, $context["module"], "descriptionCheckboxes", [], "any", true, true, false, 57))) {
// line 58
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/basicDescription.html.twig", 58)->unwrap()->yield($context);
// line 59
yield " ";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 59) == "description")) {
// line 60
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/description.html.twig", 60)->unwrap()->yield($context);
// line 61
yield " ";
} elseif (((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 61) == "finishCourse") && CoreExtension::getAttribute($this->env, $this->source, $context["module"], "json", [], "any", true, true, false, 61))) {
// line 62
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/finishCourse.html.twig", 62)->unwrap()->yield($context);
// line 63
yield " ";
} elseif (((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 63) == "courseContent") && CoreExtension::getAttribute($this->env, $this->source, $context["module"], "points", [], "any", true, true, false, 63))) {
// line 64
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/courseContent.html.twig", 64)->unwrap()->yield($context);
// line 65
yield " ";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 65) == "courseProgram")) {
// line 66
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/courseProgram.html.twig", 66)->unwrap()->yield($context);
// line 67
yield " ";
} elseif (((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 67) == "tutors") && CoreExtension::getAttribute($this->env, $this->source, $context["module"], "tutorsList", [], "any", true, true, false, 67))) {
// line 68
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/tutors.html.twig", 68)->unwrap()->yield($context);
// line 69
yield " ";
} elseif (((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 69) == "teaching") && CoreExtension::getAttribute($this->env, $this->source, $context["module"], "json", [], "any", true, true, false, 69))) {
// line 70
yield " ";
// line 71
yield " ";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 71) == "payment")) {
// line 72
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/payment.html.twig", 72)->unwrap()->yield($context);
// line 73
yield " ";
} elseif (((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 73) == "faq") && CoreExtension::getAttribute($this->env, $this->source, $context["module"], "list", [], "any", true, true, false, 73))) {
// line 74
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/faq.html.twig", 74)->unwrap()->yield($context);
// line 75
yield " ";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 75) == "contact")) {
// line 76
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/contact.html.twig", 76)->unwrap()->yield($context);
// line 77
yield " ";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 77) == "clearHtmlSection")) {
// line 78
yield " <section class=\"clearHtml\">
<a name=\"";
// line 79
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["module"], "type", [], "any", false, false, false, 79), "html", null, true);
yield "-";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["module"], "id", [], "any", false, false, false, 79), "html", null, true);
yield "\"></a>
<div class=\"container\">
<div class=\"row\">
<div class=\"col\">
";
// line 83
yield Twig\Extension\CoreExtension::include($this->env, $context, Twig\Extension\StringLoaderExtension::templateFromString($this->env, CoreExtension::getAttribute($this->env, $this->source, $context["module"], "text", [], "any", false, false, false, 83)));
yield "
</div>
</div>
</div>
</section>
";
}
// line 89
yield " ";
}
// line 90
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['module'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 91
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["suggestedCourses"]) || array_key_exists("suggestedCourses", $context) ? $context["suggestedCourses"] : (function () { throw new RuntimeError('Variable "suggestedCourses" does not exist.', 91, $this->source); })())) > 0)) {
// line 92
yield " ";
yield from $this->load("uniqskills/catalogue/landing_new/landing_partials/forYou.html.twig", 92)->unwrap()->yield($context);
}
// line 94
yield "
<a href=\"";
// line 95
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["referer"]) || array_key_exists("referer", $context) ? $context["referer"] : (function () { throw new RuntimeError('Variable "referer" does not exist.', 95, $this->source); })()), "html", null, true);
yield "\"
class=\"button button--autoWidth button-blueBorder toCategories\"
style=\"margin-left: 0;\">
>> ";
// line 98
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("uniqskills.landing.toCategories"), "html", null, true);
yield " <<
</a>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 105
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_customjs(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "customjs"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "customjs"));
// line 106
yield "
";
// line 107
if ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 107, $this->source); })()), "environment", [], "any", false, false, false, 107) == "dev")) {
// line 108
yield " <script src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("uniqskills/new_landing/js/faq.js"), "html", null, true);
yield "\"></script>
<script src=\"";
// line 109
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("uniqskills/new_landing/js/header.js"), "html", null, true);
yield "\"></script>
<script src=\"";
// line 110
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("uniqskills/new_landing/js/courseprogram.js"), "html", null, true);
yield "\"></script>
<script src=\"";
// line 111
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("uniqskills/new_landing/js/subscriptions.js"), "html", null, true);
yield "\"></script>
<script src=\"";
// line 112
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("uniqskills/new_landing/js/popper.min.js"), "html", null, true);
yield "\"></script>
<script src=\"";
// line 113
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("uniqskills/new_landing/js/bootstrap.min.js"), "html", null, true);
yield "\"></script>
";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, // line 114
(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 114, $this->source); })()), "environment", [], "any", false, false, false, 114) == "prod")) {
// line 115
yield " <script src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("uniqskills/new_landing/js/dist/all.js?ver=1.1"), "html", null, true);
yield "\" defer></script>
";
}
// line 117
yield "
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'course': ";
// line 121
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 121, $this->source); })()), "id", [], "any", false, false, false, 121), "html", null, true);
yield "
});
/**
* Set icon container height in rowIncludes section on mobile screens
* */
function setRowIconHeight() {
var windowWidth = window.innerWidth;
var iconsBack = document.querySelectorAll('.rowIconBack');
if( windowWidth <= 575 ) {
for( var i = 0; i < iconsBack.length; i++ ) {
var backHeight = iconsBack[i].offsetHeight;
var frontHeight = iconsBack[i].previousElementSibling.offsetHeight;
if( backHeight >= frontHeight ) {
iconsBack[i].parentNode.style.height = backHeight + 'px';
} else {
iconsBack[i].parentNode.style.height = frontHeight + 'px';
}
}
}
}
/**
* Rotate icon container in rowincludes section on icon click on mobile screens
* */
function flipIconCards() {
var windowWidth = window.innerWidth;
var icons = document.querySelectorAll('.bgs--small-xs');
var cardIconContainers = document.querySelectorAll('.rowIncludes__oneRow');
var activeIconContainer;
if( windowWidth <= 575 ) {
for (var icon of icons) {
icon.addEventListener('click', function () {
activeIconContainer = this.closest('.rowIncludes__oneRow');
// Remove class hover-manual from all elements .rowIncludes__oneRow
for (var cardContainer of cardIconContainers) {
cardContainer.classList.remove('hover-manual');
}
// Add class hover-manual to parent element who has class rowIncludes__oneRow
this.closest('.rowIncludes__oneRow').classList.add('hover-manual');
});
}
// Remove class hover-manual when user click outside active icon container
document.addEventListener('click', function(e) {
if( activeIconContainer !== undefined && !activeIconContainer.contains(e.target) && typeof(activeIconContainer) !== 'undefined' ) {
for (var cardContainer of cardIconContainers) {
cardContainer.classList.remove('hover-manual');
}
}
});
}
}
/*
* Hides pulsing Tap icon in rowincludes section after 10 seconds when the section is visible
* */
function hideTapIcon() {
var windowWidth = window.innerWidth;
if( windowWidth <= 575 ) {
// this is the target which is observed
var target = document.querySelector('section.rowIncludes');
// configure the intersection observer instance
var intersectionObserverOptions = {
root: null,
rootMargin: '150px',
threshold: 1.0
};
var observer = new IntersectionObserver(onIntersection, intersectionObserverOptions);
// provide the observer with a target
observer.observe(target);
function onIntersection(entries) {
entries.forEach(function (entry) {
target.classList.toggle('visible', entry.intersectionRatio > 0);
// Are we in viewport?
if (entry.intersectionRatio > 0) {
setTimeout(function () {
document.querySelector('.rowIncludes__tap-icon').classList.add('rowIncludes__tap-icon--none');
}, 10000)
}
});
}
}
}
</script>
<script>
\$(document).ready(function () {
const openedModules = sessionStorage.getItem('openedModules');
if (openedModules)
{
openedModules.split(',').forEach(element => \$(`#\${element}`).show());
sessionStorage.removeItem('openedModules');
}
\$('body').on('click', '.sm-download', function (e) {
sendDownloadEvent();
});
\$('body').on('click', function(){
if (\$('#vimeoVideoModalIframe').length > 0)
{
\$('#vimeoVideoModalIframe').attr('src','');
\$('.modal').on('hide.bs.modal', function(){
if (\$('#vimeoVideoModalIframe').contents().find('.renderSuccessModal').length > 0)
{
const visibleModules = \$('.rowCourseProgram__module__elements:not(:hidden)')
.map(function() {return this.id}).toArray().join();
if (visibleModules)
{
sessionStorage.setItem('openedModules', visibleModules);
}
location.reload();
}
});
}
});
\$('.showFreeLessonVimeo').on('click', function () {
var urlVimeo = \$(this).attr('data-vimeoUrl');
\$('#freeVideoModalIframe').attr('src', urlVimeo);
\$('#freeVideoModal').modal();
})
if (\$(window).width() <= 768)
{
if (\$('.iconArrowFreeLession').find('img').length > 0) \$('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-down.svg');
}
\$('.titleFreeLessonBox').on('click', function(){
\$('.freeLessonInCourse').slideToggle('400', function(){
if (\$(this).is(':visible')){
\$('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-up.svg');
} else {
\$('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-down.svg');
}
});
});
\$('.freeAccessModalVimeo').click(function () {
if (\$(this).hasClass('sm-download'))
{
sendDownloadEvent();
}
var currentUrl = \$(this).data('free');
if (\$(this).data('temporary') == true)
{
currentUrl = currentUrl.replace('vimeo.', 'player.vimeo.');
currentUrl = currentUrl.replace('.com/', '.com/video/');
\$('#vimeoVideoModalIframe').attr('src', currentUrl);
\$('#vimeoVideoModal').modal();
}
else
{
var urlLogin = \$(this).data('login');
url = window.location.origin,
videoUrl = currentUrl.split('com/'),
videoNumber = videoUrl[1];
\$('#vimeoVideoModalIframe').attr('src', url + urlLogin + '?modalVideo=' + videoNumber + '&modalCourse=' + ";
// line 316
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 316, $this->source); })()), "id", [], "any", false, false, false, 316), "html", null, true);
yield ");
\$('#vimeoVideoModal').modal();
}
return false;
});
function sendDownloadEvent() {
console.log('clickowanie');
\$.ajax({
type: 'POST',
url: '";
// line 326
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("fmUniqskillsSalesManagoDownload", ["course" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 326, $this->source); })()), "id", [], "any", false, false, false, 326)]), "html", null, true);
yield "',
success: function (data) {
// handle success
},
error: function (error) {
console.error(error);
}
});
}
\$('.freeAccessModalPdf').click(function () {
var urlLogin = \$(this).data('login'),
url = window.location.origin;
\$('#vimeoVideoModalIframe').attr('src', url + urlLogin + '?modalPdf=1');
\$('#vimeoVideoModal').modal();
return false;
});
\$('.menu-link-scroll').click(function (e) {
var width = \$(window).width();
var offsetAdd = 0;
if(width < 768)
{
offsetAdd = -15;
}
e.preventDefault();
var id = \$(this).data('link');
\$('html,body').animate({
scrollTop: (\$('a[name=\"' + id + '\"]').offset().top - 80 - offsetAdd)
}, 1000);
});
// \$('#recipeCarousel').carousel({
// interval: 10000
// });
\$('.carousel .carousel-item').each(function () {
var minPerSlide = 3;
var next = \$(this).next();
if (!next.length) {
next = \$(this).siblings(':first');
}
next.children(':first-child').clone().appendTo(\$(this));
for (var i = 0; i < minPerSlide; i++) {
next = next.next();
if (!next.length) {
next = \$(this).siblings(':first');
}
next.children(':first-child').clone().appendTo(\$(this));
}
});
var courseTitleVer2 = \$('.rowHeader');
var courseTitleVer3 = \$('.rowHeader-mobile-image');
\$(window).on(\"resize\", function (e) {
checkScreenSize(courseTitleVer2);
checkScreenSize(courseTitleVer3);
});
checkScreenSize(courseTitleVer2);
checkScreenSize(courseTitleVer3);
function checkScreenSize(element) {
var newWindowWidth = \$(window).width();
element.each(function () {
var courseTitleImage = \$(this).data('image');
var courseTitleBackground = \$(this).data('background');
var courseTitleBackgroundMobile = \$(this).data('background-mobile');
if (courseTitleImage === 'image') {
if (newWindowWidth <= 768) {
\$(this).css({
'background': \"url('\" + courseTitleBackgroundMobile + \"')\",
'background-size': '100%',
'background-repeat': 'no-repeat'
});
} else {
\$(this).css({
'background': \"url('\" + courseTitleBackground + \"')\",
'background-position': 'right top',
'background-repeat': 'no-repeat',
'background-size': 'cover',
});
}
}
});
}
// Show less description
function showMore2() {
var windowWidth = \$(window).width();
var content = \$(\".rowDescription__short-desc\");
var readMoreButton = \$(\".rowDescription__read-more\");
var readMoreText = readMoreButton.data('read-more');
var readLessText = readMoreButton.data('read-less');
var anchorSection = \$('section.rowDescription__normal > a[name]');
if( windowWidth < 768 ) {
readMoreButton.on('click', function(e) {
e.preventDefault();
if(content.hasClass('active')) {
content.removeClass('rowDescription__short-desc--normal');
content.removeClass('active');
setTimeout(function() {
\$('html,body').animate({
scrollTop: anchorSection.offset().top - 120
}, 1000);
}, 70);
readMoreButton.text(readMoreText);
} else {
content.addClass('active');
content.addClass('rowDescription__short-desc--normal');
readMoreButton.text(readLessText);
}
});
}
}
showMore2();
// Highlight menu link in 2Menu
function highlightMenuLink() {
var lastId = \"\";
var helperHeight = 58;
if( \$(window).width() <= 768) {
helperHeight = 43;
}
var menuItems = \$('.second-menu-slider').find('a');
var topMenuHeight = \$('.second-menu-slider').outerHeight() + helperHeight;
var menuOffsetTop = \$('.second-menu-slider').offset().top;
// scrollItems - list of links with internal anchors
var scrollItems = menuItems.map( function() {
var idSelector = \$(this).attr('href');
idSelector = idSelector.replace(/^#/, '');
var itemAnchor = \$('a[name='+idSelector+']');
if(itemAnchor.length) { return itemAnchor; }
});
var fromTop = \$(this).scrollTop() + topMenuHeight;
var cur = scrollItems.map(function(){
if (\$(this).offset().top < fromTop) {
return this;
}
});
cur = cur[cur.length-1];
var id = cur && cur.length ? cur[0].name : \"\";
if (fromTop > menuOffsetTop && lastId !== id) {
lastId = id;
menuItems.removeClass('active-menu-link');
var currentItemMenu = menuItems.filter('[href=\\\\#'+id+']')[0];
currentItemMenu.classList.add('active-menu-link');
}
}
// Sticky menu
var secondMenu = \$('.rowHeader__textRow__linkAndPrice');
var secondMenuPosition = secondMenu.offset().top;
\$(window).scroll(function() {
var currentPosition = \$(window).scrollTop();
if( currentPosition >= secondMenuPosition) {
secondMenu.addClass('rowHeader__textRow__linkAndPrice--fixed')
} else {
secondMenu.removeClass('rowHeader__textRow__linkAndPrice--fixed');
}
hideTapIcon();
highlightMenuLink();
});
// Tutors slider
\$('.tutors-slider').slick({
slidesToShow: ";
// line 525
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 525, $this->source); })()), "request", [], "any", false, false, false, 525), "locale", [], "any", false, false, false, 525) == "en")) {
yield "2";
} else {
yield "3";
}
yield ",
slidesToScroll: ";
// line 526
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 526, $this->source); })()), "request", [], "any", false, false, false, 526), "locale", [], "any", false, false, false, 526) == "en")) {
yield "2";
} else {
yield "3";
}
yield ",
infinite: true,
autoplay: false,
arrows: false,
dots: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
variableWidth: true,
}
}
]
});
\$('.suggestedCurses__slider').slick({
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
autoplay: false,
arrows: false,
dots: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
variableWidth: true,
}
}
]
});
\$('.second-menu-slider').slick({
slidesToShow: 5,
slidesToScroll: 1,
infinite: false,
autoplay: false,
arrows: true,
prevArrow: '<i class=\"fa fa-angle-left\" aria-hidden=\"true\"></i>',
nextArrow: '<i class=\"fa fa-angle-right\" aria-hidden=\"true\"></i>',
responsive: [
{
breakpoint: 1199,
settings: {
slidesToShow: 5,
slidesToScroll: 1,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
arrows: true
}
}
]
});
setRowIconHeight();
flipIconCards();
});
\$(window).on('resize', function() {
setRowIconHeight();
});
</script>
";
// line 615
if ((($tmp = !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["landing"]) || array_key_exists("landing", $context) ? $context["landing"] : (function () { throw new RuntimeError('Variable "landing" does not exist.', 615, $this->source); })()), "landing", [], "any", false, false, false, 615), "customScripts", [], "any", false, false, false, 615))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 616
yield " <script>
";
// line 617
yield CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["landing"]) || array_key_exists("landing", $context) ? $context["landing"] : (function () { throw new RuntimeError('Variable "landing" does not exist.', 617, $this->source); })()), "landing", [], "any", false, false, false, 617), "customScripts", [], "any", false, false, false, 617);
yield "
</script>
";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "/uniqskills/catalogue/landing_new/landing.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 940 => 617, 937 => 616, 935 => 615, 839 => 526, 831 => 525, 629 => 326, 616 => 316, 418 => 121, 412 => 117, 406 => 115, 404 => 114, 400 => 113, 396 => 112, 392 => 111, 388 => 110, 384 => 109, 379 => 108, 377 => 107, 374 => 106, 361 => 105, 344 => 98, 338 => 95, 335 => 94, 331 => 92, 329 => 91, 315 => 90, 312 => 89, 303 => 83, 294 => 79, 291 => 78, 288 => 77, 285 => 76, 282 => 75, 279 => 74, 276 => 73, 273 => 72, 270 => 71, 268 => 70, 265 => 69, 262 => 68, 259 => 67, 256 => 66, 253 => 65, 250 => 64, 247 => 63, 244 => 62, 241 => 61, 238 => 60, 235 => 59, 232 => 58, 229 => 57, 226 => 56, 223 => 55, 220 => 54, 217 => 53, 214 => 52, 196 => 51, 192 => 49, 189 => 48, 183 => 44, 181 => 43, 177 => 41, 175 => 40, 172 => 39, 169 => 38, 166 => 37, 163 => 36, 160 => 35, 157 => 34, 155 => 33, 142 => 32, 119 => 18, 106 => 17, 91 => 8, 88 => 7, 82 => 5, 79 => 4, 66 => 3, 43 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends '/uniqskills/layout.html.twig' %}
{% block meta %}
{% if course.metaTitle is not empty %}
<meta name=\"title\" content=\"{{ course.metaTitle }}\">
{% endif %}
{% if course.metaDescription is not empty %}
<meta name=\"description\" content=\"{{ course.metaDescription }}\">
{% endif %}
{% endblock %}
{#{% if app.request.locale == 'en' %}#}
{# {% block title %}#}
{# {{ course.name }} - UniqSkills#}
{# {% endblock %}#}
{#{% endif %}#}
{% block customcss %}
<style>
body {
font-size: 16px !important;
}
@media (max-width: 767px) {
.fabs {
bottom: 150px;
}
}
</style>
<link rel=\"stylesheet\" href=\"/uniqskills/new_landing/stylesheets/main.css?v=1.23\">
{% endblock %}
{% block content %}
{# --- Type of price, default NET --- #}
{% set typeParam = app.request.query.get('apivalue') %}
{% if typeParam is not empty and (typeParam == 'netto' or typeParam == 'brutto') %}
{% set initialType = typeParam %}
{% else %}
{% set initialType = 'netto' %}
{% endif %}
{# --- END OF: Type of price, default NET --- #}
{% if preview == true %}
<div class=\"landing-preview-info\">
LANDING PREVIEW
</div>
{% endif %}
{% if app.request.locale == \"es\" %}
<div style=\"margin-bottom:0px;\" class=\"single-course__bannerSM\" id=\"smb_3798\"></div>
{% endif %}
{% for module in landing.modules %}
{% if module.showModule == true %}
{% if module.type == 'promotionBar' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/promotionBar.html.twig' %}
{% elseif module.type == 'courseTitle' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/courseTitle.html.twig' %}
{% elseif module.type == 'basicDescription' and module.descriptionCheckboxes is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/basicDescription.html.twig' %}
{% elseif module.type == 'description' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/description.html.twig' %}
{% elseif module.type == 'finishCourse' and module.json is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/finishCourse.html.twig' %}
{% elseif module.type == 'courseContent' and module.points is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/courseContent.html.twig' %}
{% elseif module.type == 'courseProgram' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/courseProgram.html.twig' %}
{% elseif module.type == 'tutors' and module.tutorsList is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/tutors.html.twig' %}
{% elseif module.type == 'teaching' and module.json is defined %}
{#{% include 'uniqskills/catalogue/landing_partials/teaching.html.twig' %}#}
{% elseif module.type == 'payment' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/payment.html.twig' %}
{% elseif module.type == 'faq' and module.list is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/faq.html.twig' %}
{% elseif module.type == 'contact' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/contact.html.twig' %}
{% elseif module.type == 'clearHtmlSection' %}
<section class=\"clearHtml\">
<a name=\"{{ module.type }}-{{ module.id }}\"></a>
<div class=\"container\">
<div class=\"row\">
<div class=\"col\">
{{ include(template_from_string(module.text|raw)) }}
</div>
</div>
</div>
</section>
{% endif %}
{% endif %}
{% endfor %}
{% if suggestedCourses|length > 0 %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/forYou.html.twig' %}
{% endif %}
<a href=\"{{ referer }}\"
class=\"button button--autoWidth button-blueBorder toCategories\"
style=\"margin-left: 0;\">
>> {{ 'uniqskills.landing.toCategories'|trans }} <<
</a>
{% endblock %}
{% block customjs %}
{% if app.environment == 'dev' %}
<script src=\"{{ asset('uniqskills/new_landing/js/faq.js') }}\"></script>
<script src=\"{{ asset('uniqskills/new_landing/js/header.js') }}\"></script>
<script src=\"{{ asset('uniqskills/new_landing/js/courseprogram.js') }}\"></script>
<script src=\"{{ asset('uniqskills/new_landing/js/subscriptions.js') }}\"></script>
<script src=\"{{ asset('uniqskills/new_landing/js/popper.min.js') }}\"></script>
<script src=\"{{ asset('uniqskills/new_landing/js/bootstrap.min.js') }}\"></script>
{% elseif app.environment == 'prod' %}
<script src=\"{{ asset('uniqskills/new_landing/js/dist/all.js?ver=1.1') }}\" defer></script>
{% endif %}
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'course': {{ course.id }}
});
/**
* Set icon container height in rowIncludes section on mobile screens
* */
function setRowIconHeight() {
var windowWidth = window.innerWidth;
var iconsBack = document.querySelectorAll('.rowIconBack');
if( windowWidth <= 575 ) {
for( var i = 0; i < iconsBack.length; i++ ) {
var backHeight = iconsBack[i].offsetHeight;
var frontHeight = iconsBack[i].previousElementSibling.offsetHeight;
if( backHeight >= frontHeight ) {
iconsBack[i].parentNode.style.height = backHeight + 'px';
} else {
iconsBack[i].parentNode.style.height = frontHeight + 'px';
}
}
}
}
/**
* Rotate icon container in rowincludes section on icon click on mobile screens
* */
function flipIconCards() {
var windowWidth = window.innerWidth;
var icons = document.querySelectorAll('.bgs--small-xs');
var cardIconContainers = document.querySelectorAll('.rowIncludes__oneRow');
var activeIconContainer;
if( windowWidth <= 575 ) {
for (var icon of icons) {
icon.addEventListener('click', function () {
activeIconContainer = this.closest('.rowIncludes__oneRow');
// Remove class hover-manual from all elements .rowIncludes__oneRow
for (var cardContainer of cardIconContainers) {
cardContainer.classList.remove('hover-manual');
}
// Add class hover-manual to parent element who has class rowIncludes__oneRow
this.closest('.rowIncludes__oneRow').classList.add('hover-manual');
});
}
// Remove class hover-manual when user click outside active icon container
document.addEventListener('click', function(e) {
if( activeIconContainer !== undefined && !activeIconContainer.contains(e.target) && typeof(activeIconContainer) !== 'undefined' ) {
for (var cardContainer of cardIconContainers) {
cardContainer.classList.remove('hover-manual');
}
}
});
}
}
/*
* Hides pulsing Tap icon in rowincludes section after 10 seconds when the section is visible
* */
function hideTapIcon() {
var windowWidth = window.innerWidth;
if( windowWidth <= 575 ) {
// this is the target which is observed
var target = document.querySelector('section.rowIncludes');
// configure the intersection observer instance
var intersectionObserverOptions = {
root: null,
rootMargin: '150px',
threshold: 1.0
};
var observer = new IntersectionObserver(onIntersection, intersectionObserverOptions);
// provide the observer with a target
observer.observe(target);
function onIntersection(entries) {
entries.forEach(function (entry) {
target.classList.toggle('visible', entry.intersectionRatio > 0);
// Are we in viewport?
if (entry.intersectionRatio > 0) {
setTimeout(function () {
document.querySelector('.rowIncludes__tap-icon').classList.add('rowIncludes__tap-icon--none');
}, 10000)
}
});
}
}
}
</script>
<script>
\$(document).ready(function () {
const openedModules = sessionStorage.getItem('openedModules');
if (openedModules)
{
openedModules.split(',').forEach(element => \$(`#\${element}`).show());
sessionStorage.removeItem('openedModules');
}
\$('body').on('click', '.sm-download', function (e) {
sendDownloadEvent();
});
\$('body').on('click', function(){
if (\$('#vimeoVideoModalIframe').length > 0)
{
\$('#vimeoVideoModalIframe').attr('src','');
\$('.modal').on('hide.bs.modal', function(){
if (\$('#vimeoVideoModalIframe').contents().find('.renderSuccessModal').length > 0)
{
const visibleModules = \$('.rowCourseProgram__module__elements:not(:hidden)')
.map(function() {return this.id}).toArray().join();
if (visibleModules)
{
sessionStorage.setItem('openedModules', visibleModules);
}
location.reload();
}
});
}
});
\$('.showFreeLessonVimeo').on('click', function () {
var urlVimeo = \$(this).attr('data-vimeoUrl');
\$('#freeVideoModalIframe').attr('src', urlVimeo);
\$('#freeVideoModal').modal();
})
if (\$(window).width() <= 768)
{
if (\$('.iconArrowFreeLession').find('img').length > 0) \$('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-down.svg');
}
\$('.titleFreeLessonBox').on('click', function(){
\$('.freeLessonInCourse').slideToggle('400', function(){
if (\$(this).is(':visible')){
\$('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-up.svg');
} else {
\$('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-down.svg');
}
});
});
\$('.freeAccessModalVimeo').click(function () {
if (\$(this).hasClass('sm-download'))
{
sendDownloadEvent();
}
var currentUrl = \$(this).data('free');
if (\$(this).data('temporary') == true)
{
currentUrl = currentUrl.replace('vimeo.', 'player.vimeo.');
currentUrl = currentUrl.replace('.com/', '.com/video/');
\$('#vimeoVideoModalIframe').attr('src', currentUrl);
\$('#vimeoVideoModal').modal();
}
else
{
var urlLogin = \$(this).data('login');
url = window.location.origin,
videoUrl = currentUrl.split('com/'),
videoNumber = videoUrl[1];
\$('#vimeoVideoModalIframe').attr('src', url + urlLogin + '?modalVideo=' + videoNumber + '&modalCourse=' + {{ course.id }});
\$('#vimeoVideoModal').modal();
}
return false;
});
function sendDownloadEvent() {
console.log('clickowanie');
\$.ajax({
type: 'POST',
url: '{{ path('fmUniqskillsSalesManagoDownload', {'course': course.id}) }}',
success: function (data) {
// handle success
},
error: function (error) {
console.error(error);
}
});
}
\$('.freeAccessModalPdf').click(function () {
var urlLogin = \$(this).data('login'),
url = window.location.origin;
\$('#vimeoVideoModalIframe').attr('src', url + urlLogin + '?modalPdf=1');
\$('#vimeoVideoModal').modal();
return false;
});
\$('.menu-link-scroll').click(function (e) {
var width = \$(window).width();
var offsetAdd = 0;
if(width < 768)
{
offsetAdd = -15;
}
e.preventDefault();
var id = \$(this).data('link');
\$('html,body').animate({
scrollTop: (\$('a[name=\"' + id + '\"]').offset().top - 80 - offsetAdd)
}, 1000);
});
// \$('#recipeCarousel').carousel({
// interval: 10000
// });
\$('.carousel .carousel-item').each(function () {
var minPerSlide = 3;
var next = \$(this).next();
if (!next.length) {
next = \$(this).siblings(':first');
}
next.children(':first-child').clone().appendTo(\$(this));
for (var i = 0; i < minPerSlide; i++) {
next = next.next();
if (!next.length) {
next = \$(this).siblings(':first');
}
next.children(':first-child').clone().appendTo(\$(this));
}
});
var courseTitleVer2 = \$('.rowHeader');
var courseTitleVer3 = \$('.rowHeader-mobile-image');
\$(window).on(\"resize\", function (e) {
checkScreenSize(courseTitleVer2);
checkScreenSize(courseTitleVer3);
});
checkScreenSize(courseTitleVer2);
checkScreenSize(courseTitleVer3);
function checkScreenSize(element) {
var newWindowWidth = \$(window).width();
element.each(function () {
var courseTitleImage = \$(this).data('image');
var courseTitleBackground = \$(this).data('background');
var courseTitleBackgroundMobile = \$(this).data('background-mobile');
if (courseTitleImage === 'image') {
if (newWindowWidth <= 768) {
\$(this).css({
'background': \"url('\" + courseTitleBackgroundMobile + \"')\",
'background-size': '100%',
'background-repeat': 'no-repeat'
});
} else {
\$(this).css({
'background': \"url('\" + courseTitleBackground + \"')\",
'background-position': 'right top',
'background-repeat': 'no-repeat',
'background-size': 'cover',
});
}
}
});
}
// Show less description
function showMore2() {
var windowWidth = \$(window).width();
var content = \$(\".rowDescription__short-desc\");
var readMoreButton = \$(\".rowDescription__read-more\");
var readMoreText = readMoreButton.data('read-more');
var readLessText = readMoreButton.data('read-less');
var anchorSection = \$('section.rowDescription__normal > a[name]');
if( windowWidth < 768 ) {
readMoreButton.on('click', function(e) {
e.preventDefault();
if(content.hasClass('active')) {
content.removeClass('rowDescription__short-desc--normal');
content.removeClass('active');
setTimeout(function() {
\$('html,body').animate({
scrollTop: anchorSection.offset().top - 120
}, 1000);
}, 70);
readMoreButton.text(readMoreText);
} else {
content.addClass('active');
content.addClass('rowDescription__short-desc--normal');
readMoreButton.text(readLessText);
}
});
}
}
showMore2();
// Highlight menu link in 2Menu
function highlightMenuLink() {
var lastId = \"\";
var helperHeight = 58;
if( \$(window).width() <= 768) {
helperHeight = 43;
}
var menuItems = \$('.second-menu-slider').find('a');
var topMenuHeight = \$('.second-menu-slider').outerHeight() + helperHeight;
var menuOffsetTop = \$('.second-menu-slider').offset().top;
// scrollItems - list of links with internal anchors
var scrollItems = menuItems.map( function() {
var idSelector = \$(this).attr('href');
idSelector = idSelector.replace(/^#/, '');
var itemAnchor = \$('a[name='+idSelector+']');
if(itemAnchor.length) { return itemAnchor; }
});
var fromTop = \$(this).scrollTop() + topMenuHeight;
var cur = scrollItems.map(function(){
if (\$(this).offset().top < fromTop) {
return this;
}
});
cur = cur[cur.length-1];
var id = cur && cur.length ? cur[0].name : \"\";
if (fromTop > menuOffsetTop && lastId !== id) {
lastId = id;
menuItems.removeClass('active-menu-link');
var currentItemMenu = menuItems.filter('[href=\\\\#'+id+']')[0];
currentItemMenu.classList.add('active-menu-link');
}
}
// Sticky menu
var secondMenu = \$('.rowHeader__textRow__linkAndPrice');
var secondMenuPosition = secondMenu.offset().top;
\$(window).scroll(function() {
var currentPosition = \$(window).scrollTop();
if( currentPosition >= secondMenuPosition) {
secondMenu.addClass('rowHeader__textRow__linkAndPrice--fixed')
} else {
secondMenu.removeClass('rowHeader__textRow__linkAndPrice--fixed');
}
hideTapIcon();
highlightMenuLink();
});
// Tutors slider
\$('.tutors-slider').slick({
slidesToShow: {% if app.request.locale == 'en' %}2{% else %}3{% endif %},
slidesToScroll: {% if app.request.locale == 'en' %}2{% else %}3{% endif %},
infinite: true,
autoplay: false,
arrows: false,
dots: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
variableWidth: true,
}
}
]
});
\$('.suggestedCurses__slider').slick({
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
autoplay: false,
arrows: false,
dots: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
variableWidth: true,
}
}
]
});
\$('.second-menu-slider').slick({
slidesToShow: 5,
slidesToScroll: 1,
infinite: false,
autoplay: false,
arrows: true,
prevArrow: '<i class=\"fa fa-angle-left\" aria-hidden=\"true\"></i>',
nextArrow: '<i class=\"fa fa-angle-right\" aria-hidden=\"true\"></i>',
responsive: [
{
breakpoint: 1199,
settings: {
slidesToShow: 5,
slidesToScroll: 1,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
arrows: true
}
}
]
});
setRowIconHeight();
flipIconCards();
});
\$(window).on('resize', function() {
setRowIconHeight();
});
</script>
{% if landing.landing.customScripts is not empty %}
<script>
{{ landing.landing.customScripts|raw }}
</script>
{% endif %}
{% endblock %}
", "/uniqskills/catalogue/landing_new/landing.html.twig", "/app/test/global_order_system/templates/uniqskills/catalogue/landing_new/landing.html.twig");
}
}