Files
santeh-ray/templates/favorites/index.html
Azimkin 29d8302a4f
All checks were successful
Build and Push Docker Image / build (push) Successful in 51s
feat: add favorites feature for users
- 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
2026-05-10 20:06:12 +02:00

40 lines
1.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "_layouts/base.html" %}
{% load static %}
{% block title %}Избранное{% endblock %}
{% block add_css %}
<link rel="stylesheet" href="{% static "css/catalog.css" %}">
<link rel="stylesheet" href="{% static "css/favorites.css" %}">
{% endblock %}
{% block content %}
{% include "_fragments/header.html" with active="favorites" %}
{% include '_fragments/breadcrumbs.html' with url_1='/' text_1='Главная' url_2='/favorites/' text_2='Избранное' %}
<main class="container favorites-page" data-favorites-page>
<section class="favorites-hero">
<p class="favorites-kicker">Личный список</p>
<div class="favorites-hero__row">
<div>
<h1 class="favorites-title">Избранные товары</h1>
<p class="favorites-description">
Здесь собраны товары, которые вы хотите сохранить для быстрого возврата к ним позже.
</p>
</div>
<div class="favorites-counter">
<span class="favorites-counter__value" data-favorites-count-value>{{ favorite_count }}</span>
<span class="favorites-counter__label" data-favorites-count-label>товаров</span>
</div>
</div>
</section>
<section class="favorites-list" aria-label="Список избранных товаров">
{% include "_fragments/item-grid.html" with items=items empty_message="В избранном пока нет товаров." favorites_grid=True %}
</section>
</main>
{% include "_fragments/footer.html" %}
{% endblock %}