Pages are rendered server-side (SEO, no build step), the interactive parts talk to the existing REST API from the browser: - home: banners, categories, hits and new arrivals - catalog: filters (category, brand, price, stock), search, sorting, pagination, filter chips with one-click removal - product card: gallery, price with discount, stock, characteristics, related products - cart: localStorage, quantity controls, live totals - checkout: contacts, delivery, promo code, bonuses, order submission with Idempotency-Key, success screen - login: OTP by phone (debug code shown in dev) and phone/password - account: profile, orders, addresses, bonuses through the API with JWT - static pages from the admin Supporting pieces: - apps/storefront app with views, urls, templates and static CSS/JS - money/discount/attribute template filters - seed_demo management command with demo catalog, banners and pages - Cyrillic search fallback for SQLite: local DB does not fold case for non-ASCII, production PostgreSQL does Tests: 16 storefront cases (pages, filters, search, ordering, 404s, filters formatting); the suite is 61 passing.
87 lines
3.5 KiB
HTML
87 lines
3.5 KiB
HTML
{% load static storefront %}<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{% block title %}{{ site.site_name }}{% endblock %}</title>
|
|
<meta name="description" content="{% block description %}{{ site.site_name }} — одежда и аксессуары{% endblock %}">
|
|
{% block meta %}{% endblock %}
|
|
<link rel="stylesheet" href="{% static 'storefront/css/storefront.css' %}">
|
|
<meta name="csrf-token" content="{{ csrf_token }}">
|
|
</head>
|
|
<body>
|
|
<header class="site-header">
|
|
<div class="container">
|
|
<div class="header-top">
|
|
<a class="logo" href="{% url 'home' %}">HOMM<span>.</span></a>
|
|
<nav class="header-nav">
|
|
<a href="{% url 'catalog' %}">Каталог</a>
|
|
{% for category in menu_categories|slice:":5" %}
|
|
<a href="{% url 'catalog' %}?category={{ category.slug }}">{{ category.name }}</a>
|
|
{% endfor %}
|
|
</nav>
|
|
<div class="header-actions">
|
|
<a href="{% url 'account' %}" data-account-link>Кабинет</a>
|
|
<a href="{% url 'cart' %}">Корзина
|
|
<span class="cart-badge" data-cart-count hidden>0</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="header-search">
|
|
<form action="{% url 'catalog' %}" method="get" role="search">
|
|
<input type="search" name="search" placeholder="Поиск по каталогу: название, артикул, бренд"
|
|
value="{{ filters.search|default:'' }}" aria-label="Поиск по каталогу">
|
|
<button class="btn" type="submit">Найти</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="container">
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="site-footer">
|
|
<div class="container">
|
|
<div class="footer-grid">
|
|
<div>
|
|
<h4>{{ site.site_name }}</h4>
|
|
{% if site.address %}<p>{{ site.address }}</p>{% endif %}
|
|
{% if site.phone %}<p><a href="tel:{{ site.phone }}">{{ site.phone }}</a></p>{% endif %}
|
|
{% if site.email %}<p><a href="mailto:{{ site.email }}">{{ site.email }}</a></p>{% endif %}
|
|
{% if site.working_hours %}<p>{{ site.working_hours }}</p>{% endif %}
|
|
</div>
|
|
<div>
|
|
<h4>Покупателям</h4>
|
|
<a href="{% url 'catalog' %}">Каталог</a>
|
|
<a href="{% url 'cart' %}">Корзина</a>
|
|
<a href="{% url 'account' %}">Личный кабинет</a>
|
|
{% for page in footer_pages %}
|
|
<a href="{% url 'page' page.slug %}">{{ page.title }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
<div>
|
|
<h4>Связь</h4>
|
|
{% if site.telegram_url %}<a href="{{ site.telegram_url }}" rel="noopener">Telegram</a>{% endif %}
|
|
{% if site.vk_url %}<a href="{{ site.vk_url }}" rel="noopener">ВКонтакте</a>{% endif %}
|
|
{% if site.whatsapp_url %}<a href="{{ site.whatsapp_url }}" rel="noopener">WhatsApp</a>{% endif %}
|
|
{% if site.free_delivery_threshold %}
|
|
<p>Бесплатная доставка от {{ site.free_delivery_threshold|money }} ₽</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="footer-bottom">
|
|
<span>© {% now "Y" %} {{ site.site_name }}</span>
|
|
<span>Цены и наличие обновляются из 1С</span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<div class="toast-stack" data-toasts></div>
|
|
<script src="{% static 'storefront/js/site.js' %}" defer></script>
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|