Updated page layout for fullscreen

This commit is contained in:
2025-11-10 13:41:37 -05:00
parent 316809756b
commit 5bdf460e8b
3 changed files with 644 additions and 302 deletions
+35 -2
View File
@@ -59,6 +59,8 @@
</div>
<div class="filters-form">
<form method="GET" action="{{ url_for('attendance_report') }}">
<!-- Hidden field to preserve fullscreen state -->
<input type="hidden" id="fullscreenState" name="fullscreen" value="">
<div class="filter-row">
<!-- Date Range Filters -->
<div class="filter-group">
@@ -410,11 +412,33 @@ const hasEditPermission = ['admin'].includes(userRole);
const hasLocationAccuracy = {{ 'true' if has_location_accuracy_feature else 'false' }};
function clearFilters() {
window.location.href = "{{ url_for('attendance_report') }}";
// Get current fullscreen state
const fullscreenState = window.isAttendanceFullscreen && window.isAttendanceFullscreen() ? '1' : '';
// Redirect to clean URL with only fullscreen parameter if active
if (fullscreenState === '1') {
window.location.href = '{{ url_for('attendance_report') }}?fullscreen=1';
} else {
window.location.href = '{{ url_for('attendance_report') }}';
}
}
function refreshReport() {
window.location.reload();
// Get current fullscreen state
const fullscreenState = window.isAttendanceFullscreen && window.isAttendanceFullscreen() ? '1' : '';
// Build URL with current filters and fullscreen state
const params = new URLSearchParams(window.location.search);
// Add or update fullscreen parameter
if (fullscreenState === '1') {
params.set('fullscreen', '1');
} else {
params.delete('fullscreen');
}
// Reload with preserved state
window.location.href = window.location.pathname + '?' + params.toString();
}
function showLocationMap(recordId) {
@@ -651,6 +675,15 @@ document.addEventListener('DOMContentLoaded', function() {
initializeFullscreen();
console.log('Fullscreen functionality initialized for attendance report');
}
// Check if we should restore fullscreen from URL parameter
const urlParams = new URLSearchParams(window.location.search);
const shouldBeFullscreen = urlParams.get('fullscreen') === '1';
if (shouldBeFullscreen) {
console.log('URL indicates fullscreen should be active');
// The initializeFullscreen function will handle restoration
}
});
</script>
{% endblock %}