Actualiser app/scodoc/sco_formsemestre_status.py
Correction paramètres pour export XLS et PDF Ajout visualisation des codes (module et eval)
This commit is contained in:
parent
06f431888d
commit
4804ea9ada
|
@ -586,7 +586,7 @@ def fill_formsemestre(sem: dict): # XXX OBSOLETE
|
||||||
|
|
||||||
# Description du semestre sous forme de table exportable
|
# Description du semestre sous forme de table exportable
|
||||||
def formsemestre_description_table(
|
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
|
"""Description du semestre sous forme de table exportable
|
||||||
Liste des modules et de leurs coefficients
|
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)
|
parcours = codes_cursus.get_cursus_from_code(formsemestre.formation.type_parcours)
|
||||||
# --- Colonnes à proposer:
|
# --- Colonnes à proposer:
|
||||||
columns_ids = ["UE", "Code", "Module"]
|
columns_ids = ["UE", "Code", "Module"]
|
||||||
|
if with_codes:
|
||||||
|
columns_ids += ["moduleimpl_id"]
|
||||||
if with_parcours:
|
if with_parcours:
|
||||||
columns_ids += ["parcours"]
|
columns_ids += ["parcours"]
|
||||||
if not formsemestre.formation.is_apc():
|
if not formsemestre.formation.is_apc():
|
||||||
|
@ -622,6 +624,7 @@ def formsemestre_description_table(
|
||||||
|
|
||||||
titles = {title: title for title in columns_ids}
|
titles = {title: title for title in columns_ids}
|
||||||
titles.update({f"ue_{ue.id}": ue.acronyme for ue in ues})
|
titles.update({f"ue_{ue.id}": ue.acronyme for ue in ues})
|
||||||
|
titles["moduleimpl_id"] = "id"
|
||||||
titles["ects"] = "ECTS"
|
titles["ects"] = "ECTS"
|
||||||
titles["date_evaluation"] = "Évaluation"
|
titles["date_evaluation"] = "Évaluation"
|
||||||
titles["description"] = ""
|
titles["description"] = ""
|
||||||
|
@ -678,6 +681,7 @@ def formsemestre_description_table(
|
||||||
"UE": modimpl.module.ue.acronyme,
|
"UE": modimpl.module.ue.acronyme,
|
||||||
"_UE_td_attrs": ue_info.get("_UE_td_attrs", ""),
|
"_UE_td_attrs": ue_info.get("_UE_td_attrs", ""),
|
||||||
"Code": modimpl.module.code or "",
|
"Code": modimpl.module.code or "",
|
||||||
|
"moduleimpl_id": modimpl.id,
|
||||||
"Module": modimpl.module.abbrev or modimpl.module.titre,
|
"Module": modimpl.module.abbrev or modimpl.module.titre,
|
||||||
"_Module_class": "scotext",
|
"_Module_class": "scotext",
|
||||||
"Inscrits": len(mod_inscrits),
|
"Inscrits": len(mod_inscrits),
|
||||||
|
@ -742,6 +746,7 @@ def formsemestre_description_table(
|
||||||
e["Code"] = row["Code"]
|
e["Code"] = row["Code"]
|
||||||
e["_css_row_class"] = "evaluation"
|
e["_css_row_class"] = "evaluation"
|
||||||
e["Module"] = "éval."
|
e["Module"] = "éval."
|
||||||
|
e["moduleimpl_id"] = e["evaluation_id"]
|
||||||
# Cosmetic: conversions pour affichage
|
# Cosmetic: conversions pour affichage
|
||||||
if e["etat"]["evalcomplete"]:
|
if e["etat"]["evalcomplete"]:
|
||||||
e["evalcomplete_str"] = "Oui"
|
e["evalcomplete_str"] = "Oui"
|
||||||
|
@ -777,7 +782,7 @@ def formsemestre_description_table(
|
||||||
caption=title,
|
caption=title,
|
||||||
html_caption=title,
|
html_caption=title,
|
||||||
html_class="table_leftalign formsemestre_description",
|
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,
|
page_title=title,
|
||||||
html_title=html_sco_header.html_sem_header(
|
html_title=html_sco_header.html_sem_header(
|
||||||
"Description du semestre", with_page_header=False
|
"Description du semestre", with_page_header=False
|
||||||
|
@ -788,14 +793,14 @@ def formsemestre_description_table(
|
||||||
|
|
||||||
|
|
||||||
def formsemestre_description(
|
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
|
"""Description du semestre sous forme de table exportable
|
||||||
Liste des modules et de leurs coefficients
|
Liste des modules et de leurs coefficients
|
||||||
"""
|
"""
|
||||||
with_evals = int(with_evals)
|
with_evals = int(with_evals)
|
||||||
tab = formsemestre_description_table(
|
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"""
|
tab.html_before_table = f"""
|
||||||
<form name="f" method="get" action="{request.base_url}">
|
<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()"
|
<input type="checkbox" name="with_parcours" value="1" onchange="document.f.submit()"
|
||||||
{ "checked" if with_parcours else "" }
|
{ "checked" if with_parcours else "" }
|
||||||
>indiquer les parcours BUT</input>
|
>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)
|
return tab.make_page(format=format)
|
||||||
|
|
Loading…
Reference in New Issue