From 9ddc3f7b1ec9576285612aa8c744514e14172bbd Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Tue, 9 Apr 2024 16:55:17 -0400 Subject: [PATCH] Pipedrive is removing an instance because of multi-auth. Started to clean up those templates. --- .../Pipedrive Learn - CRM/_head.html.liquid | 40 +++++++++---------- .../Pipedrive Learn - CRM/sign_up.html.liquid | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Custom_Templates/customer_templates/Pipedrive Learn - CRM/_head.html.liquid b/Custom_Templates/customer_templates/Pipedrive Learn - CRM/_head.html.liquid index 37d517c3..bed4ec77 100644 --- a/Custom_Templates/customer_templates/Pipedrive Learn - CRM/_head.html.liquid +++ b/Custom_Templates/customer_templates/Pipedrive Learn - CRM/_head.html.liquid @@ -76,13 +76,13 @@ console.log('wrong language initialized', selectedLanguage); window.current_language = 'en'; } - - const pathParts = window.location.pathname.split('/').slice(1); + + const pathParts = window.location.pathname.split('/').slice(1); if ( - (pathParts.length === 1 && pathParts[0] === 'app') || - (pathParts.length === 2 && (pathParts[0] === 'app' && (pathParts[1] === 'video-tutorials' || pathParts[1] === 'catalog'))) + (pathParts.length === 1 && pathParts[0] === 'app') || + (pathParts.length === 2 && (pathParts[0] === 'app' && (pathParts[1] === 'video-tutorials' || pathParts[1] === 'catalog'))) ) { selectedLanguage = 'en'; } else if ( @@ -115,16 +115,16 @@ changeLanguage(selectedLanguage, false); - + } - + addEventListener('DOMContentLoaded', () => { setupInitialLanguage(); }); function redirectToLanguageHomepage(language) { let homepageUrl = ''; - + switch (window.current_language) { case 'de': homepageUrl = '/app/de-homepage'; @@ -142,7 +142,7 @@ homepageUrl = '/app'; break; } - + window.location.href = homepageUrl; } @@ -155,7 +155,7 @@ let catalogUrl = ''; let videoUrl = ''; let homepageUrl = ''; - + if (window.location.href.includes('/app/catalog')) { switch (academyLanguage) { case 'de': @@ -174,8 +174,8 @@ catalogUrl = '/app/catalog'; return; } - window.location.href = catalogUrl; - } + window.location.href = catalogUrl; + } else if (window.location.href.includes('/app/video-tutorials')) { switch (academyLanguage) { case 'de': @@ -216,10 +216,10 @@ } window.location.href = homepageUrl; } - - + + } - + redirectToRightPage(); }); @@ -232,15 +232,15 @@ function filterCoursesByLanguage() { var selectedLanguage = localStorage.getItem('academy-language'); var courses = document.querySelectorAll('.homepage-card-wrapper, .course-card'); - + if (!courses.length) { return; // Nie ma żadnych kursów na stronie } - + for (var i = 0; i < courses.length; i++) { var course = courses[i]; var courseLanguage = course.getAttribute('language'); - + if (selectedLanguage && courseLanguage !== selectedLanguage) { course.style.display = 'none'; // Ukryj kursy o nieodpowiednim języku } else { @@ -248,14 +248,14 @@ } } } - + // Wywołanie funkcji po załadowaniu strony window.addEventListener('DOMContentLoaded', filterCoursesByLanguage); // Wywołanie funkcji po zmianie wartości w local storage window.addEventListener('storage', filterCoursesByLanguage); - + @@ -268,7 +268,7 @@ window.addEventListener('storage', filterCoursesByLanguage); { window.location.replace('/app/profile-settings') } - + {% endunless %} {% endif %} diff --git a/Custom_Templates/customer_templates/Pipedrive Learn - CRM/sign_up.html.liquid b/Custom_Templates/customer_templates/Pipedrive Learn - CRM/sign_up.html.liquid index 3a89b2b0..93992693 100644 --- a/Custom_Templates/customer_templates/Pipedrive Learn - CRM/sign_up.html.liquid +++ b/Custom_Templates/customer_templates/Pipedrive Learn - CRM/sign_up.html.liquid @@ -173,4 +173,4 @@ break; } }) - \ No newline at end of file +