From 1e33626b60388c07be450442191ea3ae118d2629 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 9 Jan 2024 02:03:16 +0100 Subject: [PATCH] =?UTF-8?q?EDT:=20fix=20pb=20affichage=20signal=C3=A9s=20p?= =?UTF-8?q?ar=20PB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/formsemestre/edt.j2 | 11 +++++++---- sco_version.py | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/templates/formsemestre/edt.j2 b/app/templates/formsemestre/edt.j2 index b4f3c3c03..d828f24a9 100644 --- a/app/templates/formsemestre/edt.j2 +++ b/app/templates/formsemestre/edt.j2 @@ -179,7 +179,6 @@ document.addEventListener('DOMContentLoaded', function() { var renderRange = document.getElementById('renderRange'); var options = calendar.getOptions(); var viewName = calendar.getViewName(); - var html = []; if (viewName === 'day') { html.push(calendar.getDate().toDate().toLocaleString('fr-Fr', { @@ -221,13 +220,15 @@ document.addEventListener('DOMContentLoaded', function() { changeCalendarDate(); } // Update current URL when date change (newDate=ISO string) - function updateCurrentDateInUrl(newDate) { + function updateParametersInUrl(newParams) { // Parse the current URL const currentUrl = new URL(window.location.href); // Access and modify the search parameters const searchParams = currentUrl.searchParams; - searchParams.set('current_date', newDate); // Set the new date + Object.entries(newParams).forEach(([key, value]) => { + searchParams.set(key, value); + }); // Create the new URL const newUrl = `${currentUrl.origin}${currentUrl.pathname}?${searchParams.toString()}`; @@ -240,7 +241,7 @@ document.addEventListener('DOMContentLoaded', function() { setRenderRangeText(); // current calendar date, ISO, without time const iso_date = calendar.getDateRangeStart().toDate().toISOString().split('T')[0]; - updateCurrentDateInUrl(iso_date); + updateParametersInUrl( { current_date: iso_date } ); calendar_control_form.current_date.value = iso_date; } // View menu @@ -260,6 +261,8 @@ document.addEventListener('DOMContentLoaded', function() { const selectedText = this.textContent; const selectedView = this.getAttribute('data-view'); calendar.changeView(selectedView); // Change the calendar view + updateParametersInUrl( { view : selectedView } ); + setRenderRangeText(); dropbtn.textContent = selectedText; // Update the button text dropdownContent.style.display = 'none'; }); diff --git a/sco_version.py b/sco_version.py index 8d330985d..5349b3d36 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.6.75" +SCOVERSION = "9.6.76" SCONAME = "ScoDoc"