diff --git a/app/scodoc/sco_edit_apc.py b/app/scodoc/sco_edit_apc.py index c6b0151d6..cec8b7c2a 100644 --- a/app/scodoc/sco_edit_apc.py +++ b/app/scodoc/sco_edit_apc.py @@ -52,6 +52,7 @@ def html_edit_formation_apc( """ parcours = formation.get_parcours() assert parcours.APC_SAE + ressources = formation.modules.filter_by(module_type=ModuleType.RESSOURCE).order_by( Module.semestre_id, Module.numero, Module.code ) @@ -68,6 +69,19 @@ def html_edit_formation_apc( ).order_by( Module.semestre_id, Module.module_type.desc(), Module.numero, Module.code ) + + ues_by_sem = {} + ects_by_sem = {} + for semestre_idx in semestre_ids: + ues_by_sem[semestre_idx] = formation.ues.filter_by( + semestre_idx=semestre_idx + ).order_by(UniteEns.semestre_idx, UniteEns.numero, UniteEns.acronyme) + ects = [ue.ects for ue in ues_by_sem[semestre_idx]] + if None in ects: + ects_by_sem[semestre_idx] = 'manquant' + else: + ects_by_sem[semestre_idx] = sum(ects) + arrow_up, arrow_down, arrow_none = sco_groups.get_arrow_icons_tags() icons = { @@ -93,7 +107,8 @@ def html_edit_formation_apc( editable=editable, tag_editable=tag_editable, icons=icons, - UniteEns=UniteEns, + ues_by_sem=ues_by_sem, + ects_by_sem=ects_by_sem, ), ] for semestre_idx in semestre_ids: diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index 8cc3269a1..14e4faec4 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -305,7 +305,7 @@ def ue_edit(ue_id=None, create=False, formation_id=None, default_semestre_idx=No ( "numero", { - "size": 2, + "size": 4, "explanation": "numéro (1,2,3,4) de l'UE pour l'ordre d'affichage", "type": "int", }, @@ -722,16 +722,16 @@ du programme" (menu "Semestre") si vous avez un semestre en cours); {formation.referentiel_competence.type_titre} {formation.referentiel_competence.specialite_long} - """ + """ msg_refcomp = "changer" H.append( f"""