Pipedrive is removing an instance because of multi-auth. Started to clean up those templates.
This commit is contained in:
@ -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);
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<!-- on SSO school redirect new users to setup their name -->
|
||||
@ -268,7 +268,7 @@ window.addEventListener('storage', filterCoursesByLanguage);
|
||||
{
|
||||
window.location.replace('/app/profile-settings')
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
|
||||
@ -173,4 +173,4 @@
|
||||
break;
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user