Uncommented some of Pipedrive's templates for password reset warning. WilliamSonoma notes, Aubrey check in.

This commit is contained in:
Norm Rasmussen
2023-10-05 17:26:26 -04:00
parent a610b52c6e
commit 8cd8a61d34
26 changed files with 541 additions and 798 deletions

View File

@ -21,7 +21,12 @@
<script>
// changing language
function changeLanguage(newLanguage, sendRequest=true) {
document.querySelector(".languages-dropdown").classList.remove('show');
console.log(document.querySelector(".languages-dropdown"));
if(document.querySelector(".languages-dropdown")){
document.querySelector(".languages-dropdown").classList.remove('show');
}
if (!window.current_language || window.current_language !== newLanguage) {
window.current_language = newLanguage
} else {
@ -41,7 +46,7 @@
{% if current_school.sso_active? %}
var url = "https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-change-user-language";
{% else %}
var url = "https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-open-change-user-language";
var url = "https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-open-change-user-language";;
{% endif %}
xhr.open("POST", url, true);
xhr.send(JSON.stringify({
@ -81,11 +86,6 @@
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')))
) {
selectedLanguage = 'en';
} else if (
window.location.pathname.includes('/de-homepage') ||
window.location.pathname.includes('/de-video-tutorials') ||
window.location.pathname.includes('/de-catalog')
@ -113,9 +113,7 @@
selectedLanguage = 'en';
}
changeLanguage(selectedLanguage, false);
}
addEventListener('DOMContentLoaded', () => {
@ -146,83 +144,6 @@
window.location.href = homepageUrl;
}
document.addEventListener('DOMContentLoaded', function() {
const academyLanguage = window.localStorage.getItem('academy-language');
const url = window.location.href;
const lastSegment = url.substring(url.lastIndexOf('/') + 1);
console.log(academyLanguage);
function redirectToRightPage() {
let catalogUrl = '';
let videoUrl = '';
let homepageUrl = '';
if (window.location.href.includes('/app/catalog')) {
switch (academyLanguage) {
case 'de':
catalogUrl = '/app/de-catalog';
break;
case 'es':
catalogUrl = '/app/es-catalog';
break;
case 'fr':
catalogUrl = '/app/fr-catalog';
break;
case 'br':
catalogUrl = '/app/br-catalog';
break;
case 'en':
catalogUrl = '/app/catalog';
return;
}
window.location.href = catalogUrl;
}
else if (window.location.href.includes('/app/video-tutorials')) {
switch (academyLanguage) {
case 'de':
videoUrl = '/app/de-video-tutorials';
break;
case 'es':
videoUrl = '/app/es-video-tutorials';
break;
case 'fr':
videoUrl = '/app/fr-video-tutorials';
break;
case 'br':
videoUrl = '/app/br-video-tutorials';
break;
case 'en':
videoUrl = '/app/catalog';
return;
}
window.location.href = videoUrl;
}
else if (lastSegment === 'app') {
switch (academyLanguage) {
case 'de':
homepageUrl = '/app/de-homepage';
break;
case 'es':
homepageUrl = '/app/es-homepage';
break;
case 'fr':
homepageUrl = '/app/fr-homepage';
break;
case 'br':
homepageUrl = '/app/br-homepage';
break;
case 'en':
homepageUrl = '/app';
return;
}
window.location.href = homepageUrl;
}
}
redirectToRightPage();
});
const academyLanguage = window.localStorage.getItem('academy-language');
console.log(academyLanguage);
</script>
@ -302,4 +223,4 @@ window.addEventListener('storage', filterCoursesByLanguage);
window.sessionStorage.sso_last_page = window.location.pathname;
</script>
{% endif %}
{% endif %}
{% endif %}