diff --git a/apps/management/templates/remove_orthomosaic.html b/apps/management/templates/remove_orthomosaic.html new file mode 100644 index 0000000..5b1e556 --- /dev/null +++ b/apps/management/templates/remove_orthomosaic.html @@ -0,0 +1,87 @@ +{% extends "default.html" %} +{% load static %} +{% load mysettings %} + + +{% block header_link %} + + + + + + +{% endblock header_link %} +{% block content %} +
+
+
+
+

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

+
+ +
+
+
+ +
+
+ {% csrf_token %} +
+
+ +
+
+
Удаление ортофотоплана
+
+

Вы уверены, что хотите удалить ортофотоплан?

+
+ +
+ +
+ +
+ +
+
+
+{% endblock %} +{% block script_footer %} + + +{% endblock script_footer %} + diff --git a/apps/management/templates/settings.html b/apps/management/templates/settings.html index c519eb8..b7a3704 100644 --- a/apps/management/templates/settings.html +++ b/apps/management/templates/settings.html @@ -20,23 +20,23 @@ {% endblock header_link %} {% block content %} -
-
-
-
-

Параметры системы

+
+
+
+
+

Параметры системы

+
+
+ +
-
- -
-
-
-
+ + -
+
{% csrf_token %} @@ -59,7 +59,12 @@ +
-
-
- {% csrf_token %} -
-
-
-
-
Общие параметры
-
-
-
- -
- -
-
-
- -
-
-
-
-
- -
-
- {% csrf_token %} -
-
-
-
-
Пользователи
-
-
-
-
-
-
-
-
- Добавить - {% block pagination %} - {% if is_paginated %} -
    - {% if 1 < start_page_list %} -
  • - .. -
  • - - {% endif %} - {% for n in page_list %} - {% if n == page_object.number %} -
  • - {{n}} -
  • - {% else %} -
  • - {{n}} -
  • - {% endif %} - {% endfor %} - {% if end_page_list < num_pages %} -
  • - .. -
  • - - {% endif %} -
- - {% endif %} - {% endblock %} - -
-
- - - - - - - - - - - {% if user_list %} - {% for catalog in user_list %} - {% if not catalog.block %} - - {% else %} - - {% endif %} - - - - - - - {% endfor %} - {% endif %} - -
ПользовательРольТолько просмотр
- - {% csrf_token %} - - - - - {{ catalog.username }} - -
{{catalog.profile.get_role}}
-
-
{{ catalog.profile.get_readonly }}
- -
-
-
-
-
-
-
-
-
-
- - -
- -
-
- {% csrf_token %} -
-
-
-
-
Сейсмические процессы
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- Параметры сервера СИГИ -

-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
-
-
-
- - -
- -
{% csrf_token %}
-
{% csrf_token %}
-
- -
-
-
-
-
Система навигации горнотранспортного оборудования
-
-
-
- -
- +
+
+ {% csrf_token %} +
+
+
+
+
Общие параметры
+
+
+
+ +
+
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
+
+ +
+
+
+ +
-
-
-
-

- -

+
+
+ {% csrf_token %} +
+
+
+
+
Пользователи
+
+
+
+
+
+
+
+
+ Добавить + {% block pagination %} + {% if is_paginated %} +
    + {% if 1 < start_page_list %} +
  • + .. +
  • + + {% endif %} + {% for n in page_list %} + {% if n == page_object.number %} +
  • + {{ n }} +
  • + {% else %} +
  • + {{ n }} +
  • + {% endif %} + {% endfor %} + {% if end_page_list < num_pages %} +
  • + .. +
  • + + {% endif %} +
