2022-06-29 21:16:49 +02:00
|
|
|
##############################################################################
|
|
|
|
# ScoDoc
|
2023-12-31 23:04:06 +01:00
|
|
|
# Copyright (c) 1999 - 2024 Emmanuel Viennet. All rights reserved.
|
2022-06-29 21:16:49 +02:00
|
|
|
# See LICENSE
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
"""Jury BUT: affichage/formulaire
|
|
|
|
"""
|
|
|
|
|
2022-09-30 16:20:51 +02:00
|
|
|
import re
|
2022-12-24 22:06:22 +01:00
|
|
|
import numpy as np
|
2022-09-30 16:20:51 +02:00
|
|
|
|
|
|
|
import flask
|
2023-01-26 16:35:15 +01:00
|
|
|
from flask import flash, render_template, url_for
|
2022-09-30 16:20:51 +02:00
|
|
|
from flask import g, request
|
|
|
|
|
|
|
|
from app import db
|
|
|
|
from app.but import jury_but
|
2022-12-24 22:06:22 +01:00
|
|
|
from app.but.jury_but import (
|
|
|
|
DecisionsProposeesAnnee,
|
|
|
|
DecisionsProposeesRCUE,
|
|
|
|
DecisionsProposeesUE,
|
|
|
|
)
|
2022-09-30 16:20:51 +02:00
|
|
|
from app.comp import res_sem
|
|
|
|
from app.comp.res_but import ResultatsSemestreBUT
|
|
|
|
from app.models import (
|
2022-12-24 22:06:22 +01:00
|
|
|
ApcNiveau,
|
2022-09-30 16:20:51 +02:00
|
|
|
FormSemestre,
|
|
|
|
FormSemestreInscription,
|
|
|
|
Identite,
|
|
|
|
UniteEns,
|
|
|
|
ScolarAutorisationInscription,
|
2023-01-11 13:37:02 +01:00
|
|
|
ScolarFormSemestreValidation,
|
2023-06-23 10:37:32 +02:00
|
|
|
ScolarNews,
|
2022-09-30 16:20:51 +02:00
|
|
|
)
|
2023-01-26 16:35:15 +01:00
|
|
|
from app.models.config import ScoDocSiteConfig
|
2022-09-30 16:20:51 +02:00
|
|
|
from app.scodoc import html_sco_header
|
2023-06-22 07:59:58 +02:00
|
|
|
from app.scodoc import codes_cursus as sco_codes
|
2022-06-29 21:16:49 +02:00
|
|
|
from app.scodoc.sco_exceptions import ScoValueError
|
2023-01-26 16:35:15 +01:00
|
|
|
from app.scodoc import sco_preferences
|
2022-09-30 16:20:51 +02:00
|
|
|
from app.scodoc import sco_utils as scu
|
2022-06-29 21:16:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
def show_etud(deca: DecisionsProposeesAnnee, read_only: bool = True) -> str:
|
|
|
|
"""Affichage des décisions annuelles BUT
|
|
|
|
Si pas read_only, menus sélection codes jury.
|
|
|
|
"""
|
|
|
|
H = []
|
|
|
|
|
2023-01-26 14:49:04 +01:00
|
|
|
if deca.jury_annuel:
|
|
|
|
H.append(
|
|
|
|
f"""
|
|
|
|
<div class="but_section_annee">
|
|
|
|
<div>
|
|
|
|
<b>Décision de jury pour l'année :</b> {
|
|
|
|
_gen_but_select("code_annee", deca.codes, deca.code_valide,
|
|
|
|
disabled=True, klass="manual")
|
|
|
|
}
|
|
|
|
<span>({deca.code_valide or 'non'} enregistrée)</span>
|
|
|
|
</div>
|
2023-01-08 19:36:05 +01:00
|
|
|
</div>
|
2022-09-30 16:20:51 +02:00
|
|
|
"""
|
2023-01-26 14:49:04 +01:00
|
|
|
)
|
2022-06-29 21:16:49 +02:00
|
|
|
|
2022-12-20 19:20:00 +01:00
|
|
|
formsemestre_1 = deca.formsemestre_impair
|
|
|
|
formsemestre_2 = deca.formsemestre_pair
|
|
|
|
# Ordonne selon les dates des 2 semestres considérés (pour les redoublants à cheval):
|
2022-12-20 23:00:01 +01:00
|
|
|
reverse_semestre = (
|
|
|
|
deca.formsemestre_pair
|
|
|
|
and deca.formsemestre_impair
|
|
|
|
and deca.formsemestre_pair.date_debut < deca.formsemestre_impair.date_debut
|
|
|
|
)
|
|
|
|
if reverse_semestre:
|
2022-12-20 19:20:00 +01:00
|
|
|
formsemestre_1, formsemestre_2 = formsemestre_2, formsemestre_1
|
2022-06-29 21:16:49 +02:00
|
|
|
H.append(
|
|
|
|
f"""
|
2022-12-25 01:35:18 +01:00
|
|
|
<div class="titre_niveaux">
|
|
|
|
<b>Niveaux de compétences et unités d'enseignement du BUT{deca.annee_but}</b>
|
2023-12-31 23:04:06 +01:00
|
|
|
<a style="margin-left: 32px;" class="stdlink" target="_blank" rel="noopener noreferrer"
|
2023-08-26 11:03:55 +02:00
|
|
|
href={
|
2023-12-31 23:04:06 +01:00
|
|
|
url_for("notes.validation_rcues", scodoc_dept=g.scodoc_dept,
|
2023-08-26 11:03:55 +02:00
|
|
|
etudid=deca.etud.id,
|
|
|
|
formsemestre_id=formsemestre_2.id if formsemestre_2 else formsemestre_1.id
|
|
|
|
)
|
|
|
|
}>visualiser son cursus</a>
|
2022-12-25 01:35:18 +01:00
|
|
|
</div>
|
2023-01-26 14:49:04 +01:00
|
|
|
<div class="but_explanation">{deca.explanation}</div>
|
2022-06-29 21:16:49 +02:00
|
|
|
<div class="but_annee">
|
|
|
|
<div class="titre"></div>
|
2022-12-24 22:06:22 +01:00
|
|
|
<div class="titre">{"S" +str(formsemestre_1.semestre_id)
|
2022-12-20 19:20:00 +01:00
|
|
|
if formsemestre_1 else "-"}
|
2022-12-24 22:06:22 +01:00
|
|
|
<span class="avertissement_redoublement">{formsemestre_1.annee_scolaire_str()
|
|
|
|
if formsemestre_1 else ""}</span>
|
2022-12-20 19:20:00 +01:00
|
|
|
</div>
|
2022-12-24 22:06:22 +01:00
|
|
|
<div class="titre">{"S"+str(formsemestre_2.semestre_id)
|
2022-12-20 19:20:00 +01:00
|
|
|
if formsemestre_2 else "-"}
|
2022-12-24 22:06:22 +01:00
|
|
|
<span class="avertissement_redoublement">{formsemestre_2.annee_scolaire_str()
|
|
|
|
if formsemestre_2 else ""}</span>
|
2022-12-20 19:20:00 +01:00
|
|
|
</div>
|
2024-02-04 00:22:49 +01:00
|
|
|
<div class="titre" title="Décisions sur RCUEs enregistrées sur l'ensemble du cursus">RCUE</div>
|
2022-06-29 21:16:49 +02:00
|
|
|
"""
|
|
|
|
)
|
2023-06-28 21:25:38 +02:00
|
|
|
for dec_rcue in deca.get_decisions_rcues_annee():
|
|
|
|
rcue = dec_rcue.rcue
|
|
|
|
niveau = rcue.niveau
|
2022-06-29 21:16:49 +02:00
|
|
|
H.append(
|
|
|
|
f"""<div class="but_niveau_titre">
|
|
|
|
<div title="{niveau.competence.titre_long}">{niveau.competence.titre}</div>
|
|
|
|
</div>"""
|
|
|
|
)
|
2023-06-28 21:25:38 +02:00
|
|
|
ue_impair, ue_pair = rcue.ue_1, rcue.ue_2
|
2024-03-24 07:39:47 +01:00
|
|
|
# Les UEs à afficher : on regarde si read only et si dispense (non ré-inscription à l'UE)
|
|
|
|
ues_ro_dispense = [
|
2022-12-20 19:20:00 +01:00
|
|
|
(
|
|
|
|
ue_impair,
|
2023-06-28 21:25:38 +02:00
|
|
|
rcue.ue_cur_impair is None,
|
2024-03-24 07:39:47 +01:00
|
|
|
deca.res_impair
|
|
|
|
and (deca.etud.id, ue_impair.id) in deca.res_impair.dispense_ues,
|
2022-12-20 19:20:00 +01:00
|
|
|
),
|
|
|
|
(
|
|
|
|
ue_pair,
|
2023-06-28 21:25:38 +02:00
|
|
|
rcue.ue_cur_pair is None,
|
2024-03-24 07:39:47 +01:00
|
|
|
deca.res_pair
|
|
|
|
and (deca.etud.id, ue_pair.id) in deca.res_pair.dispense_ues,
|
2022-12-20 19:20:00 +01:00
|
|
|
),
|
|
|
|
]
|
|
|
|
# Ordonne selon les dates des 2 semestres considérés:
|
2022-12-20 23:00:01 +01:00
|
|
|
if reverse_semestre:
|
2024-03-24 07:39:47 +01:00
|
|
|
ues_ro_dispense[0], ues_ro_dispense[1] = (
|
|
|
|
ues_ro_dispense[1],
|
|
|
|
ues_ro_dispense[0],
|
|
|
|
)
|
2022-12-20 19:20:00 +01:00
|
|
|
# Colonnes d'UE:
|
2024-03-24 07:39:47 +01:00
|
|
|
for ue, ue_read_only, ue_dispense in ues_ro_dispense:
|
2022-12-20 23:00:01 +01:00
|
|
|
if ue:
|
|
|
|
H.append(
|
|
|
|
_gen_but_niveau_ue(
|
|
|
|
ue,
|
|
|
|
deca.decisions_ues[ue.id],
|
|
|
|
disabled=read_only or ue_read_only,
|
|
|
|
annee_prec=ue_read_only,
|
2023-01-11 13:37:02 +01:00
|
|
|
niveau_id=ue.niveau_competence.id,
|
2024-03-24 07:39:47 +01:00
|
|
|
ue_dispense=ue_dispense,
|
2022-12-20 23:00:01 +01:00
|
|
|
)
|
2022-12-20 19:20:00 +01:00
|
|
|
)
|
2022-12-20 23:00:01 +01:00
|
|
|
else:
|
|
|
|
H.append("""<div class="niveau_vide"></div>""")
|
2022-12-20 19:20:00 +01:00
|
|
|
|
2022-12-24 22:06:22 +01:00
|
|
|
# Colonne RCUE
|
|
|
|
H.append(_gen_but_rcue(dec_rcue, niveau))
|
|
|
|
|
2022-06-29 21:16:49 +02:00
|
|
|
H.append("</div>") # but_annee
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def _gen_but_select(
|
|
|
|
name: str,
|
|
|
|
codes: list[str],
|
|
|
|
code_valide: str,
|
|
|
|
disabled: bool = False,
|
|
|
|
klass: str = "",
|
2023-06-28 21:25:38 +02:00
|
|
|
data: dict = None,
|
2023-06-22 19:00:56 +02:00
|
|
|
code_valide_label: str = "",
|
2022-06-29 21:16:49 +02:00
|
|
|
) -> str:
|
|
|
|
"Le menu html select avec les codes"
|
2022-12-20 19:20:00 +01:00
|
|
|
# if disabled: # mauvaise idée car le disabled est traité en JS
|
|
|
|
# return f"""<div class="but_code {klass}">{code_valide}</div>"""
|
2023-06-28 21:25:38 +02:00
|
|
|
data = data or {}
|
2022-12-24 22:06:22 +01:00
|
|
|
options_htm = "\n".join(
|
2022-06-29 21:16:49 +02:00
|
|
|
[
|
2022-12-24 22:06:22 +01:00
|
|
|
f"""<option value="{code}"
|
2022-06-29 21:16:49 +02:00
|
|
|
{'selected' if code == code_valide else ''}
|
|
|
|
class="{'recorded' if code == code_valide else ''}"
|
2023-06-22 19:00:56 +02:00
|
|
|
>{code
|
|
|
|
if ((code != code_valide) or not code_valide_label)
|
|
|
|
else code_valide_label
|
|
|
|
}</option>"""
|
2022-06-29 21:16:49 +02:00
|
|
|
for code in codes
|
|
|
|
]
|
|
|
|
)
|
2022-11-24 00:11:59 +01:00
|
|
|
return f"""<select required name="{name}"
|
2023-12-31 23:04:06 +01:00
|
|
|
class="but_code {klass}"
|
2023-01-11 13:37:02 +01:00
|
|
|
data-orig_code="{code_valide or (codes[0] if codes else '')}"
|
|
|
|
data-orig_recorded="{code_valide or ''}"
|
2022-06-29 21:16:49 +02:00
|
|
|
onchange="change_menu_code(this);"
|
|
|
|
{"disabled" if disabled else ""}
|
2023-01-11 13:37:02 +01:00
|
|
|
{" ".join( f'data-{k}="{v}"' for (k,v) in data.items() )}
|
2022-12-24 22:06:22 +01:00
|
|
|
>{options_htm}</select>
|
2022-06-29 21:16:49 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
2022-12-20 19:20:00 +01:00
|
|
|
def _gen_but_niveau_ue(
|
|
|
|
ue: UniteEns,
|
|
|
|
dec_ue: DecisionsProposeesUE,
|
|
|
|
disabled: bool = False,
|
|
|
|
annee_prec: bool = False,
|
2023-01-11 13:37:02 +01:00
|
|
|
niveau_id: int = None,
|
2024-03-24 07:39:47 +01:00
|
|
|
ue_dispense: bool = False,
|
2022-12-24 22:06:22 +01:00
|
|
|
) -> str:
|
2022-11-24 00:11:59 +01:00
|
|
|
if dec_ue.ue_status and dec_ue.ue_status["is_capitalized"]:
|
|
|
|
moy_ue_str = f"""<span class="ue_cap">{
|
|
|
|
scu.fmt_note(dec_ue.moy_ue_with_cap)}</span>"""
|
2024-03-24 07:39:47 +01:00
|
|
|
|
|
|
|
if ue_dispense:
|
|
|
|
etat_en_cours = """Non (ré)inscrit à cette UE"""
|
|
|
|
else:
|
|
|
|
etat_en_cours = f"""UE en cours
|
|
|
|
{ "sans notes" if np.isnan(dec_ue.moy_ue)
|
|
|
|
else
|
|
|
|
("avec moyenne <b>" + scu.fmt_note(dec_ue.moy_ue) + "</b>")
|
|
|
|
}
|
|
|
|
"""
|
|
|
|
|
2022-11-24 00:11:59 +01:00
|
|
|
scoplement = f"""<div class="scoplement">
|
|
|
|
<div>
|
2022-12-24 22:06:22 +01:00
|
|
|
<b>UE {ue.acronyme} capitalisée </b>
|
|
|
|
<span>le {dec_ue.ue_status["event_date"].strftime("%d/%m/%Y")}
|
|
|
|
</span>
|
2022-11-24 00:11:59 +01:00
|
|
|
</div>
|
2024-03-24 07:39:47 +01:00
|
|
|
<div>
|
|
|
|
{ etat_en_cours }
|
2022-11-24 00:11:59 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
"""
|
2023-06-29 21:17:03 +02:00
|
|
|
elif dec_ue.formsemestre is None:
|
|
|
|
# Validation d'UE antérieure (semestre hors année scolaire courante)
|
|
|
|
if dec_ue.validation:
|
|
|
|
moy_ue_str = f"""<span>{scu.fmt_note(dec_ue.validation.moy_ue)}</span>"""
|
|
|
|
scoplement = f"""<div class="scoplement">
|
|
|
|
<div>
|
|
|
|
<b>UE {ue.acronyme} antérieure </b>
|
|
|
|
<span>validée {dec_ue.validation.code}
|
|
|
|
le {dec_ue.validation.event_date.strftime("%d/%m/%Y")}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div>Non reprise dans l'année en cours</div>
|
|
|
|
</div>
|
|
|
|
"""
|
|
|
|
else:
|
|
|
|
moy_ue_str = """<span>-</span>"""
|
|
|
|
scoplement = """<div class="scoplement">
|
|
|
|
<div>
|
|
|
|
<b>Pas d'UE en cours ou validée dans cette compétence de ce côté.</b>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
"""
|
2022-11-24 00:11:59 +01:00
|
|
|
else:
|
|
|
|
moy_ue_str = f"""<span>{scu.fmt_note(dec_ue.moy_ue)}</span>"""
|
2023-01-11 13:37:02 +01:00
|
|
|
if dec_ue.code_valide:
|
2023-06-29 21:17:03 +02:00
|
|
|
date_str = (
|
|
|
|
f"""enregistré le {dec_ue.validation.event_date.strftime("%d/%m/%Y")}
|
2023-01-11 13:37:02 +01:00
|
|
|
à {dec_ue.validation.event_date.strftime("%Hh%M")}
|
2023-06-29 21:17:03 +02:00
|
|
|
"""
|
|
|
|
if dec_ue.validation and dec_ue.validation.event_date
|
|
|
|
else ""
|
|
|
|
)
|
|
|
|
scoplement = f"""<div class="scoplement">
|
|
|
|
<div>Code {dec_ue.code_valide} {date_str}
|
2023-01-11 13:37:02 +01:00
|
|
|
</div>
|
2023-01-17 23:14:58 +01:00
|
|
|
</div>
|
2023-01-11 13:37:02 +01:00
|
|
|
"""
|
|
|
|
else:
|
2024-03-24 07:39:47 +01:00
|
|
|
if dec_ue.ue_status and dec_ue.ue_status["was_capitalized"]:
|
|
|
|
scoplement = """<div class="scoplement">
|
|
|
|
UE déjà capitalisée avec résultat moins favorable.
|
|
|
|
</div>
|
|
|
|
"""
|
|
|
|
else:
|
|
|
|
scoplement = ""
|
2022-11-24 00:11:59 +01:00
|
|
|
|
2023-06-28 21:25:38 +02:00
|
|
|
ue_class = "" # 'recorded' if dec_ue.code_valide is not None else ''
|
|
|
|
if dec_ue.code_valide is not None and dec_ue.codes:
|
|
|
|
if dec_ue.code_valide == dec_ue.codes[0]:
|
|
|
|
ue_class = "recorded"
|
|
|
|
else:
|
|
|
|
ue_class = "recorded_different"
|
|
|
|
|
|
|
|
return f"""<div class="but_niveau_ue {ue_class}
|
2022-12-20 19:20:00 +01:00
|
|
|
{'annee_prec' if annee_prec else ''}
|
2022-06-29 21:16:49 +02:00
|
|
|
">
|
2024-02-13 13:55:16 +01:00
|
|
|
<div title="{ue.titre or ''}">{ue.acronyme}</div>
|
2022-11-24 00:11:59 +01:00
|
|
|
<div class="but_note with_scoplement">
|
|
|
|
<div>{moy_ue_str}</div>
|
|
|
|
{scoplement}
|
|
|
|
</div>
|
2022-06-29 21:16:49 +02:00
|
|
|
<div class="but_code">{
|
2023-12-31 23:04:06 +01:00
|
|
|
_gen_but_select("code_ue_"+str(ue.id),
|
2023-01-11 13:37:02 +01:00
|
|
|
dec_ue.codes,
|
|
|
|
dec_ue.code_valide,
|
|
|
|
disabled=disabled,
|
|
|
|
klass=f"code_ue ue_rcue_{niveau_id}" if not disabled else ""
|
2022-06-29 21:16:49 +02:00
|
|
|
)
|
|
|
|
}</div>
|
2023-12-31 23:04:06 +01:00
|
|
|
|
2022-06-29 21:16:49 +02:00
|
|
|
</div>"""
|
|
|
|
|
|
|
|
|
2022-12-24 22:06:22 +01:00
|
|
|
def _gen_but_rcue(dec_rcue: DecisionsProposeesRCUE, niveau: ApcNiveau) -> str:
|
2023-06-28 21:25:38 +02:00
|
|
|
if dec_rcue is None or not dec_rcue.rcue.complete:
|
2022-12-24 22:06:22 +01:00
|
|
|
return """
|
|
|
|
<div class="but_niveau_rcue niveau_vide with_scoplement">
|
|
|
|
<div></div>
|
|
|
|
<div class="scoplement">Pas de RCUE (UE non capitalisée ?)</div>
|
|
|
|
</div>
|
|
|
|
"""
|
|
|
|
|
2023-06-22 07:59:58 +02:00
|
|
|
code_propose_menu = dec_rcue.code_valide # le code enregistré
|
2023-06-22 19:00:56 +02:00
|
|
|
code_valide_label = code_propose_menu
|
2023-06-22 07:59:58 +02:00
|
|
|
if dec_rcue.validation:
|
|
|
|
if dec_rcue.code_valide == dec_rcue.codes[0]:
|
|
|
|
descr_validation = dec_rcue.validation.html()
|
|
|
|
else: # on une validation enregistrée différence de celle proposée
|
|
|
|
descr_validation = f"""Décision recommandée: <b>{dec_rcue.codes[0]}.</b>
|
|
|
|
Il y avait {dec_rcue.validation.html()}"""
|
|
|
|
if (
|
2023-06-22 08:22:37 +02:00
|
|
|
sco_codes.BUT_CODES_ORDER[dec_rcue.codes[0]]
|
|
|
|
> sco_codes.BUT_CODES_ORDER[dec_rcue.code_valide]
|
2023-06-22 07:59:58 +02:00
|
|
|
):
|
|
|
|
code_propose_menu = dec_rcue.codes[0]
|
2023-06-22 19:00:56 +02:00
|
|
|
code_valide_label = (
|
|
|
|
f"{dec_rcue.codes[0]} (actuel {dec_rcue.code_valide})"
|
|
|
|
)
|
2023-06-22 07:59:58 +02:00
|
|
|
scoplement = f"""<div class="scoplement">{descr_validation}</div>"""
|
|
|
|
else:
|
|
|
|
scoplement = "" # "pas de validation"
|
2022-12-24 22:06:22 +01:00
|
|
|
|
2023-01-08 19:36:05 +01:00
|
|
|
# Déjà enregistré ?
|
|
|
|
niveau_rcue_class = ""
|
|
|
|
if dec_rcue.code_valide is not None and dec_rcue.codes:
|
|
|
|
if dec_rcue.code_valide == dec_rcue.codes[0]:
|
|
|
|
niveau_rcue_class = "recorded"
|
|
|
|
else:
|
|
|
|
niveau_rcue_class = "recorded_different"
|
|
|
|
|
2022-12-24 22:06:22 +01:00
|
|
|
return f"""
|
2023-01-08 19:36:05 +01:00
|
|
|
<div class="but_niveau_rcue {niveau_rcue_class}
|
2022-12-24 22:06:22 +01:00
|
|
|
">
|
|
|
|
<div class="but_note with_scoplement">
|
|
|
|
<div>{scu.fmt_note(dec_rcue.rcue.moy_rcue)}</div>
|
|
|
|
{scoplement}
|
|
|
|
</div>
|
|
|
|
<div class="but_code">
|
2023-01-11 13:37:02 +01:00
|
|
|
{_gen_but_select("code_rcue_"+str(niveau.id),
|
2022-12-24 22:06:22 +01:00
|
|
|
dec_rcue.codes,
|
2023-06-22 07:59:58 +02:00
|
|
|
code_propose_menu,
|
2023-01-11 13:37:02 +01:00
|
|
|
disabled=True,
|
|
|
|
klass="manual code_rcue",
|
2023-06-22 19:00:56 +02:00
|
|
|
data = { "niveau_id" : str(niveau.id)},
|
|
|
|
code_valide_label = code_valide_label,
|
2022-12-24 22:06:22 +01:00
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2022-09-30 16:20:51 +02:00
|
|
|
# -------------
|
2022-06-29 21:16:49 +02:00
|
|
|
def infos_fiche_etud_html(etudid: int) -> str:
|
|
|
|
"""Section html pour fiche etudiant
|
|
|
|
provisoire pour BUT 2022
|
|
|
|
"""
|
2023-03-20 11:17:38 +01:00
|
|
|
etud = Identite.get_etud(etudid)
|
2022-06-29 21:16:49 +02:00
|
|
|
inscriptions = (
|
|
|
|
FormSemestreInscription.query.join(FormSemestreInscription.formsemestre)
|
|
|
|
.filter(
|
|
|
|
FormSemestreInscription.etudid == etud.id,
|
|
|
|
)
|
|
|
|
.order_by(FormSemestre.date_debut)
|
|
|
|
)
|
|
|
|
formsemestres_but = [
|
|
|
|
i.formsemestre for i in inscriptions if i.formsemestre.formation.is_apc()
|
|
|
|
]
|
|
|
|
if len(formsemestres_but) == 0:
|
|
|
|
return ""
|
|
|
|
|
|
|
|
# temporaire quick & dirty: affiche le dernier
|
|
|
|
try:
|
|
|
|
deca = DecisionsProposeesAnnee(etud, formsemestres_but[-1])
|
2022-12-24 22:06:22 +01:00
|
|
|
return f"""<div class="infos_but">
|
2022-06-30 08:59:19 +02:00
|
|
|
{show_etud(deca, read_only=True)}
|
|
|
|
</div>
|
2022-12-24 22:06:22 +01:00
|
|
|
"""
|
2022-06-29 21:16:49 +02:00
|
|
|
except ScoValueError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
return ""
|