From b44cd7a575c6f601b3b588a981a47d32704c1a94 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 23 Sep 2022 11:23:48 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9liore=20pr=C3=A9sentation=20formsemestr?= =?UTF-8?q?e=5Fdescription?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_edit_matiere.py | 7 +++- app/scodoc/sco_formsemestre_status.py | 46 +++++++++++++++++++-------- app/static/css/scodoc.css | 14 ++++++++ sco_version.py | 2 +- 4 files changed, 53 insertions(+), 16 deletions(-) diff --git a/app/scodoc/sco_edit_matiere.py b/app/scodoc/sco_edit_matiere.py index dd9ffa9bd..a2298fc27 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 4ebf44750..5e4c6fca7 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( - '%s' - % (modimpl["moduleimpl_id"], mod_descr, mod.abbrev or mod.titre or "") + f"""{mod.abbrev or mod.titre or ""} + + {len(mod_inscrits)} + + { sco_users.user_info(modimpl["responsable_id"])["prenomnom"] } + + + """ ) - H.append('%s' % len(mod_inscrits)) - H.append( - '%s' - % ( - modimpl["moduleimpl_id"], - mod_ens, - sco_users.user_info(modimpl["responsable_id"])["prenomnom"], - ) - ) - H.append("") if mod.module_type in (ModuleType.RESSOURCE, ModuleType.SAE): coefs = mod.ue_coefs_list() H.append(f'') diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index 07a62b351..296f22c94 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -3281,6 +3281,20 @@ table.formsemestre_description tr.table_row_ue td { font-weight: bold; } +table.formsemestre_description tr.evaluation td { + color: rgb(4, 16, 159); + font-size: 85%; +} + +table.formsemestre_description tr.evaluation td.poids a { + font-style: italic; + color: rgb(4, 16, 159); +} + +table.formsemestre_description tbody tr.evaluation td { + background-color: #cee4fa !important; +} + /* --- */ tr#tf_extue_decl>td, tr#tf_extue_note>td { diff --git a/sco_version.py b/sco_version.py index 9687e7aeb..1fb8086b5 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.3.41" +SCOVERSION = "9.3.42" SCONAME = "ScoDoc"