Template changes for Williams-Sonoma, Artera, and Instacart.

This commit is contained in:
Norm Rasmussen
2026-02-26 18:40:09 -05:00
parent c07b4ba0d5
commit f8dcd58b04
8 changed files with 37 additions and 125 deletions

View File

@ -69,7 +69,7 @@
// Grabs Email Address Value
const learnerEmail = $("#learner_email")[0].value;
const blockedEmails = [ "gmail.com", "yahoo.com" ]
const blockedEmails = [ "gmail.com", "yahoo.com", "aol.com", "apple.com", "comcast.com", "google.com", "hotmail.com", "icloud.com", "outlook.com" ]
// "hotmail.com", "aol.com", "outlook.com", "icloud.com", "me.com", "mac.com" ]
if ($("#learner_email")[0].value.length > 0){

View File

@ -37,19 +37,19 @@
function updateFilter(filterId) {
const filterContainer = document.querySelector('#filter-dropdown-' + filterId);
const label = document.querySelector('#filter-dropdown-' + filterId + ' .filter-value-label');
if (filterContainer && label) {
// Get category filter values
const categorySelect = filterContainer.querySelector('select[name="category-filter"]');
const categoryValues = categorySelect ? Array.from(categorySelect.selectedOptions).map(option => option.value) : [];
// Get progress filter values
const progressSelect = filterContainer.querySelector('select[name="progress-filter"]');
const progressValues = progressSelect ? Array.from(progressSelect.selectedOptions).map(option => option.value) : [];
// Calculate total selected count
const totalSelected = categoryValues.length + progressValues.length;
if (totalSelected === 0) {
// Set language-specific "All" text
const allTextEn = label.querySelector('.lang-en');
@ -65,7 +65,7 @@
const selectedText = lang === 'es' ? `${totalSelected} seleccionados` : `${totalSelected} selected`;
label.textContent = selectedText;
}
// Fire custom event with both filter types
const filterUpdateEvent = new CustomEvent('filterUpdate', {
detail: {
@ -74,14 +74,14 @@
progressValues: progressValues
}
});
document.dispatchEvent(filterUpdateEvent);
}
}
function resetFilter(filterId) {
const filterContainer = document.querySelector('#filter-dropdown-' + filterId);
if (filterContainer) {
// Reset category filter
const categorySelect = filterContainer.querySelector('select[name="category-filter"]');
@ -95,7 +95,7 @@
Array.from(categoryDisplay).forEach(child => {
child.remove();
});
// Reset progress filter
const progressSelect = filterContainer.querySelector('select[name="progress-filter"]');
if (progressSelect) {
@ -108,7 +108,7 @@
Array.from(progressDisplay).forEach(child => {
child.remove();
});
// Update the filter to apply the reset
updateFilter(filterId);
}
@ -162,4 +162,4 @@
}
});
</script>
</script>

View File

@ -1,97 +0,0 @@
<button
type="button"
class="catalog-dialog-trigger"
data-toggle-class-on-target
data-toggle-target="#dialog_catalog"
data-toggle-escape
data-toggle-modal
style="display:none">
Click
</button>
<div class="catalog-dialog" id="dialog_catalog">
<section class="catalog-dialog-container">
<div class="catalog-dialog-content">
<h4>
<strong>Welcome to the WSIU Course Catalog.</strong>
</h4>
<p>Welcome to the future home of WSI University. At this time this area is under construction. If needed, please access WSIU through our Homefront site as usual. Do not access courses here at this time. Thank you.</p>
</div>
<footer class="catalog-dialog-footer">
<button
type="button"
class="np-button"
data-toggle-trigger-off>
I Acknowledge
</button>
</footer>
</section>
</div>
<style>
.catalog-dialog {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 100;
display: flex;
padding: 1em;
background-color: rgba(0, 0, 0, 0.75);
visibility: hidden;
opacity: 0;
pointer-events: none;
transition: 0.25s ease-out;
}
.catalog-dialog.is-active {
visibility: visible;
opacity: 1;
pointer-events: auto;
}
.catalog-dialog-container {
width: 100%;
max-width: 700px;
margin: auto;
transform: translateY(-1em) scale(0.95);
background-color: white;
transition: transform 0.25s ease-out;
}
.catalog-dialog.is-active .catalog-dialog-container {
transform: translateY(0) scale(1);
}
.catalog-dialog-content h4 {
font-family: "Lato"
, sans-serif;
font-size: 20px;
}
.catalog-dialog-content {
line-height: normal;
}
.catalog-dialog-content {
padding: 12px 24px;
}
.catalog-dialog-footer {
padding: 0 24px 24px;
}
.catalog-dialog-footer button {
display: inline-block;
cursor: pointer;
}
</style>
<script>
$(document).ready(function(){
if (window.location.pathname == "/app/catalog" && !sessionStorage.catalogAcknowledged) {
$(".catalog-dialog-trigger").click()
sessionStorage.catalogAcknowledged = true;
}
})
</script>

