diff --git a/app/tables/list_etuds.py b/app/tables/list_etuds.py index b520e50d2c..3a90236cf9 100644 --- a/app/tables/list_etuds.py +++ b/app/tables/list_etuds.py @@ -6,8 +6,10 @@ """Liste simple d'étudiants """ +import datetime from app.models import FormSemestre, FormSemestreInscription, Identite +from app.scodoc.sco_exceptions import ScoValueError from app.tables import table_builder as tb @@ -79,7 +81,6 @@ class RowEtud(tb.Row): # formsemestre_id=res.formsemestre.id, # etudid=etud.id, # ) - url_bulletin = None # pour extension future self.add_cell("civilite_str", "Civ.", etud.civilite_str, "identite_detail") self.add_cell( "nom_disp", @@ -91,19 +92,6 @@ class RowEtud(tb.Row): target_attrs={"class": "etudinfo discretelink", "id": str(etud.id)}, ) self.add_cell("prenom", "Prénom", etud.prenom, "identite_detail") - # self.add_cell( - # "nom_short", - # "Nom", - # etud.nom_short, - # "identite_court", - # data={ - # "order": etud.sort_key, - # "etudid": etud.id, - # "nomprenom": etud.nomprenom, - # }, - # target=url_bulletin, - # target_attrs={"class": "etudinfo", "id": str(etud.id)}, - # ) def etuds_sorted_from_ids(etudids) -> list[Identite]: @@ -149,6 +137,7 @@ class RowEtudWithInfos(RowEtud): """, "identite_detail", ) + self.add_cell("code_nip", "NIP", self.etud.code_nip or "", "identite_detail") super().add_etud_cols() self.add_cell( "etat", @@ -180,6 +169,8 @@ class TableEtudWithInfos(TableEtud): def table_etudiants_courants(formsemestres: list[FormSemestre]) -> TableEtud: """Table des étudiants des formsemestres indiqués""" + if not formsemestres: + raise ScoValueError("Aucun semestre en cours") table = TableEtudWithInfos(row_class=RowEtudWithInfos) for formsemestre in formsemestres: table.add_formsemestre(formsemestre) diff --git a/app/templates/scolar/export_etudiants_courants.j2 b/app/templates/scolar/export_etudiants_courants.j2 new file mode 100644 index 0000000000..eab573e6d5 --- /dev/null +++ b/app/templates/scolar/export_etudiants_courants.j2 @@ -0,0 +1,20 @@ +{% extends "sco_page.j2" %} + +{% block styles %} +{{super()}} +{% endblock %} + +{% block app_content %} + +