The shop sells tech, not clothing, so the demo data and page copy now match that: - seven categories: smartphones, laptops, tablets, audio, TVs, home appliances, accessories - fifteen products with real-looking specs (screen, CPU, RAM, storage, energy class, warranty) instead of apparel attributes - hero copy and meta description talk about tech and appliances - banner updated in place by position/sort_order, so re-seeding does not leave a stale duplicate Catalog polish: - brand list and price range now follow the selected category instead of the whole catalog Tests: storefront fixtures renamed to the tech domain; suite is 61 passing.
80 lines
2.9 KiB
HTML
80 lines
2.9 KiB
HTML
{% extends "storefront/base.html" %}
|
|
{% load storefront %}
|
|
|
|
{% block title %}{{ site.site_name }} — техника и электроника{% endblock %}
|
|
|
|
{% block content %}
|
|
{% if banners %}
|
|
<div class="hero">
|
|
{% with banner=banners.0 %}
|
|
{% if banner.image_url %}<img class="hero-image" src="{{ banner.image_url }}" alt="">{% endif %}
|
|
<h1>{{ banner.title }}</h1>
|
|
<p>{{ site.site_name }}: смартфоны, ноутбуки, телевизоры и бытовая техника. Цены и наличие синхронизированы с 1С.</p>
|
|
{% if banner.link_url %}
|
|
<a class="btn btn-accent" href="{{ banner.link_url }}">Смотреть</a>
|
|
{% else %}
|
|
<a class="btn btn-accent" href="{% url 'catalog' %}">Смотреть каталог</a>
|
|
{% endif %}
|
|
{% endwith %}
|
|
</div>
|
|
{% else %}
|
|
<div class="hero">
|
|
<h1>{{ site.site_name }} — техника для дома и работы</h1>
|
|
<p>Смартфоны, ноутбуки, телевизоры и бытовая техника. Цены и наличие обновляются из 1С в реальном времени.</p>
|
|
<a class="btn btn-accent" href="{% url 'catalog' %}">Смотреть каталог</a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if categories %}
|
|
<section class="section">
|
|
<div class="section-head">
|
|
<h2>Категории</h2>
|
|
<a href="{% url 'catalog' %}">Весь каталог</a>
|
|
</div>
|
|
<div class="category-grid">
|
|
{% for category in categories %}
|
|
<a class="category-tile" href="{% url 'catalog' %}?category={{ category.slug }}">
|
|
{% if category.image_url %}<img src="{{ category.image_url }}" alt="">{% endif %}
|
|
<span>{{ category.name }}</span>
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{% if hits %}
|
|
<section class="section">
|
|
<div class="section-head">
|
|
<h2>Хиты продаж</h2>
|
|
<a href="{% url 'catalog' %}?ordering=-is_hit">Все хиты</a>
|
|
</div>
|
|
<div class="product-grid">
|
|
{% for product in hits %}
|
|
{% include "storefront/_product_card.html" %}
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{% if new %}
|
|
<section class="section">
|
|
<div class="section-head">
|
|
<h2>Новинки</h2>
|
|
<a href="{% url 'catalog' %}?ordering=-created_at">Все новинки</a>
|
|
</div>
|
|
<div class="product-grid">
|
|
{% for product in new %}
|
|
{% include "storefront/_product_card.html" %}
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{% if not hits and not new %}
|
|
<div class="empty-state">
|
|
<h2>Каталог пока пуст</h2>
|
|
<p>Товары появятся после первой синхронизации с 1С.</p>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|