Разделил реперы по наблюдательным станциям
This commit is contained in:
parent
f6f6f7d201
commit
53633edf34
@ -3,116 +3,136 @@
|
||||
{% load mysettings %}
|
||||
|
||||
{% block header_link %}
|
||||
<!-- Select2 -->
|
||||
<link rel="stylesheet" href="{% static 'lte/plugins/select2/css/select2.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link rel="stylesheet" href="{% static 'lte/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<!-- Select2 -->
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'lte/plugins/select2/css/select2.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'lte/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
|
||||
{% endblock header_link %}
|
||||
|
||||
{% block content %}
|
||||
<section class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1>Список реперов</h1>
|
||||
<section class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1>Список реперов</h1>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="/geoproc/">Главная</a></li>
|
||||
<li class="breadcrumb-item active">Список реперов</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="/geoproc/">Главная</a></li>
|
||||
<li class="breadcrumb-item active">Список реперов</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
|
||||
<section class="content text-sm">
|
||||
<div class="container-fluid ">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header text-sm">
|
||||
<a href="../add/" type="button" class="btn bg-gradient-primary float-left" style="margin-right:20px;">Добавить</a>
|
||||
{% block pagination %}
|
||||
{% if is_paginated %}
|
||||
<ul class="pagination pagination no-margin text-sm">
|
||||
{% if 1 < start_page_list %}
|
||||
<li class="paginate_button page-item" id="mypaginator_next">
|
||||
<a class="page-link" href="?page={{start_page_list|add:-1}}" aria-controls="mypaginator" data-dt-idx="{{start_page_list|add:-1}}" style="padding: .3rem .5rem;"><span>..</span></a>
|
||||
</li>
|
||||
<section class="content text-sm">
|
||||
<div class="container-fluid ">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header text-sm">
|
||||
<a href="../add/" type="button" class="btn bg-gradient-primary float-left"
|
||||
style="margin-right:20px;">Добавить</a>
|
||||
{% block pagination %}
|
||||
{% if is_paginated %}
|
||||
<ul class="pagination pagination no-margin text-sm">
|
||||
{% if 1 < start_page_list %}
|
||||
<li class="paginate_button page-item" id="mypaginator_next">
|
||||
<a class="page-link" href="?page={{ start_page_list|add:-1}}"
|
||||
aria-controls="mypaginator" data-dt-idx="{{ start_page_list|add:-1}}"
|
||||
style="padding: .3rem .5rem;"><span>..</span></a>
|
||||
</li>
|
||||
|
||||
{% endif %}
|
||||
{% for n in page_list %}
|
||||
{% if n == page_object.number %}
|
||||
<li class="paginate_button page-item active" id="mypaginator_next">
|
||||
<a class="page-link" href="?page={{n}}" aria-controls="mypaginator" data-dt-idx="{{n}}" style="padding: .3rem .5rem;"><span>{{n}}</span></a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="paginate_button page-item" id="mypaginator_next">
|
||||
<a class="page-link" href="?page={{n}}" aria-controls="mypaginator" data-dt-idx="{{n}}" style="padding: .3rem .5rem;"><span>{{n}}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if end_page_list < num_pages %}
|
||||
<li class="paginate_button page-item" id="mypaginator_next">
|
||||
<a class="page-link" href="?page={{end_page_list|add:1}}" aria-controls="mypaginator" data-dt-idx="{{end_page_list|add:1}}" style="padding: .3rem .5rem;"><span>..</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% for n in page_list %}
|
||||
{% if n == page_object.number %}
|
||||
<li class="paginate_button page-item active" id="mypaginator_next">
|
||||
<a class="page-link" href="?page={{ n }}"
|
||||
aria-controls="mypaginator" data-dt-idx="{{ n }}"
|
||||
style="padding: .3rem .5rem;"><span>{{ n }}</span></a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="paginate_button page-item" id="mypaginator_next">
|
||||
<a class="page-link" href="?page={{ n }}"
|
||||
aria-controls="mypaginator" data-dt-idx="{{ n }}"
|
||||
style="padding: .3rem .5rem;"><span>{{ n }}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if end_page_list < num_pages %}
|
||||
<li class="paginate_button page-item" id="mypaginator_next">
|
||||
<a class="page-link" href="?page={{ end_page_list|add:1}}"
|
||||
aria-controls="mypaginator" data-dt-idx="{{ end_page_list|add:1}}"
|
||||
style="padding: .3rem .5rem;"><span>..</span></a>
|
||||
</li>
|
||||
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
</div> <!-- /.card-header -->
|
||||
<div class="card-body table-responsive p-0">
|
||||
<table class="table table-bordered table-hover table-head-fixed text-nowrap">
|
||||
<thead>
|
||||
</div> <!-- /.card-header -->
|
||||
<div class="card-body table-responsive p-0">
|
||||
<table class="table table-bordered table-hover table-head-fixed text-nowrap">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="col-1"> </th>
|
||||
<th>Наблюдательная станция</th>
|
||||
<th>Наименование</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if page_object %}
|
||||
{% for catalog in page_object.object_list %}
|
||||
<tr>
|
||||
<td style="width:10px;">
|
||||
{{ catalog.id }}
|
||||
</td>
|
||||
<td>
|
||||
<form action="/geoproc/point/edit/?id={{catalog.id}}" id="frm_name_{{catalog.id}}" method="POST" class="floatLeft butDelUser">
|
||||
{% csrf_token %}
|
||||
<a href="#" onclick="document.getElementById('frm_name_{{catalog.id}}').submit(); return false;">
|
||||
{{ catalog.obstation }}
|
||||
</a>
|
||||
<input type="hidden" value="{{catalog.id}}" name="id">
|
||||
</form>
|
||||
{% for catalog in page_object.object_list %}
|
||||
{% if catalog.point_set.all.exists %}
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<form action="/geoproc/point/edit/?id={{catalog.id}}" id="frm_name_{{catalog.id}}" method="POST" class="floatLeft butDelUser">
|
||||
{% csrf_token %}
|
||||
<a href="#" onclick="document.getElementById('frm_name_{{catalog.id}}').submit(); return false;">
|
||||
{{ catalog.name }}
|
||||
</a>
|
||||
<input type="hidden" value="{{catalog.id}}" name="id">
|
||||
</form>
|
||||
<tr>
|
||||
<td>
|
||||
<form action="/geoproc/obstation/edit/?id={{ catalog.id }}"
|
||||
id="frm_name_{{ catalog.id }}" method="POST"
|
||||
class="floatLeft butDelUser w-100 d-flex flex-column mb-0">
|
||||
{% csrf_token %}
|
||||
<a href="#" class=""
|
||||
onclick="document.getElementById('frm_name_{{ catalog.id }}').submit(); return false;">
|
||||
{{ catalog }}
|
||||
</a>
|
||||
<input type="hidden" value="{{ catalog.id }}" name="id">
|
||||
</form>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% for point in catalog.point_set.all %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<form action="/geoproc/point/edit/?id={{ point.id }}"
|
||||
id="frm_name_{{ point.id }}" method="POST"
|
||||
class="floatLeft butDelUser w-100 d-flex flex-column mb-0">
|
||||
{% csrf_token %}
|
||||
<a href="#"
|
||||
onclick="document.getElementById('frm_name_{{ point.id }}').submit(); return false;">
|
||||
{{ point.name }}
|
||||
</a>
|
||||
<input type="hidden" value="{{ point.id }}" name="id">
|
||||
</form>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- /.card-body -->
|
||||
</div> <!-- /.card -->
|
||||
</div> <!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- /.card-body -->
|
||||
</div> <!-- /.card -->
|
||||
</div> <!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from apps.geoproc.models.model_obstation import ObStation
|
||||
from apps.geoproc.models.model_point import Point
|
||||
from apps.geoproc.forms.form_point import PointForm
|
||||
|
||||
@ -90,7 +91,8 @@ def point_add(request):
|
||||
def point_list(request):
|
||||
try:
|
||||
param=request.GET.dict()
|
||||
catalog_list=Point.objects.order_by("name").all()
|
||||
# catalog_list=Point.objects.order_by("obstation").all()
|
||||
catalog_list=ObStation.objects.order_by("name")
|
||||
catalog_count = catalog_list.count()
|
||||
paginator = Paginator(catalog_list, 50)
|
||||
page_number = request.GET.get('page',1)
|
||||
|
||||
@ -43,7 +43,7 @@ INSTALLED_APPS = [
|
||||
"""Информация о приложении """
|
||||
SITE_TITLE = u'Многофункциональная система безопасности ОГР'
|
||||
SITE_TITLE_S = u'МФСБ ОГР'
|
||||
APP_VER = '1.0.06.8'
|
||||
APP_VER = '1.0.07.0'
|
||||
APP_VEK = u'2023 - 2025гг'
|
||||
APP_COPPIRIGHT = u'Многофункциональная система безопасности ОГР'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user