Рефакторинг и деплоинг

This commit is contained in:
2025-11-09 23:46:08 +03:00
parent 331a9e41cb
commit a0f20f9a60
65 changed files with 5925 additions and 2003 deletions

View File

@@ -1,6 +1,7 @@
{% extends 'mainapp/base.html' %}
{% load static %}
{% load static leaflet_tags %}
{% load l10n %}
{% block title %}{% if object %}Редактировать объект: {{ object.name }}{% else %}Создать объект{% endif %}{% endblock %}
@@ -61,7 +62,7 @@
<div class="col-12 d-flex justify-content-between align-items-center">
<h2>{% if object %}Редактировать объект: {{ object.name }}{% else %}Создать объект{% endif %}</h2>
<div>
<a href="{% url 'home' %}" class="btn btn-secondary btn-action">Назад</a>
<a href="{% url 'mainapp:objitem_list' %}{% if return_params %}?{{ return_params }}{% endif %}" class="btn btn-secondary btn-action">Назад</a>
</div>
</div>
</div>
@@ -76,10 +77,7 @@
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="{{ form.name.id_for_label }}" class="form-label">Имя объекта:</label>
{{ form.name }}
</div>
{% include 'mainapp/components/_form_field.html' with field=form.name %}
</div>
<div class="col-md-6">
<div class="mb-3">
@@ -139,54 +137,30 @@
</div>
<div class="row">
<div class="col-md-3">
<div class="mb-3">
<label for="{{ param_form.id_satellite.id_for_label }}" class="form-label">Спутник:</label>
{{ param_form.id_satellite }}
</div>
{% include 'mainapp/components/_form_field.html' with field=param_form.id_satellite %}
</div>
<div class="col-md-3">
<div class="mb-3">
<label for="{{ param_form.frequency.id_for_label }}" class="form-label">Частота, МГц:</label>
{{ param_form.frequency }}
</div>
{% include 'mainapp/components/_form_field.html' with field=param_form.frequency %}
</div>
<div class="col-md-3">
<div class="mb-3">
<label for="{{ param_form.freq_range.id_for_label }}" class="form-label">Полоса, МГц:</label>
{{ param_form.freq_range }}
</div>
{% include 'mainapp/components/_form_field.html' with field=param_form.freq_range %}
</div>
<div class="col-md-3">
<div class="mb-3">
<label for="{{ param_form.polarization.id_for_label }}" class="form-label">Поляризация:</label>
{{ param_form.polarization }}
</div>
{% include 'mainapp/components/_form_field.html' with field=param_form.polarization %}
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="mb-3">
<label for="{{ param_form.bod_velocity.id_for_label }}" class="form-label">Симв. скорость, БОД:</label>
{{ param_form.bod_velocity }}
</div>
{% include 'mainapp/components/_form_field.html' with field=param_form.bod_velocity %}
</div>
<div class="col-md-3">
<div class="mb-3">
<label for="{{ param_form.modulation.id_for_label }}" class="form-label">Модуляция:</label>
{{ param_form.modulation }}
</div>
{% include 'mainapp/components/_form_field.html' with field=param_form.modulation %}
</div>
<div class="col-md-3">
<div class="mb-3">
<label for="{{ param_form.snr.id_for_label }}" class="form-label">ОСШ:</label>
{{ param_form.snr }}
</div>
{% include 'mainapp/components/_form_field.html' with field=param_form.snr %}
</div>
<div class="col-md-3">
<div class="mb-3">
<label for="{{ param_form.standard.id_for_label }}" class="form-label">Стандарт:</label>
{{ param_form.standard }}
</div>
{% include 'mainapp/components/_form_field.html' with field=param_form.standard %}
</div>
</div>
{% comment %} </div> {% endcomment %}
@@ -220,7 +194,7 @@
<label for="id_geo_latitude" class="form-label">Широта:</label>
<input type="number" step="0.000001" class="form-control"
id="id_geo_latitude" name="geo_latitude"
value="{% if object.geo_obj and object.geo_obj.coords %}{{ object.geo_obj.coords.y }}{% endif %}">
value="{% if object.geo_obj and object.geo_obj.coords %}{{ object.geo_obj.coords.y|unlocalize }}{% endif %}">
</div>
</div>
<div class="col-md-6">
@@ -228,7 +202,7 @@
<label for="id_geo_longitude" class="form-label">Долгота:</label>
<input type="number" step="0.000001" class="form-control"
id="id_geo_longitude" name="geo_longitude"
value="{% if object.geo_obj and object.geo_obj.coords %}{{ object.geo_obj.coords.x }}{% endif %}">
value="{% if object.geo_obj and object.geo_obj.coords %}{{ object.geo_obj.coords.x|unlocalize }}{% endif %}">
</div>
</div>
</div>
@@ -243,7 +217,7 @@
<label for="id_kupsat_longitude" class="form-label">Долгота:</label>
<input type="number" step="0.000001" class="form-control"
id="id_kupsat_longitude" name="kupsat_longitude"
value="{% if object.geo_obj and object.geo_obj.coords_kupsat %}{{ object.geo_obj.coords_kupsat.x }}{% endif %}">
value="{% if object.geo_obj and object.geo_obj.coords_kupsat %}{{ object.geo_obj.coords_kupsat.x|unlocalize }}{% endif %}">
</div>
</div>
<div class="col-md-6">
@@ -251,7 +225,7 @@
<label for="id_kupsat_latitude" class="form-label">Широта:</label>
<input type="number" step="0.000001" class="form-control"
id="id_kupsat_latitude" name="kupsat_latitude"
value="{% if object.geo_obj and object.geo_obj.coords_kupsat %}{{ object.geo_obj.coords_kupsat.y }}{% endif %}">
value="{% if object.geo_obj and object.geo_obj.coords_kupsat %}{{ object.geo_obj.coords_kupsat.y|unlocalize }}{% endif %}">
</div>
</div>
</div>
@@ -266,7 +240,7 @@
<label for="id_valid_longitude" class="form-label">Долгота:</label>
<input type="number" step="0.000001" class="form-control"
id="id_valid_longitude" name="valid_longitude"
value="{% if object.geo_obj and object.geo_obj.coords_valid %}{{ object.geo_obj.coords_valid.x }}{% endif %}">
value="{% if object.geo_obj and object.geo_obj.coords_valid %}{{ object.geo_obj.coords_valid.x|unlocalize }}{% endif %}">
</div>
</div>
<div class="col-md-6">
@@ -274,7 +248,7 @@
<label for="id_valid_latitude" class="form-label">Широта:</label>
<input type="number" step="0.000001" class="form-control"
id="id_valid_latitude" name="valid_latitude"
value="{% if object.geo_obj and object.geo_obj.coords_valid %}{{ object.geo_obj.coords_valid.y }}{% endif %}">
value="{% if object.geo_obj and object.geo_obj.coords_valid %}{{ object.geo_obj.coords_valid.y|unlocalize }}{% endif %}">
</div>
</div>
</div>
@@ -282,16 +256,10 @@
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="{{ geo_form.location.id_for_label }}" class="form-label">Местоположение:</label>
{{ geo_form.location }}
</div>
{% include 'mainapp/components/_form_field.html' with field=geo_form.location %}
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="{{ geo_form.comment.id_for_label }}" class="form-label">Комментарий:</label>
{{ geo_form.comment }}
</div>
{% include 'mainapp/components/_form_field.html' with field=geo_form.comment %}
</div>
</div>
@@ -316,10 +284,7 @@
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="{{ geo_form.is_average.id_for_label }}" class="form-check-label">Усреднённое:</label>
{{ geo_form.is_average }}
</div>
{% include 'mainapp/components/_form_field.html' with field=geo_form.is_average %}
</div>
</div>
@@ -368,7 +333,7 @@
<div class="d-flex justify-content-end mt-4">
<button type="submit" class="btn btn-primary btn-action">Сохранить</button>
{% if object %}
<a href="{% url 'objitem_delete' object.id %}" class="btn btn-danger btn-action">Удалить</a>
<a href="{% url 'mainapp:objitem_delete' object.id %}" class="btn btn-danger btn-action">Удалить</a>
{% endif %}
</div>
{% endif %}