From 206471dad5983da9b5d96db443e4ddc7cc81e9e7 Mon Sep 17 00:00:00 2001 From: Nguyen Ngo Date: Wed, 20 Aug 2025 17:33:22 -0400 Subject: [PATCH] Update adding project filter to export data --- static/js/attendance_report.js | 2 ++ templates/export_configuration.html | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/static/js/attendance_report.js b/static/js/attendance_report.js index ad85189..e9b7716 100644 --- a/static/js/attendance_report.js +++ b/static/js/attendance_report.js @@ -1050,6 +1050,8 @@ function exportAttendance() { params.append("location", currentFilters.location); if (currentFilters.employee) params.append("employee", currentFilters.employee); + if (currentFilters.project) + params.append("project", currentFilters.project); // Navigate to export configuration page const configUrl = diff --git a/templates/export_configuration.html b/templates/export_configuration.html index 1bb007f..7b3bd6b 100644 --- a/templates/export_configuration.html +++ b/templates/export_configuration.html @@ -30,7 +30,7 @@ - {% if filters.date_from or filters.date_to or filters.location_filter or filters.employee_filter %} + {% if filters.date_from or filters.date_to or filters.location_filter or filters.employee_filter or filters.project_filter %}
@@ -64,6 +64,12 @@ Employee: {{ filters.employee_filter }} {% endif %} + {% if filters.project_filter %} + + + Project: {{ filters.project_filter }} + + {% endif %}
@@ -77,7 +83,8 @@ - + + @@ -232,11 +239,13 @@ function goBackToReport() { const dateTo = document.querySelector('input[name="date_to"]').value; const locationFilter = document.querySelector('input[name="location_filter"]').value; const employeeFilter = document.querySelector('input[name="employee_filter"]').value; - + const projectFilter = document.querySelector('input[name="project_filter"]').value; + if (dateFrom) params.append('date_from', dateFrom); if (dateTo) params.append('date_to', dateTo); if (locationFilter) params.append('location', locationFilter); if (employeeFilter) params.append('employee', employeeFilter); + if (projectFilter) params.append('project', projectFilter); const url = "{{ url_for('attendance_report') }}" + (params.toString() ? '?' + params.toString() : ''); window.location.href = url;