Bulletin BUT court: affichage des ECTS. Fixes #776

This commit is contained in:
Emmanuel Viennet 2023-10-18 17:53:42 +02:00
parent 77b66ba5f2
commit b1ea0080e0
3 changed files with 29 additions and 14 deletions

View File

@ -97,6 +97,7 @@ def bulletin_but(formsemestre_id: int, etudid: int = None, fmt="html"):
"etud": etud, "etud": etud,
"formsemestre": formsemestre, "formsemestre": formsemestre,
"logo": logo, "logo": logo,
"prefs": bulletins_sem.prefs,
"title": f"Bul. {etud.nom_disp()} BUT (court)", "title": f"Bul. {etud.nom_disp()} BUT (court)",
"ue_validation_by_niveau": ue_validation_by_niveau, "ue_validation_by_niveau": ue_validation_by_niveau,
"ues_acronyms": [ "ues_acronyms": [

View File

@ -30,6 +30,7 @@ from app.models import (
from app.scodoc.sco_bulletins_standard import BulletinGeneratorStandard from app.scodoc.sco_bulletins_standard import BulletinGeneratorStandard
from app.scodoc.sco_logos import Logo from app.scodoc.sco_logos import Logo
from app.scodoc.sco_pdf import PDFLOCK, SU from app.scodoc.sco_pdf import PDFLOCK, SU
from app.scodoc.sco_preferences import SemPreferences
def make_bulletin_but_court_pdf( def make_bulletin_but_court_pdf(
@ -40,6 +41,7 @@ def make_bulletin_but_court_pdf(
etud: Identite = None, etud: Identite = None,
formsemestre: FormSemestre = None, formsemestre: FormSemestre = None,
logo: Logo = None, logo: Logo = None,
prefs: SemPreferences = None,
title: str = "", title: str = "",
ue_validation_by_niveau: dict[tuple[int, str], ScolarFormSemestreValidation] = None, ue_validation_by_niveau: dict[tuple[int, str], ScolarFormSemestreValidation] = None,
ues_acronyms: list[str] = None, ues_acronyms: list[str] = None,
@ -79,6 +81,7 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
etud: Identite = None, etud: Identite = None,
formsemestre: FormSemestre = None, formsemestre: FormSemestre = None,
logo: Logo = None, logo: Logo = None,
prefs: SemPreferences = None,
title: str = "", title: str = "",
ue_validation_by_niveau: dict[ ue_validation_by_niveau: dict[
tuple[int, str], ScolarFormSemestreValidation tuple[int, str], ScolarFormSemestreValidation
@ -93,6 +96,7 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
self.etud = etud self.etud = etud
self.formsemestre = formsemestre self.formsemestre = formsemestre
self.logo = logo self.logo = logo
self.prefs = prefs
self.title = title self.title = title
self.ue_validation_by_niveau = ue_validation_by_niveau self.ue_validation_by_niveau = ue_validation_by_niveau
self.ues_acronyms = ues_acronyms # sans UEs sport 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"]}' f'{bul["ues"][ue]["moyenne"]["rang"]} / {bul["ues"][ue]["moyenne"]["total"]}'
for ue in self.ues_acronyms for ue in self.ues_acronyms
], ],
["ECTS"] ]
+ [ if self.prefs["bul_show_ects"]:
f'{self.decision_ues[ue]["ects"]:g}' if ue in self.decision_ues else "" rows += [
for ue in self.ues_acronyms ["ECTS"]
], + [
f'{bul["ues"][ue]["ECTS"]["acquis"]:g} /{bul["ues"][ue]["ECTS"]["total"]:g}'
for ue in self.ues_acronyms
]
]
rows += [
["Jury"] ["Jury"]
+ [ + [
self.decision_ues[ue]["code"] if ue in self.decision_ues else "" self.decision_ues[ue]["code"] if ue in self.decision_ues else ""
for ue in self.ues_acronyms for ue in self.ues_acronyms
], ]
] ]
blue_bg = Color(183 / 255.0, 235 / 255.0, 255 / 255.0) blue_bg = Color(183 / 255.0, 235 / 255.0, 255 / 255.0)
table_style = [ table_style = [

View File

@ -91,14 +91,19 @@
<td class="col_ue">{{bul.ues[ue].moyenne.rang}} / {{bul.ues[ue].moyenne.total}}</td> <td class="col_ue">{{bul.ues[ue].moyenne.rang}} / {{bul.ues[ue].moyenne.total}}</td>
{% endfor %} {% endfor %}
</tr> </tr>
<tr> {% if prefs["bul_show_ects"] %}
<td>ECTS</td> <tr>
{% for ue in ues_acronyms %} <td>ECTS</td>
<td class="col_ue">{{ {% for ue in ues_acronyms %}
"%g"|format(decision_ues[ue].ects) if ue in decision_ues else "" <td class="col_ue">{{
}}</td> "%g"|format(bul["ues"][ue]["ECTS"]["acquis"]) if ue in bul["ues"] else ""
{% endfor %} }} / {{
</tr> "%g"|format(bul["ues"][ue]["ECTS"]["total"]) if ue in bul["ues"] else ""
}}
</td>
{% endfor %}
</tr>
{% endif %}
<tr class="jury"> <tr class="jury">
<td>Jury</td> <td>Jury</td>
{% for ue in ues_acronyms %} {% for ue in ues_acronyms %}