Created script to get sent webhooks from our endpoint. Not many filtering options. Update some templates for Spark, and Luminate.

This commit is contained in:
Norm Rasmussen
2024-11-26 16:39:18 -05:00
parent b0abcb7022
commit 991cdde784
11 changed files with 533 additions and 437 deletions

View File

@ -0,0 +1,325 @@
<script>
const training_eventsArr=[];
</script>
{% for training_event in training_events.available %}
{% for session in training_event.sessions %}
<script>
training_eventsArr.push("{{ session.day }}{{ session.month }}{{ session.year }}");
//console.log("{{ training_event.title }} {{ session.day }} {{ session.month }} {{ session.year }}" )
</script>
{% endfor %}
{% endfor %}
<div class="calFrame">
<div class="container">
<div class="calendar">
<header>
<pre class="left">◀</pre>
<div class="header-display">
<p class="display">""</p>
</div>
<pre class="right">▶</pre>
</header>
<div class="week">
<div>Su</div>
<div>Mo</div>
<div>Tu</div>
<div>We</div>
<div>Th</div>
<div>Fr</div>
<div>Sa</div>
</div>
<div class="days"></div>
</div>
<div class="divToday">Today</div>
<!--<div class="display-selected">
<p class="selected"></p>
</div>-->
</div>
</div>
<style>
/*variables*/
:root {
--white: #ffff;
--main: #eaedf0;
--accent: #0041ff;
--accent-2: #ebedf0;
}
/*styles*/
.divToday:hover {
cursor: pointer;
}
.divToday {
background-color: var(--accent);
color: var(--white);
font-weight: 700;
padding: 4px;
border-radius: 6px;
}
.calFrame {
background-color: var(--white);
display: flex;
align-items: center;
justify-content: center;
font-family: sans-serif;
}
.days {
height: 144px;
}
.container {
display: flex;
background-color: var(--white);
border-radius: 35px;
border: 1px solid;
padding: 1em;
height: 265px;
width: 280px;
flex-wrap: nowrap;
flex-direction: column;
align-content: center;
justify-content: center;
align-items: center;
}
header {
margin: 10px;
display: flex;
justify-content: space-between;
align-items: center;
/* padding: 4px; */
width: 230px;
}
.header-display {
display: flex;
align-items: center;
}
.header-display p {
color: var(--accent);
margin: 5px;
font-size: 1.2rem;
word-spacing: 0.5rem;
}
.left {
padding: 10px;
margin: 0;
cursor: unset;
font-size: 1.2rem;
color: var(--accent);
opacity: 0.5;
}
.right {
padding: 10px;
margin: 0;
cursor: pointer;
font-size: 1.2rem;
color: var(--accent);
}
.days, .week {
display: grid;
grid-template-columns: repeat(7, 1fr);
margin: auto;
/* padding: 0px 20px; */
justify-content: space-between;
width: 210px;
}
.week div, .days div {
display: flex;
justify-content: center;
align-items: center;
height: 1.5rem;
width: 1.5rem;
border-radius: 100%;
}
.days div:hover {
background: var(--accent-2);
color: rgb(25, 25, 201);
cursor: pointer;
}
.week div {
opacity: 0.5;
}
.current-date {
background-color: var(--accent);
color: var(--white);
}
.has-event {
background-color: red;
color: var(--white);
}
.display-selected {
margin-bottom: 10px;
padding: 20px 20px;
text-align: center;
}
</style>
<script>
const montharr = ["January","February","March","April","May","June","July","August","September","October","November","December"];
let display = document.querySelector(".display");
let days = document.querySelector(".days");
let previous = document.querySelector(".left");
let next = document.querySelector(".right");
let selected = document.querySelector(".selected");
let today = document.querySelector(".divToday");
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth();
// Main function to render Calendar
function displayCalendar() {
const firstDay = new Date(year, month, 1);
const lastDay = new Date(year, month + 1, 0);
const firstDayIndex = firstDay.getDay(); //4
const numberOfDays = lastDay.getDate(); //31
let formattedDate = montharr[firstDay.getMonth()]+" " +firstDay.getFullYear().toString();
display.innerHTML = `${formattedDate}`;
for (let x = 1; x <= firstDayIndex; x++) {
const div = document.createElement("div");
div.innerHTML += "";
days.appendChild(div);
}
//console.log("In Display " + month + " Year " + year);
for (let i = 1; i <= numberOfDays; i++) {
let div = document.createElement("div");
let currentDate = new Date(year, month, i);
div.dataset.date = currentDate.getDate().toString()+montharr[currentDate.getMonth()]+currentDate.getFullYear().toString();
div.innerHTML += i;
days.appendChild(div);
if (
currentDate.getFullYear() === new Date().getFullYear() &&
currentDate.getMonth() === new Date().getMonth() &&
currentDate.getDate() === new Date().getDate()
)
{
div.classList.add("current-date");
}
if (training_eventsArr.includes(div.dataset.date))
{
div.classList.add("has-event");
div.outerHTML="<a href='app/training_events' style='text-decoration: none;' target='_blank'>"+div.outerHTML+"</a>";
}
}
}
// Call the function to display the calendar
displayCalendar();
//Today Event Listener
today.addEventListener("click", () => {
days.innerHTML = "";
date = new Date();
year = date.getFullYear();
month = date.getMonth();
document.querySelector(".left").style.color = "var(--accent)";
document.querySelector(".left").style.opacity="0.5";
document.querySelector(".left").style.cursor="unset";
displayCalendar();
});
//Previous Event Listener
previous.addEventListener("click", () => {
if ( year === new Date().getFullYear() && month === new Date().getMonth() )
{
return; //Skip the Previous if it is Current Month as thie is for Upcoming Events
}
days.innerHTML = "";
//selected.innerHTML = "";
//console.log("Before Pre set " + month + " Year " + year);
if (month < 0) {
month = 11;
year = year - 1;
}
month = month - 1;
date.setMonth(month);
displayCalendar();
//console.log("after Pre set " + month + " Year " + year);
//Disable Previous if the current Display Month is same as today Month as thie is for Upcoming Events
if (year === new Date().getFullYear() && month === new Date().getMonth() )
{
document.querySelector(".left").style.color = "var(--accent)";
document.querySelector(".left").style.opacity="0.5";
document.querySelector(".left").style.cursor="unset";
}
//displaySelected();
});
//Next Button event listener
next.addEventListener("click", () => {
days.innerHTML = "";
//selected.innerHTML = "";
//console.log("Before Next set " + month + " Year " + year);
if (month >= 11) {
month = -1;
year = year + 1;
}
month = month + 1;
date.setMonth(month);
displayCalendar();
//console.log("After Next set " + month + " Year " + year);
if ( year === new Date().getFullYear() && month+1 === new Date().getMonth()+1 )
{
document.querySelector(".left").style.color = "var(--accent)";
document.querySelector(".left").style.opacity="0.5";
document.querySelector(".left").style.cursor="unset";
}
else { //Enable Previous Buttom if the current display month is not currnet month
document.querySelector(".left").style.color = "var(--accent)";
document.querySelector(".left").style.opacity="100";
document.querySelector(".left").style.cursor="pointer";
}
// displaySelected();
});
//Currently not in Use
function displaySelected() {
const dayElements = document.querySelectorAll(".days div");
dayElements.forEach((day) => {
day.addEventListener("click", (e) => {
const selectedDate = e.target.dataset.date;
selected.innerHTML = `Selected Date : ${selectedDate}`;
});
});
}
displaySelected();
</script>

