From 0b34fbd720c2b952bf09ae6b2718adbc9ffdf121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D1=88=D0=BA=D0=B8=D0=BD=20=D0=A1=D0=B5=D1=80?= =?UTF-8?q?=D0=B3=D0=B5=D0=B9?= Date: Tue, 16 Dec 2025 10:19:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=B6=D1=83=D1=80=D0=BD=D0=B0=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1?= =?UTF-8?q?=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0029_dailyreport_location_place.py | 18 ++ dbapp/mainapp/models/errors_report.py | 12 + dbapp/mainapp/models/references.py | 2 +- .../templates/mainapp/components/_navbar.html | 49 ++-- .../templates/mainapp/errors_report.html | 265 ++++++++++++++++-- dbapp/mainapp/views/errors_report.py | 17 +- dbapp/mainapp/views/satellite.py | 2 +- 7 files changed, 318 insertions(+), 47 deletions(-) create mode 100644 dbapp/mainapp/migrations/0029_dailyreport_location_place.py diff --git a/dbapp/mainapp/migrations/0029_dailyreport_location_place.py b/dbapp/mainapp/migrations/0029_dailyreport_location_place.py new file mode 100644 index 0000000..001dcff --- /dev/null +++ b/dbapp/mainapp/migrations/0029_dailyreport_location_place.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.7 on 2025-12-16 06:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0028_remove_issue_type_fields'), + ] + + operations = [ + migrations.AddField( + model_name='dailyreport', + name='location_place', + field=models.CharField(choices=[('kr', 'КР'), ('dv', 'ДВ')], default='kr', help_text='К какому комплексу принадлежит журнал', max_length=30, null=True, verbose_name='Комплекс'), + ), + ] diff --git a/dbapp/mainapp/models/errors_report.py b/dbapp/mainapp/models/errors_report.py index 723c4ea..8daef05 100644 --- a/dbapp/mainapp/models/errors_report.py +++ b/dbapp/mainapp/models/errors_report.py @@ -30,6 +30,10 @@ class IssueType(models.Model): class DailyReport(models.Model): """Ежедневный отчёт""" + PLACES = [ + ("kr", "КР"), + ("dv", "ДВ") + ] date = models.DateField( unique=True, verbose_name="Дата", @@ -50,6 +54,14 @@ class DailyReport(models.Model): ) explanation = models.TextField(blank=True, null=True, verbose_name='Пояснение') comment = models.TextField(blank=True, null=True, verbose_name='Комментарий') + location_place = models.CharField( + max_length=30, + choices=PLACES, + null=True, + default="kr", + verbose_name="Комплекс", + help_text="К какому комплексу принадлежит журнал", + ) created_at = models.DateTimeField(auto_now_add=True, verbose_name="Создано") updated_at = models.DateTimeField(auto_now=True, verbose_name="Обновлено") diff --git a/dbapp/mainapp/models/references.py b/dbapp/mainapp/models/references.py index 11bc481..bc71276 100644 --- a/dbapp/mainapp/models/references.py +++ b/dbapp/mainapp/models/references.py @@ -128,7 +128,7 @@ class Band(models.Model): ) def __str__(self): - return self.name + return f"{self.name}({int(self.border_start)}-{int(self.border_end)})МГц" class Meta: verbose_name = "Диапазон" diff --git a/dbapp/mainapp/templates/mainapp/components/_navbar.html b/dbapp/mainapp/templates/mainapp/components/_navbar.html index a9b7608..d5f8d4b 100644 --- a/dbapp/mainapp/templates/mainapp/components/_navbar.html +++ b/dbapp/mainapp/templates/mainapp/components/_navbar.html @@ -29,43 +29,42 @@ - - - - {% if user|has_perm:'kubsat_view' %} {% endif %} - - + + {% if user.customuser.role == 'admin' %} - - {% endif %} - {% if user.customuser.role == 'admin' %} - {% endif %}