diff --git a/app/scodoc/sco_edit_matiere.py b/app/scodoc/sco_edit_matiere.py index dd9ffa9bd2..a2298fc27b 100644 --- a/app/scodoc/sco_edit_matiere.py +++ b/app/scodoc/sco_edit_matiere.py @@ -295,7 +295,12 @@ associé. ("matiere_id", {"input_type": "hidden"}), ( "ue_id", - {"input_type": "menu", "allowed_values": ue_ids, "labels": ue_names}, + { + "input_type": "menu", + "allowed_values": ue_ids, + "labels": ue_names, + "title": "UE", + }, ), ("titre", {"size": 30, "explanation": "nom de cette matière"}), ( diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 4ebf447501..5e4c6fca7e 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -594,7 +594,7 @@ def fill_formsemestre(sem): # Description du semestre sous forme de table exportable def formsemestre_description_table( - formsemestre_id, with_evals=False, with_parcours=False + formsemestre_id: int, with_evals=False, with_parcours=False ): """Description du semestre sous forme de table exportable Liste des modules et de leurs coefficients @@ -658,6 +658,9 @@ def formsemestre_description_table( "ects": ects_str, "Module": ue.titre, "_css_row_class": "table_row_ue", + "_UE_td_attrs": f'style="background-color: {ue.color} !important;"' + if ue.color + else "", } if use_ue_coefs: ue_info["Coef."] = ue.coefficient @@ -671,6 +674,7 @@ def formsemestre_description_table( l = { "UE": modimpl.module.ue.acronyme, + "_UE_td_attrs": ue_info["_UE_td_attrs"], "Code": modimpl.module.code or "", "Module": modimpl.module.abbrev or modimpl.module.titre, "_Module_class": "scotext", @@ -711,6 +715,11 @@ def formsemestre_description_table( evals.reverse() # ordre chronologique # Ajoute etat: for e in evals: + e["UE"] = l["UE"] + e["_UE_td_attrs"] = l["_UE_td_attrs"] + e["Code"] = l["Code"] + e["_css_row_class"] = "evaluation" + e["Module"] = "éval." # Cosmetic: conversions pour affichage if e["etat"]["evalcomplete"]: e["evalcomplete_str"] = "Oui" @@ -729,6 +738,8 @@ def formsemestre_description_table( evaluation: Evaluation = Evaluation.query.get(e["evaluation_id"]) for ue_id, poids in evaluation.get_ue_poids_dict().items(): e[f"ue_{ue_id}"] = poids or "" + e[f"_ue_{ue_id}_class"] = "poids" + e[f"_ue_{ue_id}_help"] = "poids vers l'UE" R += evals @@ -1150,7 +1161,12 @@ _TABLEAU_MODULES_FOOT = """""" def formsemestre_tableau_modules( - modimpls, nt, formsemestre_id, can_edit=True, show_ues=True, use_ue_coefs=False + modimpls: list[dict], + nt, + formsemestre_id: int, + can_edit=True, + show_ues=True, + use_ue_coefs=False, ) -> str: "Lignes table HTML avec modules du semestre" H = [] @@ -1228,19 +1244,21 @@ def formsemestre_tableau_modules( title="{mod_descr}" class="stdlink">{mod.code}""" ) H.append( - '