From 3f26af4ed65006559641d58d8eba6b05a2cd9774 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 19 Mar 2023 11:06:46 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9liore=20affichage=20UE=20capitalis?= =?UTF-8?q?=C3=A9es=20BUT=20en=20PDF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/bulletin_but_pdf.py | 16 ++++++++++------ app/scodoc/sco_preferences.py | 4 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/but/bulletin_but_pdf.py b/app/but/bulletin_but_pdf.py index cd78a9e8..0aa22fcf 100644 --- a/app/but/bulletin_but_pdf.py +++ b/app/but/bulletin_but_pdf.py @@ -159,13 +159,17 @@ class BulletinGeneratorStandardBUT(BulletinGeneratorStandard): blue, ), ] + ues = self.infos["ues"] ues_capitalisees = self.infos.get("ues_capitalisees", {}) - for ue_acronym, ue in self.infos["ues"].items(): - self._ue_rows(rows, ue_acronym, ue, title_bg) - if ue_acronym in ues_capitalisees: - self._ue_rows( - rows, ue_acronym, ues_capitalisees[ue_acronym], title_ue_cap_bg - ) + ues_tup = sorted( + list(ues.items()) + list(ues_capitalisees.items()), + key=lambda x: x[1]["numero"], + ) + for ue_acronym, ue in ues_tup: + is_capitalized = "date_capitalisation" in ue + self._ue_rows( + rows, ue_acronym, ue, title_ue_cap_bg if is_capitalized else title_bg + ) # Global pdf style commands: pdf_style = [ diff --git a/app/scodoc/sco_preferences.py b/app/scodoc/sco_preferences.py index 0c9b4710..5a659bc8 100644 --- a/app/scodoc/sco_preferences.py +++ b/app/scodoc/sco_preferences.py @@ -1363,7 +1363,8 @@ class BasePreferences(object): "bul_show_ue_cap_details", { "initvalue": 0, - "title": "Afficher détail des notes des UE capitalisées sur les bulletins", + "title": "Afficher détail des notes des UE capitalisées sur les bulletins ", + "explanation": "ne concerne pas les bulletins BUT", "input_type": "boolcheckbox", "category": "bul", "labels": ["non", "oui"], @@ -1374,6 +1375,7 @@ class BasePreferences(object): { "initvalue": 1, "title": "Afficher les UE en cours mais capitalisées sur les bulletins", + "explanation": "ne concerne pas les bulletins BUT", "input_type": "boolcheckbox", "category": "bul", "labels": ["non", "oui"],