1
0
forked from ScoDoc/ScoDoc

Enrichi tableau jury BUT PV

This commit is contained in:
Emmanuel Viennet 2024-04-02 17:11:07 +02:00
parent 0577347622
commit bde6325391

View File

@ -56,7 +56,17 @@ def pvjury_page_but(formsemestre_id: int, fmt="html"):
line_sep = "\n" line_sep = "\n"
rows, titles = pvjury_table_but(formsemestre, line_sep=line_sep) rows, titles = pvjury_table_but(formsemestre, line_sep=line_sep)
if fmt.startswith("xls"): if fmt.startswith("xls"):
titles["ects_but"] = "Total ECTS BUT" titles.update(
{
"etudid": "etudid",
"code_nip": "nip",
"code_ine": "ine",
"ects_but": "Total ECTS BUT",
"civilite": "Civ.",
"nom": "Nom",
"prenom": "Prénom",
}
)
# Style excel... passages à la ligne sur \n # Style excel... passages à la ligne sur \n
xls_style_base = sco_excel.excel_make_style() xls_style_base = sco_excel.excel_make_style()
xls_style_base["alignment"] = Alignment(wrapText=True, vertical="top") xls_style_base["alignment"] = Alignment(wrapText=True, vertical="top")
@ -116,7 +126,7 @@ def pvjury_table_but(
"pas de référentiel de compétences associé à la formation de ce semestre !" "pas de référentiel de compétences associé à la formation de ce semestre !"
) )
titles = { titles = {
"nom": "Code" if anonymous else "Nom", "nom_pv": "Code" if anonymous else "Nom",
"cursus": "Cursus", "cursus": "Cursus",
"ects": "ECTS", "ects": "ECTS",
"ues": "UE validées", "ues": "UE validées",
@ -146,17 +156,17 @@ def pvjury_table_but(
ects_but_valides = but_ects_valides(etud, referentiel_competence_id) ects_but_valides = but_ects_valides(etud, referentiel_competence_id)
row = { row = {
"nom": ( "nom_pv": (
etud.code_ine or etud.code_nip or etud.id etud.code_ine or etud.code_nip or etud.id
if anonymous # Mode anonyme: affiche INE ou sinon NIP, ou id if anonymous # Mode anonyme: affiche INE ou sinon NIP, ou id
else etud.etat_civil_pv( else etud.etat_civil_pv(
line_sep=line_sep, with_paragraph=with_paragraph_nom line_sep=line_sep, with_paragraph=with_paragraph_nom
) )
), ),
"_nom_order": etud.sort_key, "_nom_pv_order": etud.sort_key,
"_nom_target_attrs": f'class="etudinfo" id="{etud.id}"', "_nom_pv_target_attrs": f'class="etudinfo" id="{etud.id}"',
"_nom_td_attrs": f'id="{etud.id}" class="etudinfo"', "_nom_pv_td_attrs": f'id="{etud.id}" class="etudinfo"',
"_nom_target": url_for( "_nom_pv_target": url_for(
"scolar.fiche_etud", "scolar.fiche_etud",
scodoc_dept=g.scodoc_dept, scodoc_dept=g.scodoc_dept,
etudid=etud.id, etudid=etud.id,
@ -175,9 +185,16 @@ def pvjury_table_but(
if deca if deca
else "" else ""
), ),
# pour exports excel seulement:
"civilite": etud.civilite_etat_civil_str,
"nom": etud.nom,
"prenom": etud.prenom_etat_civil or etud.prenom or "",
"etudid": etud.id,
"code_nip": etud.code_nip,
"code_ine": etud.code_ine,
} }
if deca.valide_diplome() or not only_diplome: if deca.valide_diplome() or not only_diplome:
rows.append(row) rows.append(row)
rows.sort(key=lambda x: x["_nom_order"]) rows.sort(key=lambda x: x["_nom_pv_order"])
return rows, titles return rows, titles