После рефакторинга
This commit is contained in:
@@ -430,14 +430,7 @@
|
||||
<input type="checkbox" id="select-all" class="form-check-input">
|
||||
</th>
|
||||
<th scope="col" class="text-center" style="min-width: 60px;">
|
||||
<a href="javascript:void(0)" onclick="updateSort('id')" class="text-white text-decoration-none">
|
||||
ID
|
||||
{% if sort == 'id' %}
|
||||
<i class="bi bi-arrow-up"></i>
|
||||
{% elif sort == '-id' %}
|
||||
<i class="bi bi-arrow-down"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% include 'mainapp/components/_sort_header.html' with field='id' label='ID' current_sort=sort %}
|
||||
</th>
|
||||
<th scope="col" style="min-width: 150px;">Имя</th>
|
||||
<th scope="col" style="min-width: 120px;">Спутник</th>
|
||||
@@ -449,34 +442,13 @@
|
||||
<th scope="col" style="min-width: 180px;">Наличие сигнала</th>
|
||||
<th scope="col" class="text-center" style="min-width: 80px;">ТВ или нет</th>
|
||||
<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">
|
||||
Кол-во точек
|
||||
{% if sort == 'objitem_count' %}
|
||||
<i class="bi bi-arrow-up"></i>
|
||||
{% elif sort == '-objitem_count' %}
|
||||
<i class="bi bi-arrow-down"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% include 'mainapp/components/_sort_header.html' with field='objitem_count' label='Кол-во точек' current_sort=sort %}
|
||||
</th>
|
||||
<th scope="col" style="min-width: 120px;">
|
||||
<a href="javascript:void(0)" onclick="updateSort('created_at')" class="text-white text-decoration-none">
|
||||
Создано
|
||||
{% if sort == 'created_at' %}
|
||||
<i class="bi bi-arrow-up"></i>
|
||||
{% elif sort == '-created_at' %}
|
||||
<i class="bi bi-arrow-down"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% include 'mainapp/components/_sort_header.html' with field='created_at' label='Создано' current_sort=sort %}
|
||||
</th>
|
||||
<th scope="col" style="min-width: 120px;">
|
||||
<a href="javascript:void(0)" onclick="updateSort('updated_at')" class="text-white text-decoration-none">
|
||||
Обновлено
|
||||
{% if sort == 'updated_at' %}
|
||||
<i class="bi bi-arrow-up"></i>
|
||||
{% elif sort == '-updated_at' %}
|
||||
<i class="bi bi-arrow-down"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% include 'mainapp/components/_sort_header.html' with field='updated_at' label='Обновлено' current_sort=sort %}
|
||||
</th>
|
||||
<th scope="col" class="text-center" style="min-width: 150px;">Действия</th>
|
||||
</tr>
|
||||
@@ -1016,26 +988,7 @@ function updateItemsPerPage() {
|
||||
window.location.search = urlParams.toString();
|
||||
}
|
||||
|
||||
// Sorting functionality
|
||||
function updateSort(field) {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const currentSort = urlParams.get('sort');
|
||||
|
||||
let newSort;
|
||||
if (currentSort === field) {
|
||||
newSort = '-' + field;
|
||||
} else if (currentSort === '-' + field) {
|
||||
newSort = field;
|
||||
} else {
|
||||
newSort = field;
|
||||
}
|
||||
|
||||
urlParams.set('sort', newSort);
|
||||
urlParams.delete('page');
|
||||
// Preserve polygon filter
|
||||
// (already in urlParams from window.location.search)
|
||||
window.location.search = urlParams.toString();
|
||||
}
|
||||
// Sorting functionality is now handled by sorting.js (loaded via base.html)
|
||||
|
||||
// Setup radio-like behavior for filter checkboxes
|
||||
function setupRadioLikeCheckboxes(name) {
|
||||
|
||||
Reference in New Issue
Block a user