View File

@ -0,0 +1,50 @@
{% assign categories = current_school.filterable_categories %}
<div class="np-dashboard-resources">
{% for category in categories %}
<div class="content-catds">
<div class="content-catds-text">
{{ category.name }}
</div>
<div class="content-arrow"><i class="far fa-duotone fa-solid fa-greater-than"></i></div>
</div>
{% endfor %}
</div>
<style>
.content-catds {
border: 2px solid #bac4ca;
border-radius: 10px;
/* padding: 5px; */
text-align: center;
margin: 15px;
display: flex;
justify-content: space-between;
/* align-content: stretch; */
flex-wrap: nowrap;
align-items: center;
}
.content-catds:hover {
background-color: lightgray;
cursor: pointer;
}
.content-catds-text {
color: #333;
padding-left: 20px;
font-size: 17px;
/* margin-bottom: 24px; */
height: 30px;
padding-top: 5px;
}
.content-arrow {
padding-top: 5px;
background-color: bisque;
height: 30px;
width: 50px;
border-radius: 0px 10px 10px 0px;
}
</style>

View File

@ -36,15 +36,15 @@
<h1 class="np-header-logo">
<a href="{% route home %}">
<img
alt="Walmart Luminate Learn"
alt="Learn Scintilla"
class="np-header-logo-image"
src="https://s3.amazonaws.com/static.northpass.com/walmart-luminate/luminate-icon-logo.svg"
src="http://i5.walmartimages.com/dfw/63925b23-d1f5/k2-_a36e7b0e-4797-4a93-aebb-cc2248fb80dc.v1.png"
/>
</a>
<div class="header-dropdown-container np-hidden-mobile">
<div class="dropdown-arrow"></div>
<div class="header-dropdown">
<a href="https://www.walmartluminate.com/apps">Walmart Luminate</a>
<a href="https://www.walmartluminate.com/apps">Scintilla</a>
<a href="https://www.walmartluminate.com/shopperbehavior/dh.clientportal.web/web/#/">Shopper Behavior</a>
<a href="https://www.walmartluminate.com/customerperception">Customer Perception</a>
<a href="https://www.walmartluminate.com/reportbuilder">Report Builder</a>
@ -54,7 +54,7 @@
<div class="header-dropdown-container np-hidden-desktop">
<div class="dropdown-arrow"></div>
<div class="header-dropdown">
<a href="https://www.walmartluminate.com/apps">Walmart Luminate</a>
<a href="https://www.walmartluminate.com/apps">Scintilla</a>
<a href="https://www.walmartluminate.com/shopperbehavior/dh.clientportal.web/web/#/">Shopper Behavior</a>
<a href="https://www.walmartluminate.com/customerperception">Customer Perception</a>
<a href="https://www.walmartluminate.com/reportbuilder">Report Builder</a>
@ -62,7 +62,7 @@
</div>
</div>
<div class="header-text np-hidden-desktop">Learn</div>
<div class="header-text np-hidden-mobile">Walmart Luminate Learn</div>
<div class="header-text np-hidden-mobile">Learn Scintilla</div>
</h1>
{% else %}
<a href="{% route home %}" class="np-school-name np-header-font-color">