+ + {% endif %} + {% endblock %} + +
+
+ + + + + + + + + + + {% if user_list %} + {% for catalog in user_list %} + {% if not catalog.block %} + + {% else %} + + {% endif %} + + + + + + + {% endfor %} + {% endif %} + +
ПользовательРольТолько + просмотр +
+ + {% csrf_token %} + + + + + + {{ catalog.username }} + + +
{{ catalog.profile.get_role }}
+
+
{{ catalog.profile.get_readonly }} +
+ +
+
+
+
+
+
-
-
-
Изображения загружаются автоматически при выборе
- {% for gto_icon in gto_icons %} -
- -
-
- Сейчас выбран: /{{ gto_icon.path }} - +
+
+
+
+ +
+ +
+
+ {% csrf_token %} +
+
+
+
+
Сейсмические процессы
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ Параметры сервера СИГИ +

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ + +
+ +
{% csrf_token %}
+
{% csrf_token %}
+
+ +
+
+
+
+
Система навигации горнотранспортного оборудования
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
Изображения загружаются автоматически при выборе +
+ {% for gto_icon in gto_icons %} +
+ +
+
+ Сейчас выбран: /{{ gto_icon.path }} + +
+
+ {% endfor %} + Добавить + изображение
- {% endfor %} - Добавить изображение -
-
-
-
- -
- -
-
-
-
-
- -
-
- {% csrf_token %} -
-
-
-
-
Местоположение персонала
-
-
-
- -
-
-
+
-
- -
- -
+
+ -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
- -
-
+ + + + +
-
-
- {% csrf_token %} -
-
-
-
-
Система оповещения
-
-
-
- -
- +
+ + {% csrf_token %} +
+
+
+
+
Местоположение персонала
+
+
+
+ +
+
-
- {% if plasystem == "Radiusip" %} -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- {% elif plasystem == "Asterisk" %} -
- -
- -
-
-
- -
- -
-
- {% endif %} -
- -
-
-
- -
-
-
- {% csrf_token %} -
-
-
-
-
Геомеханические процессы
-
-
-
- -
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+
+ {% csrf_token %} +
+
+
+
+
Система оповещения
+
+
+
+ +
+ +
+
+ {% if plasystem == "Radiusip" %} +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ {% elif plasystem == "Asterisk" %} +
+ +
+ +
+
+
+ +
+ +
+
+ {% endif %} +
+ +
+
+
+
+
+ +
+
+ {% csrf_token %} +
+
+
+
+
Геомеханические процессы
+
+
+
+ +
- - -
- - + + +
+ + +
+
+ -
- -
-
-
-
-
+
+
+
+ +
{% endblock %} {% block footer %}{% endblock %} {% block script_footer %} - - + {% endblock script_footer %} diff --git a/apps/management/urls.py b/apps/management/urls.py index 45d95b0..d5d6b30 100644 --- a/apps/management/urls.py +++ b/apps/management/urls.py @@ -4,12 +4,13 @@ from django.conf.urls import ( # Используйте include() чтобы д from django.contrib.auth.decorators import login_required from apps.management.views import views_management, views_user -from apps.management.views.views_settings import add_orthomosaic, gto_icon_add +from apps.management.views.views_settings import add_orthomosaic, gto_icon_add, remove_orthomosaic urlpatterns = [ url(r"^$", views_management.main_index, name="main_index"), url(r"^gto_icon_add/$", gto_icon_add, name="gto_icon_add"), url(r"add_orthomosaic/$", add_orthomosaic, name="add_orthomosaic"), + url(r"remove_orthomosaic/$", remove_orthomosaic, name="remove_orthomosaic"), url(r"^user/add/$", views_user.user_add, name="user_add"), url(r"^user/$", views_user.user_edit, name="user_edit"), url(r"^user/password/$", views_user.user_password_edit, name="user_password_edit"), diff --git a/apps/management/views/views_settings.py b/apps/management/views/views_settings.py index 9eab44f..c21c6d1 100644 --- a/apps/management/views/views_settings.py +++ b/apps/management/views/views_settings.py @@ -72,8 +72,9 @@ def oset_save(request): continue if param == "geoproc_many_sectors": # TODO вынужденный костыль. До переработки системы настроек - another_sectors_exists = Sector.objects.all().exclude( - name="Основной участок").exists() + another_sectors_exists = ( + Sector.objects.all().exclude(name="Основной участок").exists() + ) if another_sectors_exists: continue element_link = Settings.objects.filter(name=param).first() @@ -210,6 +211,21 @@ def main_index(request): return redirect("/management/") +@login_required(login_url="/") +@never_cache +def remove_orthomosaic(request): + try: + if request.method == "GET": + context = generalmodule.get_context_template() + return render(request, "remove_orthomosaic.html", context) + if request.method == "POST": + shutil.rmtree("media/map/orth") + return redirect("/management/") + except Exception as err: + logging.error(traceback.format_exc()) + return redirect("/management/") + + @login_required(login_url="/") @never_cache def add_orthomosaic(request):