Notes for Larson Texts/Big ideas, added the ghost notes templates. Updated luminate's templates
This commit is contained in:
@ -2,29 +2,68 @@
|
||||
function showPopup() {
|
||||
setTimeout(function() {
|
||||
document.querySelector(".popup-trigger").click()
|
||||
console.log("showing popup")
|
||||
}, 500)
|
||||
}
|
||||
|
||||
function showSurveyPopup() {
|
||||
setTimeout(function() {
|
||||
document.querySelector(".survey-popup-trigger").click()
|
||||
}, 500)
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${month}/${day}/${year}`;
|
||||
}
|
||||
|
||||
function RerunWorkato() {
|
||||
console.log("re-running workflow")
|
||||
const today = new Date();
|
||||
const formattedDate = formatDate(today);
|
||||
const data = { person_uuid: '{{current_person.id}}', date: formattedDate }
|
||||
|
||||
const data = { learner_uuid: '{{current_person.id}}' }
|
||||
let webhookUrl
|
||||
if (schoolID == "804edb32-c300-42f3-82b7-e5d55fcbc2a6") {
|
||||
webhookUrl = "https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/user-interacted-with-popup"
|
||||
} else if (schoolID == "10183441-2254-4b1e-a9f7-9549ca773257") { // live school
|
||||
|
||||
/* fetch('https://webhooks.workato.com/webhooks/rest/db050d27-4343-413c-82a3-e63c634f52f9/user-clicks-modal-option', {
|
||||
method: 'post',
|
||||
body: JSON.stringify(data)
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(data) {
|
||||
console.log(res)
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
});*/
|
||||
}
|
||||
|
||||
if (webhookUrl) {
|
||||
fetch(webhookUrl, {
|
||||
method: 'post',
|
||||
body: JSON.stringify(data)
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(data) {
|
||||
console.log(res)
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{% assign catalog_courses = courses.in_catalog %}
|
||||
|
||||
{% assign survey_courses = "" %}
|
||||
{% assign survey_course_completed = false %}
|
||||
{% if current_school.id == "10183441-2254-4b1e-a9f7-9549ca773257" %}
|
||||
{% comment %} LIVE SCHOOL {% endcomment %}
|
||||
{% assign survey_course = catalog_courses | where: "id", "b3225a47-448d-4988-962a-18d37d6616d0" %}
|
||||
{% elsif current_school.id == "804edb32-c300-42f3-82b7-e5d55fcbc2a6" %}
|
||||
{% comment %} SANDBOX SCHOOL {% endcomment %}
|
||||
{% assign survey_course = catalog_courses | where: "id", "fdc8acdc-0b7c-4064-a52b-1955379d411b" %}
|
||||
{% endif %}
|
||||
|
||||
{% for course in survey_course %}
|
||||
{% if course.progress == 100 %}
|
||||
{% assign survey_course_completed = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% include "header" %}
|
||||
<main class="np-main np-homepage">
|
||||
<div class="np-homepage-hero">
|
||||
@ -37,31 +76,17 @@
|
||||
<div class="np-homepage-subheadline">
|
||||
{{ homepage.subheadline }}
|
||||
</div>
|
||||
<form
|
||||
class="np-header-search np-hero-search"
|
||||
data-test="mobile-search"
|
||||
method="get"
|
||||
action="{% route search %}"
|
||||
>
|
||||
<input
|
||||
aria-label="What are you looking for?"
|
||||
class="hero-search-input"
|
||||
type="text"
|
||||
name="q"
|
||||
placeholder="What are you looking for?"
|
||||
/>
|
||||
<form class="np-header-search np-hero-search" data-test="mobile-search" method="get" action="{% route search %}">
|
||||
<input aria-label="What are you looking for?" class="hero-search-input" type="text" name="q" placeholder="What are you looking for?" />
|
||||
<i class="np-header-search-icon hero-search-icon far fa-search"></i>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<img class="np-homepage-hero-image"
|
||||
src="{{ homepage.artwork_url }}"
|
||||
alt="{{ homepage.headline }}"
|
||||
/>
|
||||
<img class="np-homepage-hero-image" src="{{ homepage.artwork_url }}" alt="{{ homepage.headline }}" />
|
||||
</div>
|
||||
</div>
|
||||
{% include "sub_navigation" %}
|
||||
|
||||
|
||||
{% include "homepage_featured", items: catalog_courses %}
|
||||
|
||||
<div class="np-max-width np-homepage-row-wrapper">
|
||||
@ -80,11 +105,11 @@
|
||||
<div class="col-xs-12 col-md-4">
|
||||
{% include "cards_learning_path_progress" %}
|
||||
</div>
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% if lps_in_progress > 0 %}
|
||||
<div class="see-more-wrapper">
|
||||
<a href="/app/dashboard" style="margin-top:24px;">See more</a>
|
||||
@ -99,10 +124,10 @@
|
||||
<img class="np-zero-state-learning-paths" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% comment %} {% if features.training_events? %}
|
||||
@ -128,7 +153,7 @@
|
||||
</div>
|
||||
|
||||
{% include "homepage_ongoing_training", items: catalog_courses %}
|
||||
|
||||
|
||||
{% include "homepage_topics" %}
|
||||
<button
|
||||
type="button"
|
||||
@ -139,6 +164,16 @@
|
||||
data-toggle-modal>
|
||||
Click
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="survey-popup-trigger"
|
||||
data-toggle-class-on-target
|
||||
data-toggle-target="#surveyPopup"
|
||||
data-toggle-escape
|
||||
data-toggle-modal>
|
||||
Click
|
||||
</button>
|
||||
</main>
|
||||
{% include "footer" %}
|
||||
|
||||
@ -154,7 +189,38 @@
|
||||
<div class="modal-headline">Welcome to Luminate Academy, {{ current_person.first_name }}! We noticed it is your first time here. Can we help you get familiar with the academy?</div>
|
||||
<div class="modal-links">
|
||||
<a href="javascript:setPopupSeenProperty('/app/dashboard')" class="secondary" data-toggle-trigger-off>No thanks! I can figure it out.</a>
|
||||
<a href="javascript:setPopupSeenProperty('/app')" data-redirect="/app">Sure! Show me around.</a>
|
||||
|
||||
{% if current_school.id == "10183441-2254-4b1e-a9f7-9549ca773257" %}
|
||||
{% comment %} LIVE SCHOOL {% endcomment %}
|
||||
<a href="javascript:setPopupSeenProperty('/app')" data-redirect="/app">Sure! Show me around.</a>
|
||||
{% elsif current_school.id == "804edb32-c300-42f3-82b7-e5d55fcbc2a6" %}
|
||||
{% comment %} SANDBOX SCHOOL {% endcomment %}
|
||||
<a href="javascript:setPopupSeenProperty('https://luminatesandbox.northpass.com/c/0e61b8e5ced6f6093816fed850226ac828853eaf')" data-redirect="/app">Sure! Show me around.</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="survey-popup"
|
||||
id="surveyPopup"
|
||||
role="dialog"
|
||||
aria-labelledby="dialogTitle"
|
||||
aria-describedby="dialogContent"
|
||||
aria-hidden="true">
|
||||
<section class="survey-popup-container">
|
||||
<div id="dialogContent" class="survey-popup-content">
|
||||
<div class="modal-headline">Please take a moment to tell us more about you!</div>
|
||||
<div class="modal-links">
|
||||
{% if current_school.id == "10183441-2254-4b1e-a9f7-9549ca773257" %}
|
||||
{% comment %} LIVE SCHOOL {% endcomment %}
|
||||
{% comment %} <a href="javascript:setPopupSeenProperty('/app')" data-redirect="/app">Sure! Show me around.</a> {% endcomment %}
|
||||
{% elsif current_school.id == "804edb32-c300-42f3-82b7-e5d55fcbc2a6" %}
|
||||
{% comment %} SANDBOX SCHOOL {% endcomment %}
|
||||
<a href="javascript:setSurveyPopupSeen('/app/courses/fdc8acdc-0b7c-4064-a52b-1955379d411b')">Go!</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@ -162,35 +228,35 @@
|
||||
|
||||
{% if current_person.signed_in? %}
|
||||
{% unless current_person.email contains "+preview" %}
|
||||
<script>
|
||||
window.addEventListener("load", function() {
|
||||
const firstTimePopupProperty = {{current_person.properties.first_time_user_popup_seen}}
|
||||
if (firstTimePopupProperty == false) {
|
||||
console.log('property is false, check local storage')
|
||||
if (localStorage.getItem('modal_clicked') != null) {
|
||||
console.log("rerun workflow to set property")
|
||||
RerunWorkato()
|
||||
} else {
|
||||
showPopup()
|
||||
}
|
||||
} else if (firstTimePopupProperty == true) {
|
||||
console.log("property is set, deleting local storage, don't initialize modal")
|
||||
localStorage.removeItem("modal_clicked")
|
||||
{% if current_person.properties.first_time_user_popup_seen == false %}
|
||||
<script>
|
||||
console.log('property is false, check local storage')
|
||||
if (localStorage.getItem('modal_clicked') != null) {
|
||||
console.log("rerun workflow to set property")
|
||||
RerunWorkato()
|
||||
} else {
|
||||
console.log('custom prop doesnt yet exist')
|
||||
if (localStorage.getItem('modal_clicked') != null) {
|
||||
console.log("rerun workflow to set property")
|
||||
RerunWorkato()
|
||||
} else {
|
||||
showPopup()
|
||||
}
|
||||
showPopup()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
{% elsif current_person.properties.first_time_user_popup_seen == true %}
|
||||
<script>
|
||||
console.log("property is set, deleting local storage, don't initialize first modal")
|
||||
localStorage.removeItem("modal_clicked")
|
||||
</script>
|
||||
{% else %}
|
||||
<script>
|
||||
console.log('custom prop doesnt yet exist')
|
||||
if (localStorage.getItem('modal_clicked') != null) {
|
||||
console.log("rerun workflow to set property")
|
||||
RerunWorkato()
|
||||
} else {
|
||||
showPopup()
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<script>
|
||||
if (window.location.pathname == "/app") {
|
||||
document.querySelector(".np-sub-navigation").classList.add("homepage-nav")
|
||||
@ -217,6 +283,37 @@
|
||||
stickySubNav.classList.remove('fixed');
|
||||
}
|
||||
};
|
||||
|
||||
const firstPopupSeen = {{current_person.properties.first_time_user_popup_seen}}
|
||||
|
||||
if (firstPopupSeen == true) {
|
||||
var popupSeenDate = new Date("{{current_person.properties.first_popup_date}}");
|
||||
var popupSeenSeconds = popupSeenDate.getTime() / 1000;
|
||||
|
||||
var currentDate = new Date();
|
||||
var currentDateSeconds = currentDate.getTime() / 1000;
|
||||
|
||||
if (currentDateSeconds > (popupSeenSeconds + 1209600) && currentDateSeconds) {
|
||||
console.log("more than 2 weeks after first popup")
|
||||
|
||||
const surveyCourseCompleted = {{survey_course_completed}}
|
||||
|
||||
if (surveyCourseCompleted == false) {
|
||||
if (localStorage.getItem("survey_modal_clicked") == null) {
|
||||
showSurveyPopup()
|
||||
} else {
|
||||
const lastClickedDateSeconds = new Date(localStorage.getItem("survey_modal_clicked")).getTime() / 1000
|
||||
if (currentDateSeconds > (lastClickedDateSeconds + 1209600) && currentDateSeconds) {
|
||||
showSurveyPopup()
|
||||
} else {
|
||||
console.log(`dont show survey popup again until 2 weeks after ${localStorage.getItem("survey_modal_clicked")} or course completed`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
localStorage.removeItem("survey_modal_clicked");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function findOffset(element) {
|
||||
@ -254,33 +351,60 @@
|
||||
console.log("percent: ", percent)
|
||||
setProgress(percent, circle)
|
||||
}
|
||||
|
||||
|
||||
function setProgress(percent, circle) {
|
||||
const offset = circumference - percent * circumference;
|
||||
circle.style.strokeDashoffset = offset;
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
function setPopupSeenProperty(redirectUrl) {
|
||||
localStorage.setItem("modal_clicked", true);
|
||||
const today = new Date();
|
||||
const formattedDate = formatDate(today);
|
||||
const data = { person_uuid: '{{current_person.id}}', date: formattedDate }
|
||||
|
||||
const data = { learner_uuid: '{{current_person.id}}' }
|
||||
const schoolID = '{{current_school.id}}'
|
||||
let webhookUrl
|
||||
if (schoolID == "804edb32-c300-42f3-82b7-e5d55fcbc2a6") {
|
||||
webhookUrl = "https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/user-interacted-with-popup"
|
||||
} else if (schoolID == "10183441-2254-4b1e-a9f7-9549ca773257") { // live school
|
||||
|
||||
window.location.href = redirectUrl;
|
||||
}
|
||||
|
||||
/*fetch('https://webhooks.workato.com/webhooks/rest/db050d27-4343-413c-82a3-e63c634f52f9/user-clicks-modal-option', {
|
||||
method: 'post',
|
||||
body: JSON.stringify(data)
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(data) {
|
||||
console.log(res)
|
||||
if (webhookUrl) {
|
||||
fetch(webhookUrl, {
|
||||
method: 'post',
|
||||
body: JSON.stringify(data)
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(data) {
|
||||
console.log(res)
|
||||
setTimeout(function() {
|
||||
window.location.href = redirectUrl;
|
||||
}, 250)
|
||||
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
setTimeout(function() {
|
||||
window.location.href = redirectUrl;
|
||||
}, 250)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function setSurveyPopupSeen(redirectUrl) {
|
||||
const today = new Date();
|
||||
const formattedDate = formatDate(today);
|
||||
localStorage.setItem("survey_modal_clicked", formattedDate);
|
||||
|
||||
setTimeout(function() {
|
||||
window.location.href = redirectUrl;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
window.location.href = redirectUrl;
|
||||
});*/
|
||||
}, 250)
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -357,6 +481,12 @@
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.popup-trigger,
|
||||
.survey-popup-trigger {
|
||||
visibility:hidden;
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
@media (min-width:768px) {
|
||||
.np-homepage-hero-container {
|
||||
display:flex;
|
||||
|
||||
Reference in New Issue
Block a user