feat: add item images, product detail page, and gallery support in catalog
All checks were successful
Build and Push Docker Image / build (push) Successful in 45s

- Added `ItemImage` model with migration for image handling and metadata
- Implemented product gallery in `detail.html` with thumbnails for additional images
- Updated `Item` model to include `primary_image` property for gallery logic
- Enhanced `catalog/index.html` to support item thumbnails
- Updated `catalog.css` for responsive gallery and item list styling
- Extended catalog views to prefetch images for efficient queries
- Added comprehensive tests for catalog and detail views
- Configured Django to serve media files in development
- Updated admin with inline support for managing `ItemImage` entities
This commit is contained in:
2026-04-26 21:55:32 +02:00
parent d0651274d6
commit bb321dfa22
15 changed files with 817 additions and 23 deletions

View File

@@ -1,8 +1,13 @@
<aside>
<section class="categories a-section">
<h2>Категории</h2>
<a href="/catalog/" class="category {% if selected_category.id == None %}active{% endif %}">Все товары</a>
{% for category in categories %}
<a href="/catalog/{{ category.slug }}" class="category">{{ category.name }}</a>
<a href="/catalog/{{ category.slug }}/" class="category {% if selected_category.id == category.slug %}active{% endif %}">
{{ category.name }}
</a>
{% empty %}
<p class="categories-empty">Категории пока не добавлены.</p>
{% endfor %}
</section>
@@ -13,26 +18,22 @@
<form action="">
<section class="a-section cost-section">
<h2>Стоимость</h2>
</section>
<section class="a-section color-section">
<h2>Цвет</h2>
</section>
<section class="a-section material-section">
<h2>Материал</h2>
</section>
<section class="a-section promotions-section">
<h2>Акции</h2>
</section>
<section class="a-section new-section">
<h2>Новинки</h2>
</section>
</form>
</aside>
</aside>