Backedup supplier's templates. GSU tests.
This commit is contained in:
@ -1,10 +1,29 @@
|
||||
<div class="carousel-wrapper">
|
||||
<div class="carousel-heading">Merchandising</div>
|
||||
<div class="carousel-filter-wrapper" id="carousel-filter-wrapper-merchandising">
|
||||
<div class="filter-container">
|
||||
<div class="filter" id="filterToggleMerchandising">Filter</div>
|
||||
</div>
|
||||
<div class="filter-content" id="filterContentMerchandising">
|
||||
<div class="filter-option">
|
||||
<input class="filter-checkbox" type="checkbox" id="m-not-started">
|
||||
<label class="filter-name">Not Started</label>
|
||||
</div>
|
||||
<div class="filter-option">
|
||||
<input class="filter-checkbox" type="checkbox" id="m-in-progress">
|
||||
<label class="filter-name">In Progress</label>
|
||||
</div>
|
||||
<div class="filter-option">
|
||||
<input class="filter-checkbox" type="checkbox" id="m-completed">
|
||||
<label class="filter-name">Completed</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="merchandising-carousel">
|
||||
{% for course in courses.in_catalog %}
|
||||
{% for category in course.categories %}
|
||||
{% if category.name == 'Merchandising' %}
|
||||
<div class="carousel-cards-container">
|
||||
<div class="carousel-cards-container merchandising-courses" progress="{% if course.progress == 100 %}completed{% elsif course.progress == 0 %}not-started{% else %}in-progress{% endif %}">
|
||||
{% include 'cards_course' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -20,13 +39,13 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function() {
|
||||
|
||||
$(".merchandising-carousel").slick({
|
||||
slidesToShow: 3,
|
||||
cssEase: 'linear',
|
||||
prevArrow: '<i class="fal fa-chevron-left"></i>',
|
||||
nextArrow: '<i class="fal fa-chevron-right"></i>',
|
||||
prevArrow: '<i class="fal fa-chevron-left arrow-left"></i>',
|
||||
nextArrow: '<i class="fal fa-chevron-right arrow-right"></i>',
|
||||
infinite: false,
|
||||
responsive: [
|
||||
{
|
||||
@ -45,6 +64,31 @@ $(document).ready(function(){
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById("filterToggleMerchandising").addEventListener("click", function() {
|
||||
const filterWrapper = document.querySelector('#carousel-filter-wrapper-merchandising');
|
||||
filterWrapper.classList.toggle("filter-active");
|
||||
});
|
||||
|
||||
function filterCards1() {
|
||||
const selectedFilters = Array.from(document.querySelectorAll('#filterContentMerchandising .filter-checkbox:checked')).map(checkbox => checkbox.id.replace('m-', ''));
|
||||
const cards = document.querySelectorAll('.merchandising-courses');
|
||||
|
||||
$(".merchandising-carousel").slick('slickUnfilter');
|
||||
|
||||
if (selectedFilters.length === 0) {
|
||||
$(".merchandising-carousel").slick('slickUnfilter');
|
||||
} else {
|
||||
$(".merchandising-carousel").slick('slickFilter', function(index, element) {
|
||||
const cardProgress = element.getAttribute('progress');
|
||||
return selectedFilters.includes(cardProgress);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelectorAll('#filterContentMerchandising .filter-checkbox').forEach(checkbox => {
|
||||
checkbox.addEventListener('change', filterCards1);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user