Final save before Thanksgiving holiday! Blacklane has been completed. Some small scripts were updates. Downloaded new - but error prone - SPS templates.

This commit is contained in:
Norm Rasmussen
2023-11-22 16:37:22 -05:00
parent be3cb15494
commit 7bc8b430be
33 changed files with 1705 additions and 71 deletions

View File

@ -1,35 +1,14 @@
{% if current_person.signed_in? == false %}
<script>
if (localStorage.getItem('learnerCompletedAdditionalInfo') == null) {
if(localStorage.getItem('registered') == null){
window.location.href = '/learners/sign_in'
} else {
if(localStorage.getItem('learnerCompletedAdditionalInfo') == true){
window.location.href = '/app/dashboard'
} else {
window.location.href = '/app/sign-up-follow-up'
}
}
//setTimeout(() => {
//}, 500)
}
</script>
{% else %}
{% if current_person.properties.learner_completed_additional_info == false %}
{% unless current_person.email contains '+preview-' %}
<script>
if (localStorage.getItem('learnerCompletedAdditionalInfo') == null || localStorage.getItem('learnerCompletedAdditionalInfo') == false) {
window.location.href = '/app/sign-up-follow-up'
}
</script>
{% endunless %}
{% else %}
<script>
localStorage.removeItem('registered');
localStorage.removeItem('learnerCompletedAdditionalInfo')
</script>
{% endif %}
{% endif %}
<script>
let jsDate = new Date();
let jsFormattedDate = jsDate.getFullYear() + ("0" + (jsDate.getMonth() + 1)).slice(-2) + ("0" + jsDate.getDate()).slice(-2);
let liquidFormattedDate = '{{ "now" | date: "%Y-%m-%d" }}';
let personCreateDate = '{{ current_person.created_at }}'.split(" ")[0]
if (personCreateDate == liquidFormattedDate) {
if (localStorage.getItem('learnerCompletedAdditionalInfo') == null) {
window.location.href = '/app/sign-up-follow-up'
}
}
</script>
<header class="np-header np-header-color">
<div class="np-header-content">

View File

@ -1,4 +1,3 @@
<div class="sign-up-follow-up-container" onload="">
<div class="sign-up-follow-up-content">
<h1 class="sign-up-follow-up-prompt">Please select your region: </h1>
@ -20,19 +19,30 @@
</div>
<style>
.sign-up-follow-up-prompt {
color: black;
}
.logo-img {
width: 500px;
padding: 0;
display: block;
margin: 0 auto;
max-height: 100%;
max-width: 100%;
}
.logo-container {
position: fixed;
bottom: 0;
right: 0;
max-width: 100%;
width: 100%;
height: 20%;
}
.logo-itself {
position: absolute;
bottom: 0;
right: 0;
padding: 35px;
width: 40%;
}
.region-container {
border: none;
@ -43,7 +53,7 @@
}
.info-group-option {
text-transform: none;
font-size: 20px;
font-size: 25px;
border-radius: 10px;
background-color: black;
color: white;
@ -79,40 +89,5 @@
</style>
<script>
let submitData = async () => {
//if(
// ($(".sign-up-region")[0].value.length > 0)
// ){
function webhookCaller(){
return new Promise(function(res, rej) {
let xhr = new XMLHttpRequest();
url = "https://webhooks.workato.com/webhooks/rest/a36b1f7c-07c7-48ff-bc0f-cb3777d02c81/blacklane-new-driver-region-seg";
xhr.addEventListener("load", e => {
window.location.replace('/app/');
//window.location.replace('/app');
});
xhr.open("POST", url, true);
xhr.send(JSON.stringify({
email: '{{ current_person.email }}',
name: "{{ current_person.first_name }} {{ current_person.last_name }}",
user_id: '{{ current_person.id }}',
user_region: $(".sign-up-region")[0].value,
}))
})
}
try {
await webhookCaller()
.then((res) => {
window.location.replace('/app/dashboard')
})
} catch(err) {
console.log(err)
}
}
}
localStorage.setItem("learnerCompletedAdditionalInfo", true);
</script>