Assiduites : fix Saisie Absences hebdo (moduleimpl)

This commit is contained in:
iziram 2023-08-31 17:37:09 +02:00
parent 738f795f21
commit 1cfcb831ca
2 changed files with 14 additions and 11 deletions

View File

@ -29,6 +29,7 @@
"""
import math
import time
import datetime
from flask import g, url_for
from flask_login import current_user
@ -328,20 +329,19 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
current_user.has_permission(Permission.ScoAbsChange)
and formsemestre.est_courant()
):
datelundi = sco_cal.ddmmyyyy(time.strftime("%d/%m/%Y")).prev_monday()
group_id = sco_groups.get_default_group(formsemestre_id)
H.append(
f"""
<span class="moduleimpl_abs_link"><a class="stdlink" href="XXX"
>Saisie Absences hebdo. (INDISPONIBLE)</a></span>
<span class="moduleimpl_abs_link"><a class="stdlink" href="{
url_for("assiduites.signal_assiduites_group", scodoc_dept=g.scodoc_dept)
}?group_ids={group_id}&jour={
datetime.date.today().isoformat()
}&formsemestre_id={formsemestre.id}
&moduleimpl_id={moduleimpl_id}
"
>Saisie Absences hebdo</a></span>
"""
)
# TODO-ASSIDUITE
# href="{
# url_for("absences.SignaleAbsenceGrHebdo",
# scodoc_dept=g.scodoc_dept,formsemestre_id=formsemestre_id,
# moduleimpl_id=moduleimpl_id, datelundi=datelundi, group_ids=group_id)
# }"
H.append("</td></tr></table>")
#

View File

@ -1022,7 +1022,7 @@ def _module_selector(
for ue in ues:
modimpls_list += ntc.get_modimpls_dict(ue_id=ue["ue_id"])
selected = moduleimpl_id is not None
selected = "" if moduleimpl_id is not None else "selected"
modules = []
@ -1035,7 +1035,10 @@ def _module_selector(
modules.append({"moduleimpl_id": modimpl["moduleimpl_id"], "name": modname})
return render_template(
"assiduites/widgets/moduleimpl_selector.j2", selected=selected, modules=modules
"assiduites/widgets/moduleimpl_selector.j2",
selected=selected,
modules=modules,
moduleimpl_id=moduleimpl_id,
)