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 @@
-

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

+

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