From 386e9defbea931ebc5139a5db5c74e6f44bbbe02 Mon Sep 17 00:00:00 2001 From: spl3g Date: Mon, 1 Jun 2026 17:38:35 +0300 Subject: add product creation page and search filters --- core/templates/core/login.html | 2 ++ core/templates/core/product_form.html | 15 +++++++++++++ core/templates/core/product_list.html | 42 +++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 core/templates/core/product_form.html (limited to 'core/templates') diff --git a/core/templates/core/login.html b/core/templates/core/login.html index c17f521..098a9fd 100644 --- a/core/templates/core/login.html +++ b/core/templates/core/login.html @@ -27,5 +27,7 @@ + + Войти как гость {% endblock %} diff --git a/core/templates/core/product_form.html b/core/templates/core/product_form.html new file mode 100644 index 0000000..81a7075 --- /dev/null +++ b/core/templates/core/product_form.html @@ -0,0 +1,15 @@ +{% extends 'core/base.html' %} + +{% block title %}{% if is_edit %}Редактирование{% else %}Добавление{% endif %} товара - ОООБувь{% endblock %} + +{% block h1 %}{% if is_edit %}Редактирование{% else %}Добавление{% endif %} товара{% endblock %} + +{% block content %} +
+
+ {% csrf_token %} + {{ form }} + +
+
+{% endblock %} diff --git a/core/templates/core/product_list.html b/core/templates/core/product_list.html index ac4b8c7..ad7a5bf 100644 --- a/core/templates/core/product_list.html +++ b/core/templates/core/product_list.html @@ -5,6 +5,48 @@ {% block h1 %}Каталог товаров{% endblock %} {% block content %} +{% if user.role.name == "Администратор" or user.role.name == "Менеджер" %} +
+
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ + {% comment %} +
+ Заказы +
+ {% endcomment %} + + {% if user.role.name == 'Администратор' %} +
+ Добавить товар +
+ {% endif %} +
+
+{% endif %}
{% for product in products %}