View File

@ -1,69 +1,3 @@
<script>
function showPopup() {
setTimeout(function() {
document.querySelector(".popup-trigger").click()
}, 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() {
const today = new Date();
const formattedDate = formatDate(today);
const data = { person_uuid: '{{current_person.id}}', date: formattedDate }
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
}
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">
@ -86,329 +20,97 @@
</div>
</div>
{% include "sub_navigation" %}
{% include "homepage_featured", items: catalog_courses %}
<div class="np-homepage-featured np-max-width">
<div class="np-max-width np-homepage-row-wrapper">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12" style="display:flex; flex-direction:column;">
<div class="np-section-header">Progress Tracker</div>
<div class="learning-path-progress-container">
<div class="row">
{% assign lps_in_progress = 0 %}
{% assign enrolled_learning_paths = learning_paths.enrolled | sort: "progress" | reverse %}
{% for learning_path in enrolled_learning_paths %}
{% if learning_path.progress > 0 %}
{% assign lps_in_progress = lps_in_progress | plus: 1 %}
{% if lps_in_progress < 4 %}
<div class="col-xs-12 col-md-4">
{% include "cards_learning_path_progress" %}
</div>
{% endif %}
{% endif %}
<div class="row np-flex-center">
<div class="col-xs-12 col-sm-8">
<div class="np-homepage-featured-text">
<div class="np-homepage-headline">
{{ homepage.featured_courses_headline }}
</div>
<div class="np-homepage-subheadline">
{{ homepage.featured_courses_subheadline }}
</div>
</div>
{% if courses.featured.any? %}
<div class="np-homepage-featured-courses row">
{% for course in courses.featured %}
<div class="col-xs-12 col-md-6 col-lg-4 np-stretch-content">
{% include "cards_course" with course %}
</div>
{% endfor %}
{% if lps_in_progress > 0 %}
<div class="see-more-wrapper">
<a href="/app/dashboard" style="margin-top:24px;">See more</a>
</div>
{% endif %}
{% if lps_in_progress == 0 %}
<div class="col-xs-12">
<div class="np-learning-paths-resources-container">
<div class="np-zero-state-text">
Yikes! You don't have any learning Paths in progress.
</div>
<img class="np-zero-state-learning-paths" alt="" />
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% comment %} {% if features.training_events? %}
<div class="col-xs-12 col-sm-5 col-md-4">
<div class="homepage-events">
<div class="np-section-header">Upcoming Courses</div>
<div class="upcoming events">
{% if training_events.available.any? %}
{% for training_event in training_events.available limit:1 %}
{% include "cards_training_event" with training_event %}
{% endfor %}
<div class="see-more-wrapper">
<a href="/app/training_events" style="margin-top:24px;">See more</a>
</div>
{% else %}
{% include "training_events_zero_state" %}
{% endif %}
{% else %}
<div class="np-homepage-featured-empty">
<div class="np-zero-state-text">
{% t .empty, key: current_school.course_vocabulary %}
</div>
<img
class="np-zero-state-courses"
alt="{% t .empty, key: current_school.course_vocabulary %}"
/>
</div>
</div>
{% endif %} {% endcomment %}
{% endif %}
</div>
<div class="col-xs-12 col-sm-3">
<div id="divContentbyProduct" class="content-by-product">
<div class="left-content-title">
Content By Product
</div>
{% include "content_by_cards" %}
</div>
<div style="display: flex;flex-direction: row-reverse;">
<a id="seemore" >See more..</a>
</div>
<div id="divCalender" class="upcomongevents">
<div class="left-content-title">
Upcoming Events
</div>
{% include "calendar" %}
</div>
<div id="divGetCertified" class="content-by-product">
<div class="left-content-title">
Get Certified
</div>
{% include "content_by_cards" %}
</div>
<div style="display: flex;flex-direction: row-reverse;">
<a id="seemore1" >See more..</a>
</div>
</div>
</div>
</div>
{% include "homepage_ongoing_training", items: catalog_courses %}
{% include "homepage_topics" %}
<button
type="button"
class="popup-trigger"
data-toggle-class-on-target
data-toggle-target="#firstTimeUsers"
data-toggle-escape
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" %}
<div
class="first-time-user-popup"
id="firstTimeUsers"
role="dialog"
aria-labelledby="dialogTitle"
aria-describedby="dialogContent"
aria-hidden="true">
<section class="first-time-user-popup-container">
<div id="dialogContent" class="first-time-user-popup-content">
<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>
{% 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>
</div>
{% if current_person.signed_in? %}
{% unless current_person.email contains "+preview" %}
{% 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 {
showPopup()
}
</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")
document.querySelector(".np-header").classList.add("homepage-nav")
}
document.querySelector(".np-hidden-desktop .dropdown-arrow").addEventListener("click", function(e) {
if (e.target.parentElement.classList.contains("open")) {
e.target.parentElement.classList.remove("open")
} else {
e.target.parentElement.classList.add("open")
}
})
window.onload = function () {
var stickySubNav = document.querySelector('.np-sub-navigation');
var headerOffset = findOffset(stickySubNav);
window.onscroll = function() {
var bodyScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
if (bodyScrollTop > (headerOffset.top - 24)) {
stickySubNav.classList.add('fixed');
} else {
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) {
var top = 0, left = 0;
do {
top += element.offsetTop || 0;
left += element.offsetLeft || 0;
element = element.offsetParent;
} while(element);
return {
top: top,
left: left
};
}
window.addEventListener("load", function() {
var progressCards = document.querySelectorAll(".np-card-learning-path-progress");
for (var i = 0; i < progressCards.length; i++ ) {
var lpProgressCard = progressCards[i]
var progressRing = lpProgressCard.querySelector(".progress-ring")
let circle = progressRing.querySelector(".circle-progress")
let total = progressRing.getAttribute("data-total")
let numCompleted = lpProgressCard.querySelector(".lp-completed-items span > div").getAttribute("data-completed")
var radius = circle.r.baseVal.value;
var circumference = radius * 2 * Math.PI;
circle.style.strokeDasharray = `${circumference} ${circumference}`;
circle.style.strokeDashoffset = `${circumference}`;
const percent = numCompleted / total
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 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
}
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;
}, 250)
}
</script>
<style>
.left-content-title {
font-size: 25px;
font-weight: 900;
line-height: 15px;
margin: 20px 0;
}
.content-by-product {
height: 300px;
overflow: hidden;
}
.upcomongevents {
height: 350px;
}
#seemore:hover {
cursor: pointer;
}
.np-homepage-hero {
background-color:#3C228A;
padding: 40px 24px 24px;
@ -537,4 +239,41 @@
line-height: 58px;
}
}
.np-homepage-featured-text {
align-items: start;
display: flex;
flex-direction: column;
text-align: left;
}
.np-dashboard-resources-title {
/* margin-bottom: 8px; */
color: #333;
text-transform: unset;
margin-left: 15px;
}
</style>
<script>
$(document).ready(function(){
$("#seemore").click(function () {
if ($("#divContentbyProduct").height() == "300")
{
$("#divContentbyProduct").height("auto");
$("#seemore").html("Show less..");
}
else
{
$("#divContentbyProduct").height("300");
$("#seemore").html("See more..");
}
$("#divContentbyProduct").overflow("hidden");
});
});
</script>

View File

@ -1 +1,2 @@
{% body %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

View File

@ -66,18 +66,8 @@ html {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.np-resource-title,
.np-dashboard-resources-title {
color: #333;
font-weight: 400;
font-size: 24px;
line-height: 32px;
}
.np-dashboard .np-dashboard-resources-title {
margin-bottom: 20px;
text-transform:capitalize;
}
.np-resource-subtitle {
color: #333;
@ -130,10 +120,6 @@ html {
color: #333;
}
.np-dashboard-resources-title {
margin-bottom: 8px;
color: #333;
}
.np-learning-paths-resources-container,
.np-dashboard-resources-container {
@ -234,17 +220,7 @@ html {
padding-top: 64px;
}
.np-sub-navigation:not(.homepage-nav):not(.np-page-container) {
position: fixed;
top: 64px;
left: 0;
width: 100%;
background-color: #fff;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
padding-top: 0px;
margin-bottom: 0;
z-index: 49;
}
.np-sub-navigation.fixed {
position: fixed;

View File

@ -31,7 +31,7 @@
fa-arrow-left{% endcapture %}
{% include "mobile_header", title: "Resource Center", back_icon: icon, back_link: "javascript:sendMessage();" %}
{% if current_school.properties.banner_toggle == true %}
<div class="np-alert" style="height: 70px; margin-top: 50px; padding: 0 0 5px 5px; color:#000000; font-size: 16px; background-color:#FFC220" >
<div class="np-alert" style="height: 70px; margin-top: 50px; padding: 5px 5px 5px 15px; color:#000000; font-size: 16px; background-color:#FFC220" >
{{ current_school.properties.banner_text }}
</div>
{% endif %}

View File

@ -31,3 +31,4 @@ KARBON = "peQbnkfUnYLGPfIzyCxfLs634"
BLOOMERANG = "ewGDqLgsklMnytqzUka2wmgIi"
GSU = "rUUKNuBZ0rmRNPftB4smYhQ5L"
EMPLOY = "qcNggCm4SBtC0gTqLGv30vX8l"
LUMAFINTECH = "oDFA7XSmjEKjEwIDIKLm0rxs1"

View File

@ -12,20 +12,6 @@ HEADERS = {
}
BASEURL = "https://api.northpass.com/v2/"
GROUPS = [
"Academic Economics",
"Academy Use/Navigation",
"Accreditation",
"Anthology 101",
"Baseline",
"Course Evaluations",
"Engage",
"Evaluate",
"Finance & HCM",
"Learn",
"Portfolio",
"Power BI",
"Raise",
"Reach",
"Student",
]
@ -34,23 +20,24 @@ def all_groups():
Get all Group IDs
"""
gids = []
group_count = 0
while True:
group_count += 1
url = f"https://api.northpass.com/v2/groups?page={group_count}"
gresponse = requests.get(url, headers=HEADERS)
gdata = gresponse.json()
gnext = gdata["links"]
for group in GROUPS:
group_count = 0
while True:
group_count += 1
url = f"https://api.northpass.com/v2/groups?filter[name][cont]={group}&page={group_count}"
gresponse = requests.get(url, headers=HEADERS)
gdata = gresponse.json()
gnext = gdata["links"]
for response in gdata["data"]:
group_id = response["id"]
group_name = response["attributes"]["name"]
group_tupe = (group_id, group_name)
print(group_tupe)
gids.append(group_tupe)
for response in gdata["data"]:
group_id = response["id"]
group_name = response["attributes"]["name"]
group_tupe = (group_id, group_name)
print(group_tupe)
gids.append(group_tupe)
if "next" not in gnext:
break
if "next" not in gnext:
break
get_courses(gids)

View File

@ -0,0 +1,17 @@
import requests
import Apikeys
import pprint
PP = pprint.PrettyPrinter(indent=4)
APIKEY = Apikeys.LUMAFINTECH
HEADERS = {"content-type": "application/json", "X-Api-Key": APIKEY }
BASEURL = "https://api.northpass.com/v2/webhooks"
FILTURL = f"{BASEURL}?filter[attempt_left][eq]=28"
# filter[type][in]=course_completed_events
print(FILTURL)
response = requests.get(FILTURL, headers=HEADERS)
resp = response.json()
for i in resp['data']:
print(i['attributes']['created_at'] )
# PP.pprint(resp)