From 8e336b88183d7e10dffebe19b11fffdbd4b6c6aa Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 22 Sep 2022 14:58:46 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20table=20billets=20absences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_abs_billets.py | 11 +++++++---- app/views/absences.py | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/scodoc/sco_abs_billets.py b/app/scodoc/sco_abs_billets.py index 564c12688..eaafab89a 100644 --- a/app/scodoc/sco_abs_billets.py +++ b/app/scodoc/sco_abs_billets.py @@ -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 diff --git a/app/views/absences.py b/app/views/absences.py index 478c93de4..3deb173f9 100644 --- a/app/views/absences.py +++ b/app/views/absences.py @@ -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"

Billets d'absence en attente de traitement ({table.get_nb_rows()})

", ]