-
-
+
+
+
+
{% endblock %}
{% block script_footer %}
-
-
-
+
+
+
{% endblock script_footer %}
diff --git a/apps/geoproc/templates/monitoring_journalobs_edit.html b/apps/geoproc/templates/monitoring_journalobs_edit.html
index b72b54d..b5773a3 100644
--- a/apps/geoproc/templates/monitoring_journalobs_edit.html
+++ b/apps/geoproc/templates/monitoring_journalobs_edit.html
@@ -104,7 +104,7 @@
Отметка об ознакомлении начальника участка
Отметка проверяющего о выполнении распоряжения
Отметка об ознакомлении главного геолога
- Отметка об ознакомлении главного технолога
+ Отметка об ознакомлении {{ coordinating_position }}
diff --git a/apps/geoproc/views/views_monitoring_obs.py b/apps/geoproc/views/views_monitoring_obs.py
index 72b8bd8..69e1257 100644
--- a/apps/geoproc/views/views_monitoring_obs.py
+++ b/apps/geoproc/views/views_monitoring_obs.py
@@ -15,7 +15,7 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.models import User
-
+from apps.general.views.settingsmodule import get_settings
from apps.geoproc.models.model_journalobs import JournalObs
from apps.geoproc.models.model_journalobs_table import JournalObsTable
@@ -95,6 +95,7 @@ def monitoring_journal_edit(request):
@never_cache
def monitoring_journal_add(request):
try:
+ get_settings('coordinating_position', 'главного технолога')
date = datetime.now()
day = "0" if date.day < 10 else ""
day += str(date.day)
diff --git a/apps/geoproc/views/views_point.py b/apps/geoproc/views/views_point.py
index 61dc5dc..9c43f66 100644
--- a/apps/geoproc/views/views_point.py
+++ b/apps/geoproc/views/views_point.py
@@ -4,7 +4,6 @@ import os
import io
import json
-
from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
@@ -15,6 +14,7 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.models import User
+from apps.general.views import settingsmodule
from apps.geoproc.models.model_obstation import ObStation
from apps.geoproc.models.model_point import Point
from apps.geoproc.forms.form_point import PointForm
@@ -29,8 +29,8 @@ from apps.util import generalmodule
def point_edit(request):
try:
context = generalmodule.get_context_template()
- param_post=request.POST.dict()
- param_get=request.GET.dict()
+ param_post = request.POST.dict()
+ param_get = request.GET.dict()
if request.method == "GET":
point = Point.objects.get(id=param_get['id'])
@@ -38,49 +38,51 @@ def point_edit(request):
context.update({
'form': form,
'point': point,
- })
- return render(request, 'point_edit.html',context)
+ })
+ return render(request, 'point_edit.html', context)
if request.method == "POST":
point = Point.objects.get(id=param_post['id'])
form = PointForm(instance=point)
context.update({
- 'form':form,
- 'point':point,
- 'mt':'save',
- })
- return render(request, 'point_edit.html',context)
+ 'form': form,
+ 'point': point,
+ 'mt': 'save',
+ })
+ return render(request, 'point_edit.html', context)
except Exception as err:
logging.error(traceback.format_exc())
+
@login_required(login_url='/')
@never_cache
def point_save(request):
try:
- param=request.POST.dict()
+ param = request.POST.dict()
if request.method == "POST":
- if param['id'] =='':
+ if param['id'] == '':
form = PointForm(request.POST)
else:
point = Point.objects.get(id=param['id'])
- form = PointForm(request.POST,instance=point)
+ form = PointForm(request.POST, instance=point)
if form.is_valid():
point = form.save(commit=False)
point.save()
context = generalmodule.get_context_template()
context.update({
- 'form':form,
- 'mt':'edit',
- })
+ 'form': form,
+ 'mt': 'edit',
+ })
return redirect('/geoproc/point/list/')
except Exception as err:
logging.error(traceback.format_exc())
+
@login_required(login_url='/')
@never_cache
def point_add(request):
try:
- param=request.POST.dict()
+ param = request.POST.dict()
if request.method == "POST":
form = PointForm(request.POST)
if form.is_valid():
@@ -88,67 +90,70 @@ def point_add(request):
client.save()
return redirect('/geoproc/point/list/')
else:
- form =PointForm()
+ form = PointForm()
context = generalmodule.get_context_template()
context.update({
- 'form':form,
- 'mt':'add',
- })
- return render(request, 'point_edit.html',context)
+ 'form': form,
+ 'mt': 'add',
+ })
+ return render(request, 'point_edit.html', context)
except Exception as err:
logging.error(traceback.format_exc())
+
@login_required(login_url='/')
@never_cache
def point_list(request):
try:
- param=request.GET.dict()
+ param = request.GET.dict()
# catalog_list=Point.objects.order_by("obstation").all()
- catalog_list=ObStation.objects.prefetch_related('point_set').order_by("name")
+ catalog_list = ObStation.objects.prefetch_related(
+ 'point_set').order_by("name")
for catalog in catalog_list:
catalog.sorted_points = sorted(catalog.point_set.all(),
- key=lambda point: natural_sort_key(point.name))
+ key=lambda point: natural_sort_key(
+ point.name))
catalog_count = catalog_list.count()
paginator = Paginator(catalog_list, 50)
- page_number = request.GET.get('page',1)
- page=paginator.get_page(page_number)
- num_pages=page.paginator.num_pages
- num_pages_krat = num_pages//30
- list_num = int(page_number)//30
- if list_numnum_pages:
- page_list_end=num_pages+1
- page_list_start=((list_num*30)-30)+1
- if page_list_start<1:
- page_list_start=1
- page_list=range(page_list_start,page_list_end)
- end_page_list=list_num*30
- start_page_list=(list_num*30)-29
+ page_number = request.GET.get('page', 1)
+ page = paginator.get_page(page_number)
+ num_pages = page.paginator.num_pages
+ num_pages_krat = num_pages // 30
+ list_num = int(page_number) // 30
+ if list_num < int(page_number) / 30:
+ list_num = list_num + 1
+ page_list_end = (list_num * 30) + 1
+ if page_list_end > num_pages:
+ page_list_end = num_pages + 1
+ page_list_start = ((list_num * 30) - 30) + 1
+ if page_list_start < 1:
+ page_list_start = 1
+ page_list = range(page_list_start, page_list_end)
+ end_page_list = list_num * 30
+ start_page_list = (list_num * 30) - 29
if page.has_previous():
- perv_url='page={}'.format(page.previous_page_number())
+ perv_url = 'page={}'.format(page.previous_page_number())
else:
- perv_url=''
+ perv_url = ''
if page.has_next():
- next_url='page={}'.format(page.next_page_number())
+ next_url = 'page={}'.format(page.next_page_number())
else:
- next_url=''
+ next_url = ''
context = generalmodule.get_context_template()
context.update({
- 'page_object' : page,
- 'is_paginated':page.has_other_pages(),
- 'perv_url':perv_url,
- 'next_url':next_url,
- 'num_pages':num_pages,
- 'menuopen':'menu-open',
- 'puti':'Главная',
- 'page_list':page_list,
- 'end_page_list':end_page_list,
- 'start_page_list':start_page_list,
- 'clients_count':catalog_count,
- })
- return render(request,'point_list.html', context)
+ 'page_object': page,
+ 'is_paginated': page.has_other_pages(),
+ 'perv_url': perv_url,
+ 'next_url': next_url,
+ 'num_pages': num_pages,
+ 'menuopen': 'menu-open',
+ 'puti': 'Главная',
+ 'page_list': page_list,
+ 'end_page_list': end_page_list,
+ 'start_page_list': start_page_list,
+ 'clients_count': catalog_count,
+ })
+ return render(request, 'point_list.html', context)
except Exception as err:
logging.error(traceback.format_exc())
@@ -158,8 +163,23 @@ def point_list(request):
def main_index(request):
try:
context = generalmodule.get_context_template()
+ show_monitoring_list = bool(int(settingsmodule.get_settings(
+ 'show_monitoring_list', '1')))
+ show_monitoring_journal = bool(int(settingsmodule.get_settings(
+ 'show_monitoring_journal', '1'
+ )))
+ show_monitoring_journal_m = bool(int(settingsmodule.get_settings(
+ 'show_monitoring_journal_m', '1'
+ )))
+ show_monitoring_journal_obs = bool(int(settingsmodule.get_settings(
+ 'show_monitoring_journal_obs', '1'
+ )))
context.update({
- })
- return render(request,'geoproc_main.html', context)
+ "geoproc_show_monitoring_list": show_monitoring_list,
+ "geoproc_show_monitoring_journal": show_monitoring_journal,
+ "geoproc_show_monitoring_journal_m": show_monitoring_journal_m,
+ "geoproc_show_monitoring_journal_obs": show_monitoring_journal_obs
+ })
+ return render(request, 'geoproc_main.html', context)
except Exception as err:
logging.error(traceback.format_exc())
-
-
-
+
+
+
-
-
+
-
-
-
-
-
-
-
-
- - Справочники -
-
-
- - Показания -
-
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
- Система контроля геомеханических процессов
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
- - Отчеты -
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + Справочники +
+
+
+ + Показания +
+
+
+
+
+
+
+
+
+
+
+
+ {% if geoproc_show_monitoring_list %}
+
+ {% endif %}
+
+ {% if geoproc_show_monitoring_journal %}
+
+ {% endif %}
+
+ {% if geoproc_show_monitoring_journal_m %}
+
+ {% endif %}
+
+ {% if geoproc_show_monitoring_journal_obs %}
+
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + Отчеты +
+
+
+
+
+
+