Feat: Add catalog page with category tree and product grid

- Create catalog view with recursive category tree building
- Add left-side category tree with expand/collapse functionality
- Add right-side product/kit grid with filtering and search
- Include category navigation with product/kit counts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-24 00:31:37 +03:00
parent 157bd50082
commit 4549b2c2c2
8 changed files with 382 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
<!-- navbar.html - Reusable navigation bar component -->
<!-- navbar.html - Компонент навигационной панели -->
<style>
.navbar .dropdown:hover > .dropdown-menu {
display: block;
@@ -7,20 +7,23 @@
</style>
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<div class="container">
<!-- Toggler for mobile view -->
<!-- Кнопка для мобильного вида -->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
aria-controls="navbarNav" aria-expanded="false" aria-label="Переключить навигацию">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Navbar content -->
<!-- Содержимое навигации -->
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
{% if user.is_authenticated %}
<!-- Main navigation links -->
<!-- Основные ссылки навигации -->
<li class="nav-item">
<a class="nav-link {% if request.resolver_match.namespace == 'products' and request.resolver_match.url_name in 'all-products,product-list,productkit-list,product-detail,product-create,product-update,productkit-detail,productkit-create,productkit-update' %}active{% endif %}" href="{% url 'products:all-products' %}">Товары</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.resolver_match.url_name == 'catalog' %}active{% endif %}" href="{% url 'products:catalog' %}"><i class="bi bi-grid-3x3-gap"></i> Каталог</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.resolver_match.namespace == 'products' and 'configurablekit' in request.resolver_match.url_name %}active{% endif %}" href="{% url 'products:configurablekit-list' %}">Вариативные товары</a>
</li>
@@ -55,7 +58,7 @@
<ul class="navbar-nav align-items-center">
{% if user.is_authenticated %}
<!-- Show profile button and logout button for authenticated users -->
<!-- Кнопки профиля и выхода для авторизованных пользователей -->
<li class="nav-item">
<a class="btn btn-outline-primary me-2" href="{% url 'accounts:profile' %}">Профиль</a>
</li>
@@ -68,7 +71,7 @@
<a class="btn btn-outline-secondary ms-2" href="{% url 'accounts:logout' %}">Выйти</a>
</li>
{% else %}
<!-- Show login and register buttons for non-authenticated users -->
<!-- Кнопки входа и регистрации для неавторизованных пользователей -->
<li class="nav-item">
<a class="btn btn-outline-primary me-2" href="{% url 'accounts:login' %}">Вход</a>
</li>
@@ -79,4 +82,4 @@
</ul>
</div>
</div>
</nav>
</nav>