Ajout code dans description semestre + correction affichage export apogee #722
|
@ -586,7 +586,7 @@ def fill_formsemestre(sem: dict): # XXX OBSOLETE
|
|||
|
||||
# Description du semestre sous forme de table exportable
|
||||
def formsemestre_description_table(
|
||||
formsemestre_id: int, with_evals=False, with_parcours=False
|
||||
formsemestre_id: int, with_evals=False, with_parcours=False, with_codes=False
|
||||
):
|
||||
"""Description du semestre sous forme de table exportable
|
||||
Liste des modules et de leurs coefficients
|
||||
|
@ -600,6 +600,8 @@ def formsemestre_description_table(
|
|||
parcours = codes_cursus.get_cursus_from_code(formsemestre.formation.type_parcours)
|
||||
# --- Colonnes à proposer:
|
||||
columns_ids = ["UE", "Code", "Module"]
|
||||
if with_codes:
|
||||
columns_ids += ["moduleimpl_id"]
|
||||
if with_parcours:
|
||||
columns_ids += ["parcours"]
|
||||
if not formsemestre.formation.is_apc():
|
||||
|
@ -622,6 +624,7 @@ def formsemestre_description_table(
|
|||
|
||||
titles = {title: title for title in columns_ids}
|
||||
titles.update({f"ue_{ue.id}": ue.acronyme for ue in ues})
|
||||
titles["moduleimpl_id"] = "id"
|
||||
titles["ects"] = "ECTS"
|
||||
titles["date_evaluation"] = "Évaluation"
|
||||
titles["description"] = ""
|
||||
|
@ -678,6 +681,7 @@ def formsemestre_description_table(
|
|||
"UE": modimpl.module.ue.acronyme,
|
||||
"_UE_td_attrs": ue_info.get("_UE_td_attrs", ""),
|
||||
"Code": modimpl.module.code or "",
|
||||
"moduleimpl_id": modimpl.id,
|
||||
"Module": modimpl.module.abbrev or modimpl.module.titre,
|
||||
"_Module_class": "scotext",
|
||||
"Inscrits": len(mod_inscrits),
|
||||
|
@ -742,6 +746,7 @@ def formsemestre_description_table(
|
|||
e["Code"] = row["Code"]
|
||||
e["_css_row_class"] = "evaluation"
|
||||
e["Module"] = "éval."
|
||||
e["moduleimpl_id"] = e["evaluation_id"]
|
||||
# Cosmetic: conversions pour affichage
|
||||
if e["etat"]["evalcomplete"]:
|
||||
e["evalcomplete_str"] = "Oui"
|
||||
|
@ -777,7 +782,7 @@ def formsemestre_description_table(
|
|||
caption=title,
|
||||
html_caption=title,
|
||||
html_class="table_leftalign formsemestre_description",
|
||||
base_url=f"{request.base_url}?formsemestre_id={formsemestre_id}&with_evals={with_evals}",
|
||||
base_url=f"{request.base_url}?formsemestre_id={formsemestre_id}&with_evals={with_evals}&with_parcours={with_parcours}&with_codes={with_codes}",
|
||||
page_title=title,
|
||||
html_title=html_sco_header.html_sem_header(
|
||||
"Description du semestre", with_page_header=False
|
||||
|
@ -788,14 +793,14 @@ def formsemestre_description_table(
|
|||
|
||||
|
||||
def formsemestre_description(
|
||||
formsemestre_id, format="html", with_evals=False, with_parcours=False
|
||||
formsemestre_id, format="html", with_evals=False, with_parcours=False, with_codes=False
|
||||
):
|
||||
"""Description du semestre sous forme de table exportable
|
||||
Liste des modules et de leurs coefficients
|
||||
"""
|
||||
with_evals = int(with_evals)
|
||||
tab = formsemestre_description_table(
|
||||
formsemestre_id, with_evals=with_evals, with_parcours=with_parcours
|
||||
formsemestre_id, with_evals=with_evals, with_parcours=with_parcours, with_codes=with_codes
|
||||
)
|
||||
tab.html_before_table = f"""
|
||||
<form name="f" method="get" action="{request.base_url}">
|
||||
|
@ -806,6 +811,9 @@ def formsemestre_description(
|
|||
<input type="checkbox" name="with_parcours" value="1" onchange="document.f.submit()"
|
||||
{ "checked" if with_parcours else "" }
|
||||
>indiquer les parcours BUT</input>
|
||||
<input type="checkbox" name="with_codes" value="1" onchange="document.f.submit()"
|
||||
{ "checked" if with_codes else "" }
|
||||
>indiquer les codes</input>
|
||||
"""
|
||||
|
||||
return tab.make_page(format=format)
|
||||
|
|
|
@ -306,9 +306,9 @@ class SemSet(dict):
|
|||
H.append("</p>")
|
||||
|
||||
if self["sem_id"] == 1:
|
||||
periode = "1re période (S1, S3)"
|
||||
periode = "1re période (S1, S3, S5)"
|
||||
elif self["sem_id"] == 2:
|
||||
periode = "2de période (S2, S4)"
|
||||
periode = "2de période (S2, S4, S6)"
|
||||
else:
|
||||
periode = "non semestrialisée (LP, ...). Incompatible avec BUT."
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user