feat: add subcategory support for catalog and admin
All checks were successful
Build and Push Docker Image / build (push) Successful in 30s
All checks were successful
Build and Push Docker Image / build (push) Successful in 30s
- Introduced `Subcategory` model with migration and unique slug constraint per category - Enabled subcategory assignment for items with validation to ensure category matching - Updated catalog views to handle subcategories, filtering items accordingly - Enhanced templates (`index.html`, `side-bar.html`, `item-list.html`, `detail.html`) to display subcategories - Added dynamic subcategory dropdown in Django admin with category filtering - Created JavaScript for admin subcategory handling and AJAX population - Wrote comprehensive tests for subcategory functionality in views and admin
This commit is contained in:
@@ -37,7 +37,9 @@
|
||||
</section>
|
||||
|
||||
<section class="product-summary" aria-label="Информация о товаре">
|
||||
<p class="product-summary__category">{{ item.category.name }}</p>
|
||||
<p class="product-summary__category">
|
||||
{{ item.category.name }}{% if item.subcategory %} / {{ item.subcategory.name }}{% endif %}
|
||||
</p>
|
||||
<h1 class="product-summary__title">{{ item.name }}</h1>
|
||||
|
||||
<div class="product-summary__meta">
|
||||
|
||||
Reference in New Issue
Block a user