Amélioration table billets absences

This commit is contained in:
Emmanuel Viennet 2022-09-22 14:58:46 +02:00
parent 251079675a
commit 8e336b8818
2 changed files with 12 additions and 5 deletions

View File

@ -112,11 +112,14 @@ def table_billets(
billet_dict["etat_str"] = "ok"
if not etud:
# ajoute info etudiant
etud = billet.etudiant
if not etud:
if not billet.etudiant:
billet_dict["nomprenom"] = "???" # should not occur
else:
billet_dict["nomprenom"] = etud.nomprenom
billet_dict["nomprenom"] = billet.etudiant.nomprenom
billet_dict["_nomprenom_disp_order"] = billet.etudiant.sort_key
billet_dict[
"_nomprenom_td_attrs"
] = f'id="{billet.etudiant.id}" class="etudinfo"'
if with_links:
billet_dict["_nomprenom_target"] = url_for(
"scolar.ficheEtud",
@ -131,7 +134,6 @@ def table_billets(
if not etud:
columns_ids += ["nomprenom"]
columns_ids += ["abs_begin_str", "abs_end_str", "description", "etat_str"]
tab = GenTable(
titles={
"billet_id": "Numéro",
@ -146,5 +148,6 @@ def table_billets(
preferences=sco_preferences.SemPreferences(),
rows=rows,
html_sortable=True,
html_class="table_leftalign",
)
return tab

View File

@ -1246,7 +1246,11 @@ def list_billets():
table = sco_abs_billets.table_billets_etud(etat=False)
T = table.html()
H = [
html_sco_header.sco_header(page_title="Billet d'absence non traités"),
html_sco_header.sco_header(
page_title="Billet d'absence non traités",
javascripts=["js/etud_info.js"],
init_qtip=True,
),
f"<h2>Billets d'absence en attente de traitement ({table.get_nb_rows()})</h2>",
]