From 5834ea5cb7d0ee8392aa431ca2d2a129a0066861 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Feb 2022 23:14:33 +0100 Subject: [PATCH] UE colors --- app/scodoc/sco_edit_ue.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index 4fb2eb58e..af045bf03 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -575,7 +575,9 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""): # was ue_list semestre_ids = range(1, parcours.NB_SEM + 1) # transition: on requete ici via l'ORM mais on utilise les fonctions ScoDoc7 # basées sur des dicts - ues_obj = UniteEns.query.filter_by(formation_id=formation_id, is_external=False) + ues_obj = UniteEns.query.filter_by( + formation_id=formation_id, is_external=False + ).order_by(UniteEns.semestre_idx, UniteEns.numero) ues_externes_obj = UniteEns.query.filter_by( formation_id=formation_id, is_external=True ) @@ -1415,15 +1417,15 @@ def ue_list_semestre_ids(ue: dict): UE_PALETTE = [ - "#EFA00B", - "#99C24D", - "#EC9192", - "#0075C4", - "#D65108", - "#DEC0F1", - "#B02E0C", - "#151E3F", - "#FB3640", + "#B80004", # rouge + "#F97B3D", # Orange Crayola + "#FEB40B", # Honey Yellow + "#80CB3F", # Yellow Green + "#05162E", # Oxford Blue + "#548687", # Steel Teal + "#444054", # Independence + "#889696", # Spanish Gray + "#0CA4A5", # Viridian Green ] @@ -1436,8 +1438,8 @@ def colorie_anciennes_ues(ues: list[UniteEns]) -> None: last_sem_idx = 0 for ue in ues: if ue.semestre_idx != last_sem_idx: - last_sem_idx = ue.semestre_idx index = 0 + last_sem_idx = ue.semestre_idx if ue.color is None: ue.color = UE_PALETTE[index % nb_colors] index += 1