From cb392efad6c052220b8619a2e4cfa1ff186ff0b0 Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Wed, 4 Jun 2025 15:00:54 +0700 Subject: [PATCH] =?UTF-8?q?=D0=BA=D1=80=D1=83=D0=B4=D1=8B=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D0=B4=D0=B8=D0=BE=D0=BA=D0=B0=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/management/forms/channel.py | 21 ++ .../templates/channel/form_channel.html | 207 ++++++++++++++++++ .../templates/channel/manage_channel.html | 86 ++++++++ .../templates/channel/remove_channel.html | 87 ++++++++ .../templates/icons/remove_icon.html | 4 +- apps/management/templates/settings.html | 7 +- apps/management/urls.py | 6 + apps/management/views/views_settings.py | 76 +++++++ 8 files changed, 491 insertions(+), 3 deletions(-) create mode 100644 apps/management/forms/channel.py create mode 100644 apps/management/templates/channel/form_channel.html create mode 100644 apps/management/templates/channel/manage_channel.html create mode 100644 apps/management/templates/channel/remove_channel.html diff --git a/apps/management/forms/channel.py b/apps/management/forms/channel.py new file mode 100644 index 0000000..8b9f0ee --- /dev/null +++ b/apps/management/forms/channel.py @@ -0,0 +1,21 @@ +from django import forms +from django.forms import ModelForm + +from apps.pla.models.model_channel import PlaChannel + + +class ChannelForm(ModelForm): + class Meta: + model = PlaChannel + fields = ("name", "uid", "active") + + labels = { + "name": "Наименование", + } + + widgets = { + "name": forms.TextInput(attrs={"class": "form-control", + "placeholder": "Введите наименование"}), + "uid": forms.TextInput(attrs={"class": "form-control", + "placeholder": "Введите идентификатор"}), + } \ No newline at end of file diff --git a/apps/management/templates/channel/form_channel.html b/apps/management/templates/channel/form_channel.html new file mode 100644 index 0000000..075ca7d --- /dev/null +++ b/apps/management/templates/channel/form_channel.html @@ -0,0 +1,207 @@ +{% extends "default.html" %} +{% load static %} +{% load mysettings %} + + +{% block header_link %} + + + + + + +{% endblock header_link %} +{% block content %} +
+
+
+
+

{% if form.instance.pk %}Редактирование{% else %}Добавление{% endif %} канала

+
+ +
+
+
+ +
+
+ {% csrf_token %} +
+
+ +
+
+
+
+ +
+ {{ form.name }} + {% if form.name.errors %} +
+ {% for error in form.name.errors %} +

{{ error }}

+ {% endfor %} +
+ {% endif %} +
+
+
+ +
+ {{ form.uid }} + {% if form.uid.errors %} +
+ {% for error in form.uid.errors %} +

{{ error }}

+ {% endfor %} +
+ {% endif %} +
+
+ + +
+ + +
+ +
+ +
+ +
+
+
+{% endblock %} +{% block script_footer %} + + + + + + + + + + + + + + + + +{% endblock script_footer %} + diff --git a/apps/management/templates/channel/manage_channel.html b/apps/management/templates/channel/manage_channel.html new file mode 100644 index 0000000..7eef57d --- /dev/null +++ b/apps/management/templates/channel/manage_channel.html @@ -0,0 +1,86 @@ +{% extends "default.html" %} +{% load static %} +{% load mysettings %} + +{% block header_link %} + + + + + +{% endblock header_link %} + + +{% block content %} +
+
+
+
+

Управление каналами

+
+ +
+
+
+ +
+
+ {% csrf_token %} +
+
+ +
+
+ +
+ + + + + + + + + + + + {% for channel in catalog %} + + + + + + + {% endfor %} + +
НаименованиеИдентификатор
+ {{ channel.id }} + + {{ channel.name }} + + {{ channel.uid }} + + Удалить
+
+
+ +
+ +
+ +
+
+
+{% endblock %} \ No newline at end of file diff --git a/apps/management/templates/channel/remove_channel.html b/apps/management/templates/channel/remove_channel.html new file mode 100644 index 0000000..0b88adf --- /dev/null +++ b/apps/management/templates/channel/remove_channel.html @@ -0,0 +1,87 @@ +{% extends "default.html" %} +{% load static %} +{% load mysettings %} + + +{% block header_link %} + + + + + + +{% endblock header_link %} +{% block content %} +
+
+
+
+

Удаление ортофотоплана

+
+ +
+
+
+ +
+
+ {% csrf_token %} +
+
+ +
+
+
Удаление канала
+
+

Вы уверены, что хотите удалить канал: {{ object.name }}?

+
+ +
+ +
+ +
+ +
+
+
+{% endblock %} +{% block script_footer %} + + +{% endblock script_footer %} + diff --git a/apps/management/templates/icons/remove_icon.html b/apps/management/templates/icons/remove_icon.html index 81875bb..6d5c488 100644 --- a/apps/management/templates/icons/remove_icon.html +++ b/apps/management/templates/icons/remove_icon.html @@ -27,7 +27,7 @@
-

Удаление ортофотоплана

+

Удаление изображения