Assiduites : fix #694

This commit is contained in:
iziram 2023-08-31 16:40:51 +02:00
parent a7374d7428
commit 48bca602cc
2 changed files with 17 additions and 16 deletions

View File

@ -888,14 +888,12 @@ def _make_listes_sem(formsemestre: FormSemestre, with_absences=True):
if n_members == 0: if n_members == 0:
continue # skip empty groups continue # skip empty groups
partition_is_empty = False partition_is_empty = False
# XXX TODO-ASSIDUITE group[
group["url_etat"] = "non disponible" # url_for( "url_etat"
# "absences.EtatAbsencesGr", ] = f"""{
# group_ids=group["group_id"], url_for("assiduites.visu_assi_group", scodoc_dept=g.scodoc_dept)
# debut=formsemestre.date_debut.strftime("%d/%m/%Y"), }?group_ids={group["id"]}&date_debut={formsemestre.date_debut.isoformat()}&date_fin={formsemestre.date_fin.isoformat()}"""
# fin=formsemestre.date_fin.strftime("%d/%m/%Y"),
# scodoc_dept=g.scodoc_dept,
# )
if group["group_name"]: if group["group_name"]:
group["label"] = "groupe %(group_name)s" % group group["label"] = "groupe %(group_name)s" % group
else: else:

View File

@ -819,9 +819,12 @@ def tab_absences_html(groups_infos, etat=None):
H = ['<div class="tab-content">'] H = ['<div class="tab-content">']
if not groups_infos.members: if not groups_infos.members:
return "".join(H) + "<h3>Aucun étudiant !</h3></div>" return "".join(H) + "<h3>Aucun étudiant !</h3></div>"
group_ids: str = ",".join(map(str, groups_infos.group_ids))
formsemestre: FormSemestre = groups_infos.get_formsemestre()
H.extend( H.extend(
[ [
"<h3>Absences</h3>", "<h3>Assiduités</h3>",
'<ul class="ul_abs">', '<ul class="ul_abs">',
"<li>", "<li>",
form_choix_saisie_semaine(groups_infos), # Ajout Le Havre form_choix_saisie_semaine(groups_infos), # Ajout Le Havre
@ -829,13 +832,9 @@ def tab_absences_html(groups_infos, etat=None):
"<li>", "<li>",
form_choix_jour_saisie_hebdo(groups_infos), form_choix_jour_saisie_hebdo(groups_infos),
"</li>", "</li>",
# XXX TODO-ASSIDUITE f"""<li><a href="{
"""<li><a class="stdlink" href="Absences/EtatAbsencesGr?%s&debut=%s&fin=%s">XXX État des absences du groupe</a></li>""" url_for("assiduites.visu_assi_group", scodoc_dept=g.scodoc_dept)
% ( }?group_ids={group_ids}&date_debut={formsemestre.date_debut.isoformat()}&date_fin={formsemestre.date_fin.isoformat()}">État des assiduités du groupe</li>""",
groups_infos.groups_query_args,
groups_infos.formsemestre["date_debut"],
groups_infos.formsemestre["date_fin"],
),
"</ul>", "</ul>",
"<h3>Feuilles</h3>", "<h3>Feuilles</h3>",
'<ul class="ul_feuilles">', '<ul class="ul_feuilles">',
@ -893,12 +892,16 @@ def form_choix_jour_saisie_hebdo(groups_infos, moduleimpl_id=None):
sem = groups_infos.formsemestre sem = groups_infos.formsemestre
first_monday = sco_cal.ddmmyyyy(sem["date_debut"]).prev_monday() first_monday = sco_cal.ddmmyyyy(sem["date_debut"]).prev_monday()
today_idx = datetime.date.today().weekday() today_idx = datetime.date.today().weekday()
# TODO-ASSIDUITE
# Utilisation d'un formulaire et de la saisie journalière.
# Dans le formulaire : choisir le jour (lun/mar/...)
FA = [] # formulaire avec menu saisi absences FA = [] # formulaire avec menu saisi absences
FA.append( FA.append(
# TODO-ASSIDUITE et utiliser url_for... (was Absences/SignaleAbsenceGrSemestre) # TODO-ASSIDUITE et utiliser url_for... (was Absences/SignaleAbsenceGrSemestre)
'<form id="form_choix_jour_saisie_hebdo" action="XXX" method="get">' '<form id="form_choix_jour_saisie_hebdo" action="XXX" method="get">'
) )
FA.append('<input type="hidden" name="datefin" value="%(date_fin)s"/>' % sem) FA.append('<input type="hidden" name="datefin" value="%(date_fin)s"/>' % sem)
FA.append(groups_infos.get_form_elem()) FA.append(groups_infos.get_form_elem())
if moduleimpl_id: if moduleimpl_id: