|
|
@ -369,6 +369,14 @@ |
|
|
</table> |
|
|
</table> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div |
|
|
|
|
|
id="entriesCount" |
|
|
|
|
|
class="small text-muted mt-2" |
|
|
|
|
|
aria-live="polite" |
|
|
|
|
|
> |
|
|
|
|
|
Aktuell angezeigt: 0 · Gesamt: 0 |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<%= link_to "Export als CSV", export_csv_entries_path(format: :csv), class: "btn btn-outline-secondary mt-3 w-100 w-md-auto" %> |
|
|
<%= link_to "Export als CSV", export_csv_entries_path(format: :csv), class: "btn btn-outline-secondary mt-3 w-100 w-md-auto" %> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
@ -402,8 +410,16 @@ |
|
|
const minYearFilter = document.getElementById("minYearFilter"); |
|
|
const minYearFilter = document.getElementById("minYearFilter"); |
|
|
const maxYearFilter = document.getElementById("maxYearFilter"); |
|
|
const maxYearFilter = document.getElementById("maxYearFilter"); |
|
|
const columnToggleMenu = document.getElementById("columnToggleMenu"); |
|
|
const columnToggleMenu = document.getElementById("columnToggleMenu"); |
|
|
|
|
|
const entriesCount = document.getElementById("entriesCount"); |
|
|
|
|
|
|
|
|
if (!tbody || !textFilter || !minYearFilter || !maxYearFilter || !columnToggleMenu) return; |
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
!tbody || |
|
|
|
|
|
!textFilter || |
|
|
|
|
|
!minYearFilter || |
|
|
|
|
|
!maxYearFilter || |
|
|
|
|
|
!columnToggleMenu || |
|
|
|
|
|
!entriesCount |
|
|
|
|
|
) return; |
|
|
|
|
|
|
|
|
const headers = Array.from(table.querySelectorAll("thead th")); |
|
|
const headers = Array.from(table.querySelectorAll("thead th")); |
|
|
const sortableHeaders = headers.filter(header => header.classList.contains("sortable")); |
|
|
const sortableHeaders = headers.filter(header => header.classList.contains("sortable")); |
|
|
@ -527,19 +543,45 @@ |
|
|
.join(" "); |
|
|
.join(" "); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const updateEntriesCount = () => { |
|
|
|
|
|
const rows = getRows(); |
|
|
|
|
|
|
|
|
|
|
|
const visibleRows = rows.filter(row => { |
|
|
|
|
|
return row.style.display !== "none"; |
|
|
|
|
|
}).length; |
|
|
|
|
|
|
|
|
|
|
|
entriesCount.textContent = |
|
|
|
|
|
`Aktuell angezeigt: ${visibleRows} · Gesamt: ${rows.length}`; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
const applyFilters = () => { |
|
|
const applyFilters = () => { |
|
|
const query = textFilter.value.trim().toLowerCase(); |
|
|
const query = textFilter.value.trim().toLowerCase(); |
|
|
const minYear = minYearFilter.value ? Number(minYearFilter.value) : null; |
|
|
|
|
|
const maxYear = maxYearFilter.value ? Number(maxYearFilter.value) : null; |
|
|
|
|
|
|
|
|
const minYear = minYearFilter.value |
|
|
|
|
|
? Number(minYearFilter.value) |
|
|
|
|
|
: null; |
|
|
|
|
|
const maxYear = maxYearFilter.value |
|
|
|
|
|
? Number(maxYearFilter.value) |
|
|
|
|
|
: null; |
|
|
|
|
|
|
|
|
getRows().forEach(row => { |
|
|
getRows().forEach(row => { |
|
|
const rowYear = Number(row.dataset.year); |
|
|
const rowYear = Number(row.dataset.year); |
|
|
const matchesQuery = !query || getVisibleRowText(row).includes(query); |
|
|
|
|
|
const matchesMinYear = !minYear || rowYear >= minYear; |
|
|
|
|
|
const matchesMaxYear = !maxYear || rowYear <= maxYear; |
|
|
|
|
|
|
|
|
|
|
|
row.style.display = (matchesQuery && matchesMinYear && matchesMaxYear) ? "" : "none"; |
|
|
|
|
|
|
|
|
const matchesQuery = |
|
|
|
|
|
!query || getVisibleRowText(row).includes(query); |
|
|
|
|
|
|
|
|
|
|
|
const matchesMinYear = |
|
|
|
|
|
minYear === null || rowYear >= minYear; |
|
|
|
|
|
|
|
|
|
|
|
const matchesMaxYear = |
|
|
|
|
|
maxYear === null || rowYear <= maxYear; |
|
|
|
|
|
|
|
|
|
|
|
row.style.display = |
|
|
|
|
|
matchesQuery && matchesMinYear && matchesMaxYear |
|
|
|
|
|
? "" |
|
|
|
|
|
: "none"; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
updateEntriesCount(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const parseNumeric = (value) => { |
|
|
const parseNumeric = (value) => { |
|
|
|