Refactor email templates

This commit is contained in:
badblocks 2025-04-07 18:33:45 -07:00
parent e37731b74d
commit 32da8157a6
31 changed files with 476 additions and 2516 deletions

View file

@ -47,7 +47,7 @@
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Most Offered</h5>
</div>
<div class="card-body my-4 p-0">
{% cache 3600 most_offered_cards %}
{% cache 300 most_offered_cards %}
{% include "home/_card_list.html" with cards=most_offered_cards %}
{% endcache %}
</div>
@ -60,7 +60,7 @@
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Most Wanted</h5>
</div>
<div class="card-body my-4 p-0">
{% cache 3600 most_wanted_cards %}
{% cache 300 most_wanted_cards %}
{% include "home/_card_list.html" with cards=most_wanted_cards %}
{% endcache %}
</div>
@ -73,7 +73,7 @@
<h5 class="text-xl text-center font-semibold whitespace-nowrap truncate mb-0">Least Offered</h5>
</div>
<div class="card-body my-4 p-0">
{% cache 3600 least_offered_cards %}
{% cache 300 least_offered_cards %}
{% include "home/_card_list.html" with cards=least_offered_cards %}
{% endcache %}
</div>
@ -87,7 +87,6 @@
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<!-- Featured Offers -->
<div>
{% cache 3600 featured_offers %}
<div class="p-4 text-center ">
<h5 class="text-xl font-semibold whitespace-nowrap truncate mb-0">Featured Offers</h5>
</div>
@ -102,12 +101,10 @@
<p class="text-center">No featured offers available.</p>
{% endif %}
</div>
{% endcache %}
</div>
<!-- Recent Offers -->
<div>
{% cache 3600 recent_offers %}
<div class="text-center p-4">
<h5 class="text-xl font-semibold whitespace-nowrap truncate mb-0">Recent Offers</h5>
</div>
@ -120,53 +117,7 @@
{% endfor %}
</div>
</div>
{% endcache %}
</div>
</div>
</section>
{% endblock content %}
{% block javascript %}
<script defer>
document.addEventListener('DOMContentLoaded', function() {
// Minimal JavaScript for toggling Featured Offers tabs
const featuredTabs = document.querySelectorAll('input[name="featured_tabs"]');
const featuredTabContents = document.querySelectorAll('#featured-tab-contents .tab-content');
function updateFeaturedTabs() {
featuredTabs.forEach(radio => {
if (radio.checked) {
const target = radio.id;
featuredTabContents.forEach(content => {
content.style.display = content.getAttribute('data-tab') === target ? 'block' : 'none';
});
}
});
}
featuredTabs.forEach(radio => {
radio.addEventListener('change', updateFeaturedTabs);
});
// Initialize tabs on page load
updateFeaturedTabs();
});
</script>
{% endblock %}
{% block css %}
<style>
.tabs-box .tab {
z-index: 1;
}
.tabs-box .tab:checked,
.tabs-box .tab.active {
z-index: 2;
background-color: var(--color-base-200);
accent-color: var(--color-base-200);
}
.tabs-box .tab:focus-visible {
outline: none;
}
</style>
{% endblock %}
{% endblock content %}