feat: add favorites feature for users
All checks were successful
Build and Push Docker Image / build (push) Successful in 51s

- Implemented `Favorite` model with unique user-item constraint and timestamped records
- Added `favorites:index` and `favorites:toggle` views with AJAX support for toggling favorites
- Built templates and front-end assets for the favorites page and integration with item grids
- Extended header with favorites link and dynamic counter
- Added tests covering models, views, and templates for the favorites functionality
- Updated admin to enable management of favorites via Django admin interface
This commit is contained in:
2026-05-10 20:06:12 +02:00
parent 812065a34b
commit 29d8302a4f
30 changed files with 1042 additions and 65 deletions

View File

@@ -16,6 +16,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@6.1/dist/fancybox/fancybox.css"/>
<script src="https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@6.1/dist/fancybox/fancybox.umd.js"></script>
<script src="{% static 'js/header-category-dropdown.js' %}"></script>
{% block add_css %}
<!-- Additional CSS -->
{% endblock %}
@@ -48,9 +49,10 @@
closeButton.addEventListener('click', hideToast)
}
window.setTimeout(hideToast, 4000)
window.setTimeout(hideToast, 4000)
})
})
</script>
<script src="{% static 'js/favorites.js' %}"></script>
</body>
</html>