diff --git a/app/but/bulletin_but_court.py b/app/but/bulletin_but_court.py index 2c326177c..a4b5dabd0 100644 --- a/app/but/bulletin_but_court.py +++ b/app/but/bulletin_but_court.py @@ -97,6 +97,7 @@ def bulletin_but(formsemestre_id: int, etudid: int = None, fmt="html"): "etud": etud, "formsemestre": formsemestre, "logo": logo, + "prefs": bulletins_sem.prefs, "title": f"Bul. {etud.nom_disp()} BUT (court)", "ue_validation_by_niveau": ue_validation_by_niveau, "ues_acronyms": [ diff --git a/app/but/bulletin_but_court_pdf.py b/app/but/bulletin_but_court_pdf.py index 9446d8479..f1fd112ad 100644 --- a/app/but/bulletin_but_court_pdf.py +++ b/app/but/bulletin_but_court_pdf.py @@ -30,6 +30,7 @@ from app.models import ( from app.scodoc.sco_bulletins_standard import BulletinGeneratorStandard from app.scodoc.sco_logos import Logo from app.scodoc.sco_pdf import PDFLOCK, SU +from app.scodoc.sco_preferences import SemPreferences def make_bulletin_but_court_pdf( @@ -40,6 +41,7 @@ def make_bulletin_but_court_pdf( etud: Identite = None, formsemestre: FormSemestre = None, logo: Logo = None, + prefs: SemPreferences = None, title: str = "", ue_validation_by_niveau: dict[tuple[int, str], ScolarFormSemestreValidation] = None, ues_acronyms: list[str] = None, @@ -79,6 +81,7 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard): etud: Identite = None, formsemestre: FormSemestre = None, logo: Logo = None, + prefs: SemPreferences = None, title: str = "", ue_validation_by_niveau: dict[ tuple[int, str], ScolarFormSemestreValidation @@ -93,6 +96,7 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard): self.etud = etud self.formsemestre = formsemestre self.logo = logo + self.prefs = prefs self.title = title self.ue_validation_by_niveau = ue_validation_by_niveau self.ues_acronyms = ues_acronyms # sans UEs sport @@ -274,16 +278,21 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard): f'{bul["ues"][ue]["moyenne"]["rang"]} / {bul["ues"][ue]["moyenne"]["total"]}' for ue in self.ues_acronyms ], - ["ECTS"] - + [ - f'{self.decision_ues[ue]["ects"]:g}' if ue in self.decision_ues else "" - for ue in self.ues_acronyms - ], + ] + if self.prefs["bul_show_ects"]: + rows += [ + ["ECTS"] + + [ + f'{bul["ues"][ue]["ECTS"]["acquis"]:g} /{bul["ues"][ue]["ECTS"]["total"]:g}' + for ue in self.ues_acronyms + ] + ] + rows += [ ["Jury"] + [ self.decision_ues[ue]["code"] if ue in self.decision_ues else "" for ue in self.ues_acronyms - ], + ] ] blue_bg = Color(183 / 255.0, 235 / 255.0, 255 / 255.0) table_style = [ diff --git a/app/templates/but/bulletin_court_page.j2 b/app/templates/but/bulletin_court_page.j2 index 730ba2b89..8f7aa446d 100644 --- a/app/templates/but/bulletin_court_page.j2 +++ b/app/templates/but/bulletin_court_page.j2 @@ -91,14 +91,19 @@