View File

@ -1,3 +1,4 @@
{% comment %}
<button
type="button"
class="catalog-dialog-trigger"
@ -95,3 +96,4 @@
})
</script>
{% endcomment %}

View File

@ -51,7 +51,7 @@
</div>
{% if current_person.signed_in? %}
{% comment %} <div class="np-hidden-mobile np-header-search np-header-search-expanded">
<div class="np-hidden-mobile np-header-search np-header-search-expanded">
<form action="{% route search %}" method="get" data-test="desktop-search">
<input
aria-label="{% t .search %}"
@ -62,7 +62,7 @@
/>
<i class="np-header-search-icon far fa-search"></i>
</form>
</div> {% endcomment %}
</div>
<div class="np-hidden-mobile np-header-avatar">
<button
class="np-header-avatar-button"
@ -164,4 +164,4 @@
align-items: center;
background-color: #000;
}
</style>
</style>

View File

@ -5,10 +5,15 @@
{% if link.label == "Catalog" %}
<div class="np-sub-navigation-content-item {{ link.active_class }}">
<a class="np-sub-navigation-content-item-link" href="{{ link.url }}">
WSIU
Course Catalog
</a>
<div class="np-sub-navigation-content-item-bar np-button-background-color"></div>
</div>
{% elsif link.label == 'Learning Paths' %}
<div class="np-sub-navigation-content-item {{ link.active_class }}" style="display: none">
<a class="np-sub-navigation-content-item-link" href="{{ link.url }}">
</a>
</div>
{% else %}
<div class="np-sub-navigation-content-item {{ link.active_class }}">
<a class="np-sub-navigation-content-item-link" href="{{ link.url }}">
@ -17,7 +22,7 @@
<div class="np-sub-navigation-content-item-bar np-button-background-color"></div>
</div>
{% endif %}
{% endunless %}
{% endunless %}
{% endfor %}
</div>
</nav>

View File

@ -1,5 +1,5 @@
{% include "header" %}
{% include "catalog_popup_message" %}
{% comment %} {% include "catalog_popup_message" %} {% endcomment %}
{% include "sub_navigation" %}
<main class="np-main np-catalog np-subpage-container np-max-width">
@ -90,13 +90,13 @@
const courseCategories = course.getAttribute("data-categories")
const courseDuration = course.getAttribute("data-duration")
if
if
((courseCategories.includes(selectedCategoryFilterID) || selectedCategoryFilterID == "all" ) && (!selectedDurationFilters.length || (courseDuration <= maxDuration && courseDuration >= minDuration))) {
course.style.display = "flex"
} else {
course.style.display = "none"
}
}
})
}
</script>
</script>

View File

@ -86,17 +86,19 @@
if (selectedFilter == 'all') {
$(".filterable-course").show()
} else {
$(".filterable-course").hide()
$(".filterable-course").each(function(index, course) {
const courseFilter = $(course).attr("data-filter")
console.log(courseFilter)
}
else {
$(".filterable-course").hide();
$(".filterable-course").each(function(index, course) {
const courseFilter = $(course).attr("data-filter")
console.log(courseFilter)
if (courseFilter.includes(selectedFilter)) {
$(".filterable-course").show()
}
if (courseFilter.includes(selectedFilter)) {
$(this).show()
}
})
}
})
</script>