SPS' V3 templates. Updated Harri's templates too to update the workato endpoints.

This commit is contained in:
Norm Rasmussen
2025-05-13 16:55:51 -04:00
parent 89c35d0506
commit 72715d9d49
322 changed files with 8995 additions and 3731 deletions

View File

@ -120,7 +120,7 @@
<script>
{% if current_school.properties.sandbox == false %}
const deletionInput = document.getElementById('account-deletion-confirmation-input');
deletionInput.addEventListener('input', () => {
const button = document.querySelector('#confirm-deletion');
if (deletionInput.value.toLowerCase() !== 'delete') {
@ -129,7 +129,7 @@
button.classList.remove('button-deletion-disabled');
}
});
function sendDeleteRequest() {
document.querySelector('.account-deletion-popup-confirmation').classList.add('np-hidden');
document.querySelector('.account-deletion-popup-goodbye').classList.remove('np-hidden');
@ -137,11 +137,11 @@
const personEmail = '{{ current_person.email }}'
const personTime = '{{ current_person.created_at | replace_first: " ", "T" | replace_first: " +0000", ".000000+00:00" }}';
const xhr = new XMLHttpRequest();
{% if current_school.sso_active? %}
var url = 'https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-delete-myself'
var url = 'https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-delete-myself'
{% else %}
var url = 'https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-open-delete-myself'
var url = 'https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-open-delete-myself'
{% endif %}
xhr.open('POST', url);
xhr.setRequestHeader('Content-Type', 'application/json');

View File

@ -175,7 +175,7 @@
var user_id = null
var sso_uid = null
{% endif %}
analytics.identify({
"traits":{
"northpass_email": email ,
@ -366,9 +366,9 @@
if (permissionCookie !== '{{ current_person.properties.cookie_permissions }}') {
const xhr = new XMLHttpRequest();
{% if current_school.sso_active? %}
var url = 'https://www.workato.com/webhooks/rest/997192d2-6726-4f22-afbc-8cf021019896/pipedrive-sso-change-cookie-value'
var url = 'https://webhooks.workato.com/webhooks/rest/997192d2-6726-4f22-afbc-8cf021019896/pipedrive-sso-change-cookie-value'
{% else %}
var url = 'https://www.workato.com/webhooks/rest/4a75076f-e7be-472b-b661-319f34ee9d24/pipedrive-open-change-cookie-value'
var url = 'https://webhooks.workato.com/webhooks/rest/4a75076f-e7be-472b-b661-319f34ee9d24/pipedrive-open-change-cookie-value'
{% endif %}
xhr.open('POST', url);
xhr.setRequestHeader('Content-Type', 'application/json');

View File

@ -39,9 +39,9 @@
if (sendRequest) {
let xhr = new XMLHttpRequest();
{% if current_school.sso_active? %}
var url = "https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-change-user-language";
var url = "https://webhooks.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://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-open-change-user-language";;
{% endif %}
xhr.open("POST", url, true);
xhr.send(JSON.stringify({
@ -92,11 +92,11 @@
} else {
selectedLanguage = 'en';
}
changeLanguage(selectedLanguage, false);
}
}
addEventListener('DOMContentLoaded', () => {
setupInitialLanguage();
});
@ -129,22 +129,22 @@
videoTutorials: '/app/video-tutorials'
}
};
const currentUrl = window.location.pathname;
const currentLang = window.current_language || 'en';
let category = 'homepage';
if (currentUrl.includes('catalog')) {
category = 'catalog';
} else if (currentUrl.includes('video-tutorials')) {
category = 'videoTutorials';
}
const newUrl = languageMappings[currentLang][category] || '/app';
window.location.href = newUrl;
}
const academyLanguage = window.localStorage.getItem('academy-language');
console.log(academyLanguage);
@ -155,15 +155,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 {
@ -171,14 +171,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 -->
@ -191,7 +191,7 @@ window.addEventListener('storage', filterCoursesByLanguage);
{
window.location.replace('/app/profile-settings')
}
</script>
{% endunless %}
{% endif %}
@ -225,4 +225,4 @@ window.addEventListener('storage', filterCoursesByLanguage);
window.sessionStorage.sso_last_page = window.location.pathname;
</script>
{% endif %}
{% endif %}
{% endif %}

View File

@ -59,9 +59,9 @@
}
let xhr = new XMLHttpRequest();
{% if current_school.sso_active? %}
var url = "https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-last-courses";
var url = "https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-last-courses";
{% else %}
var url = "https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-open-last-courses";
var url = "https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-open-last-courses";
{% endif %}
xhr.open("POST", url, true);
xhr.send(JSON.stringify({

View File

@ -10,7 +10,7 @@
{% else %}
{% include 'profile_settings_initial' %}
{% endif %}
<style>
.np-account {
background: #F7F7FE;
@ -63,17 +63,17 @@
}
}
</style>
<script>
const form = document.getElementById('name-form');
form.addEventListener('input', () => {
const firstName = document.querySelector('#first-name').value;
const lastName = document.querySelector('#last-name').value;
const button = document.querySelector('button.np-form-action');
button.disabled = !(firstName.length > 0 && lastName.length > 0);
});
addEventListener('DOMContentLoaded', () => {
{% if current_person.first_name %}
document.querySelector('#first-name').setAttribute('value', '{{ current_person.first_name }}');
@ -97,7 +97,7 @@
const firstName = document.getElementById('first-name').value;
const lastName = document.getElementById('last-name').value;
const xhr = new XMLHttpRequest();
xhr.open('POST', 'https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-setup-first-and-last-name');
xhr.open('POST', 'https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-setup-first-and-last-name');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({
"first-name": firstName,

View File

@ -53,7 +53,7 @@
</form>
</div>
</main>
<style>
.np-account {
background: #F7F7FE;
@ -106,17 +106,17 @@
}
}
</style>
<script>
const form = document.getElementById('name-form');
form.addEventListener('input', () => {
const firstName = document.querySelector('#first-name').value;
const lastName = document.querySelector('#last-name').value;
const button = document.querySelector('button');
button.disabled = !(firstName.length > 0 && lastName.length > 0);
});
addEventListener('DOMContentLoaded', () => {
let defaultLastName = "{{ current_person.last_name }}";
let splitName = defaultLastName.split(' ');
@ -129,13 +129,13 @@
document.querySelector('button').disabled = true;
}
})
form.addEventListener('submit', (event) => {
event.preventDefault();
const firstName = document.getElementById('first-name').value;
const lastName = document.getElementById('last-name').value;
const xhr = new XMLHttpRequest();
xhr.open('POST', 'https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-setup-first-and-last-name');
xhr.open('POST', 'https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pipedrive-sso-setup-first-and-last-name');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({
"first-name": firstName,