poprawki w user_expenses

This commit is contained in:
Mateusz Gruszczyński
2025-07-25 10:53:50 +02:00
parent 0d5b170cac
commit bb667a2cbd
3 changed files with 44 additions and 18 deletions

View File

@@ -115,6 +115,8 @@ document.addEventListener("DOMContentLoaded", function () {
});
toggleBtn.textContent = allChecked ? "🚫 Odznacz wszystkie" : "✅ Zaznacz wszystkie";
const updateTotalEvent = new Event('change');
checkboxes.forEach(cb => cb.dispatchEvent(updateTotalEvent));
});
});
@@ -125,4 +127,15 @@ document.getElementById("applyCustomRange")?.addEventListener("click", () => {
const url = `/user_expenses?start_date=${start}&end_date=${end}`;
window.location.href = url;
}
});
document.getElementById("showAllLists").addEventListener("change", function () {
const checked = this.checked;
const url = new URL(window.location.href);
if (checked) {
url.searchParams.set("show_all", "true");
} else {
url.searchParams.delete("show_all");
}
window.location.href = url.toString();
});