backedup cin7 templates. Cloned more courses. Domains to csv for anthology was completed. new GAS script for cin7 courses within a google sheet.
This commit is contained in:
@ -13,6 +13,12 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if log_out %}
|
||||
<script>
|
||||
window.location.replace('https://academy.cin7.com/learners/sign_in');
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% include "header" %}
|
||||
<div class="hero-homepage">
|
||||
<div class="np-max-width">
|
||||
@ -30,3 +36,33 @@
|
||||
</div>
|
||||
</main>
|
||||
{% include "footer" %}
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const categoriesFromURL = urlParams.getAll('category');
|
||||
if (categoriesFromURL.length === 0) {
|
||||
return;
|
||||
}
|
||||
const cards = document.querySelectorAll('.lp-card');
|
||||
|
||||
const cardMatchesCategories = (card, categories) => {
|
||||
const cardCategories = card.getAttribute('categories').split('[$]');
|
||||
return categories.every(category => cardCategories.includes(category));
|
||||
};
|
||||
|
||||
const filterCards = () => {
|
||||
cards.forEach(card => {
|
||||
if (cardMatchesCategories(card, categoriesFromURL)) {
|
||||
card.style.display = 'block';
|
||||
} else {
|
||||
card.style.display = 'none';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
filterCards();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user