Правки и улучшения визуала. Добавил функционал отметок.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% extends 'mainapp/base.html' %}
|
||||
|
||||
{% block title %}Список источников{% endblock %}
|
||||
{% block title %}Список объектов{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<style>
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="container-fluid px-3">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h2>Список источников</h2>
|
||||
<h2>Список объектов</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
|
||||
<!-- LyngSat Filter -->
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Тип источника (ТВ):</label>
|
||||
<label class="form-label">Тип объекта (ТВ):</label>
|
||||
<div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" name="has_lyngsat" id="has_lyngsat_1"
|
||||
@@ -242,7 +242,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive" style="max-height: 75vh; overflow-y: auto;">
|
||||
<table class="table table-striped table-hover table-sm" style="font-size: 0.85rem;">
|
||||
<table class="table table-striped table-hover table-sm table-bordered" style="font-size: 0.85rem;">
|
||||
<thead class="table-dark sticky-top">
|
||||
<tr>
|
||||
<th scope="col" class="text-center" style="width: 3%;">
|
||||
@@ -263,8 +263,9 @@
|
||||
<th scope="col" style="min-width: 150px;">Координаты Кубсата</th>
|
||||
<th scope="col" style="min-width: 150px;">Координаты оперативников</th>
|
||||
<th scope="col" style="min-width: 150px;">Координаты справочные</th>
|
||||
<th scope="col" style="min-width: 180px;">Наличие сигнала</th>
|
||||
{% if has_any_lyngsat %}
|
||||
<th scope="col" class="text-center" style="min-width: 80px;">Тип источника</th>
|
||||
<th scope="col" class="text-center" style="min-width: 80px;">Тип объекта</th>
|
||||
{% endif %}
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">
|
||||
<a href="javascript:void(0)" onclick="updateSort('objitem_count')" class="text-white text-decoration-none">
|
||||
@@ -312,6 +313,29 @@
|
||||
<td>{{ source.coords_kupsat }}</td>
|
||||
<td>{{ source.coords_valid }}</td>
|
||||
<td>{{ source.coords_reference }}</td>
|
||||
<td style="padding: 0.3rem; vertical-align: top;">
|
||||
{% if source.marks %}
|
||||
<div style="font-size: 0.75rem; line-height: 1.3;">
|
||||
{% for mark in source.marks %}
|
||||
<div style="{% if not forloop.last %}border-bottom: 1px solid #dee2e6; padding-bottom: 3px; margin-bottom: 3px;{% endif %}">
|
||||
<div style="margin-bottom: 1px;">
|
||||
{% if mark.mark %}
|
||||
<span class="badge bg-success" style="font-size: 0.7rem;">Есть</span>
|
||||
{% elif mark.mark == False %}
|
||||
<span class="badge bg-danger" style="font-size: 0.7rem;">Нет</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary" style="font-size: 0.7rem;">-</span>
|
||||
{% endif %}
|
||||
<span class="text-muted" style="font-size: 0.7rem;">{{ mark.timestamp|date:"d.m.y H:i" }}</span>
|
||||
</div>
|
||||
<div class="text-muted" style="font-size: 0.65rem;">{{ mark.created_by }}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<span class="text-muted">-</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if has_any_lyngsat %}
|
||||
<td class="text-center">
|
||||
{% if source.has_lyngsat %}
|
||||
@@ -333,7 +357,7 @@
|
||||
<a href="{% url 'mainapp:show_source_with_points_map' source.id %}"
|
||||
target="_blank"
|
||||
class="btn btn-sm btn-outline-success"
|
||||
title="Показать источник с точками на карте">
|
||||
title="Показать объект с точками на карте">
|
||||
<i class="bi bi-geo-alt"></i>
|
||||
<span class="badge bg-success">{{ source.objitem_count }}</span>
|
||||
</a>
|
||||
@@ -365,7 +389,7 @@
|
||||
{% if user.customuser.role == 'admin' or user.customuser.role == 'moderator' %}
|
||||
<a href="{% url 'mainapp:source_update' source.id %}"
|
||||
class="btn btn-sm btn-outline-warning"
|
||||
title="Редактировать источник">
|
||||
title="Редактировать объект">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
@@ -378,7 +402,7 @@
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="11" class="text-center text-muted">Нет данных для отображения</td>
|
||||
<td colspan="12" class="text-center text-muted">Нет данных для отображения</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
@@ -395,7 +419,7 @@
|
||||
<div class="modal-dialog modal-fullscreen">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="sourceDetailsModalLabel">Детали источника #<span id="modalSourceId"></span></h5>
|
||||
<h5 class="modal-title" id="sourceDetailsModalLabel">Детали объекта #<span id="modalSourceId"></span></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@@ -406,6 +430,25 @@
|
||||
</div>
|
||||
<div id="modalErrorMessage" class="alert alert-danger" style="display: none;"></div>
|
||||
<div id="modalContent" style="display: none;">
|
||||
<!-- Marks Section -->
|
||||
<div id="marksSection" class="mb-3" style="display: none;">
|
||||
<h6 class="mb-2">Наличие сигнала объекта (<span id="marksCount">0</span>):</h6>
|
||||
<div class="table-responsive" style="max-height: 200px; overflow-y: auto;">
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width: 20%;">Наличие сигнала</th>
|
||||
<th style="width: 40%;">Дата и время</th>
|
||||
<th style="width: 40%;">Пользователь</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="marksTableBody">
|
||||
<!-- Marks will be loaded here -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="mb-0">Связанные точки (<span id="objitemCount">0</span>):</h6>
|
||||
<div class="dropdown">
|
||||
@@ -441,14 +484,14 @@
|
||||
<li><label class="dropdown-item"><input type="checkbox" class="modal-column-toggle" data-column="18" onchange="toggleModalColumn(this)"> Комментарий</label></li>
|
||||
<li><label class="dropdown-item"><input type="checkbox" class="modal-column-toggle" data-column="19" onchange="toggleModalColumn(this)"> Усреднённое</label></li>
|
||||
<li><label class="dropdown-item"><input type="checkbox" class="modal-column-toggle" data-column="20" onchange="toggleModalColumn(this)"> Стандарт</label></li>
|
||||
<li><label class="dropdown-item"><input type="checkbox" class="modal-column-toggle" data-column="21" checked onchange="toggleModalColumn(this)"> Тип источника</label></li>
|
||||
<li><label class="dropdown-item"><input type="checkbox" class="modal-column-toggle" data-column="21" checked onchange="toggleModalColumn(this)"> Тип объекта</label></li>
|
||||
<li><label class="dropdown-item"><input type="checkbox" class="modal-column-toggle" data-column="22" onchange="toggleModalColumn(this)"> Sigma</label></li>
|
||||
<li><label class="dropdown-item"><input type="checkbox" class="modal-column-toggle" data-column="23" checked onchange="toggleModalColumn(this)"> Зеркала</label></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive" style="max-height: 80vh; overflow-y: auto;">
|
||||
<table class="table table-striped table-hover table-sm" style="font-size: 0.85rem;">
|
||||
<table class="table table-striped table-hover table-sm table-bordered" style="font-size: 0.85rem;">
|
||||
<thead class="table-light sticky-top">
|
||||
<tr>
|
||||
<th class="text-center" style="width: 3%;">
|
||||
@@ -474,7 +517,7 @@
|
||||
<th style="min-width: 150px;">Комментарий</th>
|
||||
<th style="min-width: 100px;">Усреднённое</th>
|
||||
<th style="min-width: 100px;">Стандарт</th>
|
||||
<th style="min-width: 100px;">Тип источника</th>
|
||||
<th style="min-width: 100px;">Тип объекта</th>
|
||||
<th style="min-width: 80px;">Sigma</th>
|
||||
<th style="min-width: 80px;">Зеркала</th>
|
||||
</tr>
|
||||
@@ -534,7 +577,7 @@ function showSelectedOnMap() {
|
||||
const checkedCheckboxes = document.querySelectorAll('.item-checkbox:checked');
|
||||
|
||||
if (checkedCheckboxes.length === 0) {
|
||||
alert('Пожалуйста, выберите хотя бы один источник для отображения на карте');
|
||||
alert('Пожалуйста, выберите хотя бы один объект для отображения на карте');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -555,7 +598,7 @@ function deleteSelectedSources() {
|
||||
const checkedCheckboxes = document.querySelectorAll('.item-checkbox:checked');
|
||||
|
||||
if (checkedCheckboxes.length === 0) {
|
||||
alert('Пожалуйста, выберите хотя бы один источник для удаления');
|
||||
alert('Пожалуйста, выберите хотя бы один объект для удаления');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -774,7 +817,7 @@ function showSourceDetails(sourceId) {
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
if (response.status === 404) {
|
||||
throw new Error('Источник не найден');
|
||||
throw new Error('Объект не найден');
|
||||
} else {
|
||||
throw new Error('Ошибка при загрузке данных');
|
||||
}
|
||||
@@ -785,6 +828,33 @@ function showSourceDetails(sourceId) {
|
||||
// Hide loading spinner
|
||||
document.getElementById('modalLoadingSpinner').style.display = 'none';
|
||||
|
||||
// Show marks if available
|
||||
if (data.marks && data.marks.length > 0) {
|
||||
document.getElementById('marksSection').style.display = 'block';
|
||||
document.getElementById('marksCount').textContent = data.marks.length;
|
||||
|
||||
const marksTableBody = document.getElementById('marksTableBody');
|
||||
marksTableBody.innerHTML = '';
|
||||
|
||||
data.marks.forEach(mark => {
|
||||
const row = document.createElement('tr');
|
||||
|
||||
let markBadge = '<span class="badge bg-secondary">-</span>';
|
||||
if (mark.mark === true) {
|
||||
markBadge = '<span class="badge bg-success">Есть</span>';
|
||||
} else if (mark.mark === false) {
|
||||
markBadge = '<span class="badge bg-danger">Нет</span>';
|
||||
}
|
||||
|
||||
row.innerHTML = '<td class="text-center">' + markBadge + '</td>' +
|
||||
'<td>' + mark.timestamp + '</td>' +
|
||||
'<td>' + mark.created_by + '</td>';
|
||||
marksTableBody.appendChild(row);
|
||||
});
|
||||
} else {
|
||||
document.getElementById('marksSection').style.display = 'none';
|
||||
}
|
||||
|
||||
if (data.objitems && data.objitems.length > 0) {
|
||||
// Show content
|
||||
document.getElementById('modalContent').style.display = 'block';
|
||||
@@ -981,7 +1051,7 @@ function showLyngsatModal(lyngsatId) {
|
||||
'<div class="card-header bg-light"><strong><i class="bi bi-clock-history"></i> Дополнительная информация</strong></div>' +
|
||||
'<div class="card-body"><div class="row">' +
|
||||
'<div class="col-md-6"><p class="mb-2"><span class="text-muted">Последнее обновление:</span><br><strong>' + data.last_update + '</strong></p></div>' +
|
||||
'<div class="col-md-6">' + (data.url ? '<p class="mb-2"><span class="text-muted">Ссылка на источник:</span><br>' +
|
||||
'<div class="col-md-6">' + (data.url ? '<p class="mb-2"><span class="text-muted">Ссылка на объект:</span><br>' +
|
||||
'<a href="' + data.url + '" target="_blank" class="btn btn-sm btn-outline-primary">' +
|
||||
'<i class="bi bi-link-45deg"></i> Открыть на LyngSat</a></p>' : '') +
|
||||
'</div></div></div></div></div></div></div>';
|
||||
@@ -1048,7 +1118,7 @@ function showTransponderModal(transponderId) {
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-primary text-white">
|
||||
<h5 class="modal-title" id="lyngsatModalLabel">
|
||||
<i class="bi bi-tv"></i> Данные источника LyngSat
|
||||
<i class="bi bi-tv"></i> Данные объекта LyngSat
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
|
||||
aria-label="Закрыть"></button>
|
||||
|
||||
Reference in New Issue
Block a user