From 70995fbd7e5c02d534d1cf059c233c58486c94f7 Mon Sep 17 00:00:00 2001 From: Iziram Date: Fri, 24 May 2024 09:36:42 +0200 Subject: [PATCH] =?UTF-8?q?Assiduit=C3=A9=20:=20suppression=20pr=C3=A9f?= =?UTF-8?q?=C3=A9rence=20periode=5Fdefaut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_preferences.py | 17 ++--------------- app/templates/assiduites/widgets/timeline.j2 | 2 +- app/views/assiduites.py | 12 +----------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/app/scodoc/sco_preferences.py b/app/scodoc/sco_preferences.py index 53e7af02e..55dd98587 100644 --- a/app/scodoc/sco_preferences.py +++ b/app/scodoc/sco_preferences.py @@ -110,6 +110,7 @@ get_base_preferences(formsemestre_id) Return base preferences for current scodoc_dept (instance BasePreferences) """ + import flask from flask import current_app, flash, g, request, url_for @@ -622,18 +623,6 @@ class BasePreferences: "explanation": "Désactive la saisie et l'affichage des présences", }, ), - ( - "periode_defaut", - { - "initvalue": 2.0, - "size": 10, - "title": "Durée par défaut d'un créneau", - "type": "float", - "category": "assi", - "only_global": True, - "explanation": "Durée d'un créneau en heure. Utilisé dans les pages de saisie", - }, - ), ( "nb_heures_par_jour", { @@ -2302,9 +2291,7 @@ class BasePreferences: if "explanation" in descr: del descr["explanation"] if formsemestre_id: - descr[ - "explanation" - ] = f"""ou utiliser paramètre global""" if formsemestre_id and self.is_global(formsemestre_id, pref_name): diff --git a/app/templates/assiduites/widgets/timeline.j2 b/app/templates/assiduites/widgets/timeline.j2 index 09b8878a5..02113e995 100644 --- a/app/templates/assiduites/widgets/timeline.j2 +++ b/app/templates/assiduites/widgets/timeline.j2 @@ -23,7 +23,7 @@ const tick_time = 60 / {{ tick_time }}; const tick_delay = 1 / tick_time; - const period_default = {{ periode_defaut }}; + const period_default = 2; let handleMoving = false; diff --git a/app/views/assiduites.py b/app/views/assiduites.py index 44e54c432..187b2d979 100644 --- a/app/views/assiduites.py +++ b/app/views/assiduites.py @@ -2229,17 +2229,10 @@ def _differee( dept_id=g.scodoc_dept_id, ) - periode_defaut = sco_preferences.get_preference( - "periode_defaut", - formsemestre_id=formsemestre_id, - dept_id=g.scodoc_dept_id, - ) - return render_template( "assiduites/widgets/differee.j2", etudiants=etudiants, assi_etat_defaut=assi_etat_defaut, - periode_defaut=periode_defaut, forcer_module=forcer_module, moduleimpl_select=moduleimpl_select, date=date, @@ -2316,7 +2309,7 @@ def _module_selector_multiple( ) -def _timeline(formsemestre_id: int = None, heures=None) -> str: +def _timeline(heures=None) -> str: """ _timeline retourne l'html de la timeline @@ -2334,9 +2327,6 @@ def _timeline(formsemestre_id: int = None, heures=None) -> str: t_mid=ScoDocSiteConfig.assi_get_rounded_time("assi_lunch_time", "13:00:00"), t_end=ScoDocSiteConfig.assi_get_rounded_time("assi_afternoon_time", "18:00:00"), tick_time=ScoDocSiteConfig.get("assi_tick_time", 15), - periode_defaut=sco_preferences.get_preference( - "periode_defaut", formsemestre_id - ), heures=heures, )