feat: MVP-скелет площадки (Django + MySQL/SQLite, модели по ТЗ §4, базовые страницы)
This commit is contained in:
1 parent
e5f312a00f
commit
8218a568ce
67 files changed
+1929
No files matched your search
@@ -0,0 +1,36 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Создано молодыми{% endblock %}</title>
|
||||
<link rel="stylesheet" href="{% static 'css/style.css' %}">
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-header">
|
||||
<div class="container header-inner">
|
||||
<a class="logo" href="{% url 'catalog:home' %}">Создано молодыми</a>
|
||||
<nav class="nav">
|
||||
<a href="{% url 'catalog:catalog' %}">Каталог</a>
|
||||
{% if user.is_authenticated %}
|
||||
<span class="nav-user">{{ user.full_name|default:user.username }}</span>
|
||||
<a href="{% url 'admin:index' %}">Админка</a>
|
||||
{% else %}
|
||||
<a href="{% url 'admin:login' %}">Войти</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="container">© 2026 «Создано молодыми»</div>
|
||||
</footer>
|
||||
|
||||
<script src="{% static 'js/main.js' %}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<article class="card">
|
||||
<a href="{% url 'catalog:product_detail' p.slug %}">
|
||||
<h3>{{ p.name }}</h3>
|
||||
<p class="price">{{ p.price }} ₽</p>
|
||||
<p class="brand">{{ p.brand.name }}</p>
|
||||
</a>
|
||||
</article>
|
||||
@@ -0,0 +1,16 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}{{ brand.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<h1>{{ brand.name }}</h1>
|
||||
<p>{{ brand.region }}{% if brand.city %} · {{ brand.city }}{% endif %}</p>
|
||||
<p>{{ brand.story }}</p>
|
||||
|
||||
<h2>Товары</h2>
|
||||
<div class="grid">
|
||||
{% for p in products %}
|
||||
{% include 'catalog/_product_card.html' %}
|
||||
{% empty %}
|
||||
<p>У бренда пока нет товаров.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,24 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Каталог{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Каталог</h1>
|
||||
|
||||
<form class="filters" method="get">
|
||||
<input type="search" name="q" value="{{ q }}" placeholder="Поиск по названию...">
|
||||
<select name="category">
|
||||
<option value="">Все категории</option>
|
||||
{% for c in categories %}
|
||||
<option value="{{ c.slug }}" {% if current_category == c %}selected{% endif %}>{{ c.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button class="btn" type="submit">Применить</button>
|
||||
</form>
|
||||
|
||||
<div class="grid">
|
||||
{% for p in products %}
|
||||
{% include 'catalog/_product_card.html' %}
|
||||
{% empty %}
|
||||
<p>Ничего не найдено.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,28 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Создано молодыми — площадка молодых предпринимателей{% endblock %}
|
||||
{% block content %}
|
||||
<section class="hero">
|
||||
<h1>Покупайте у своих</h1>
|
||||
<p>Товары и услуги молодых предпринимателей вашего региона.</p>
|
||||
<a class="btn" href="{% url 'catalog:catalog' %}">Перейти в каталог</a>
|
||||
</section>
|
||||
|
||||
{% if banners %}
|
||||
<section class="banners">
|
||||
{% for b in banners %}
|
||||
<a class="banner" href="{{ b.url|default:'#' }}">{{ b.title }}</a>
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<section class="products">
|
||||
<h2>Новинки</h2>
|
||||
<div class="grid">
|
||||
{% for p in products %}
|
||||
{% include 'catalog/_product_card.html' %}
|
||||
{% empty %}
|
||||
<p>Пока нет товаров.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,18 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}{{ product.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<nav class="breadcrumbs">
|
||||
<a href="{% url 'catalog:catalog' %}">Каталог</a> / {{ product.name }}
|
||||
</nav>
|
||||
|
||||
<article class="product">
|
||||
<h1>{{ product.name }}</h1>
|
||||
<p class="price">{{ product.price }} ₽</p>
|
||||
<p>Бренд:
|
||||
<a href="{% url 'catalog:brand_detail' product.brand.slug %}">{{ product.brand.name }}</a>
|
||||
</p>
|
||||
<p>{{ product.description }}</p>
|
||||
<p>Остаток: {{ product.stock }}</p>
|
||||
<button class="btn" type="button" data-add-to-cart="{{ product.pk }}">В корзину</button>
|
||||
</article>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user