diff --git a/app/scodoc/sco_groups_view.py b/app/scodoc/sco_groups_view.py index bfb7590211..8dbd20593b 100644 --- a/app/scodoc/sco_groups_view.py +++ b/app/scodoc/sco_groups_view.py @@ -33,7 +33,6 @@ import collections import datetime -import operator import urllib from urllib.parse import parse_qs import time @@ -42,6 +41,8 @@ import time from flask import url_for, g, request from flask_login import current_user +from app import db +from app.models import FormSemestre import app.scodoc.sco_utils as scu from app.scodoc import html_sco_header from app.scodoc import sco_abs @@ -65,6 +66,7 @@ JAVASCRIPTS = html_sco_header.BOOTSTRAP_MULTISELECT_JS + [ CSSSTYLES = html_sco_header.BOOTSTRAP_MULTISELECT_CSS + # view: def groups_view( group_ids=(), @@ -422,6 +424,13 @@ class DisplayedGroupsInfos(object): H.append(f'') return "\n".join(H) + def get_formsemestre(self) -> FormSemestre: + return ( + db.session.get(FormSemestre, self.formsemestre_id) + if self.formsemestre_id + else None + ) + # Ancien ZScolar.group_list renommé ici en group_table def groups_table( diff --git a/app/tables/visu_assiduites.py b/app/tables/visu_assiduites.py index 3c8304b9ef..9522341b55 100644 --- a/app/tables/visu_assiduites.py +++ b/app/tables/visu_assiduites.py @@ -8,7 +8,7 @@ """ from flask import g, url_for -from app.models import Identite, Assiduite, Justificatif +from app.models import Identite, Justificatif from app.tables import table_builder as tb import app.scodoc.sco_assiduites as scass from app.scodoc import sco_preferences @@ -65,31 +65,35 @@ class RowAssi(tb.Row): } ) - bilan_etud = f"{url_for('assiduites.bilan_etud', scodoc_dept=g.scodoc_dept)}?etudid={etud.id}" + bilan_etud = url_for( + "assiduites.bilan_etud", scodoc_dept=g.scodoc_dept, etudid=etud.id + ) self.add_cell( "nom_disp", "Nom", etud.nom_disp(), - "identite_detail", + "etudinfo", + attrs={"id": str(etud.id)}, data={"order": etud.sort_key}, target=bilan_etud, - target_attrs={"class": "discretelink", "id": str(etud.id)}, + target_attrs={"class": "discretelink"}, ) self.add_cell( "prenom", "Prénom", - etud.prenom, - "identite_detail", + etud.prenom_str, + "etudinfo", + attrs={"id": str(etud.id)}, data={"order": etud.sort_key}, target=bilan_etud, - target_attrs={"class": "discretelink", "id": str(etud.id)}, + target_attrs={"class": "discretelink"}, ) stats = self._get_etud_stats(etud) for key, value in stats.items(): self.add_cell(key, value[0], f"{value[1] - value[2]}", "assi_stats") self.add_cell( key + "_justi", - value[0] + " Justifiée(s)", + value[0] + " Justifiées", f"{value[2]}", "assi_stats", ) @@ -102,9 +106,9 @@ class RowAssi(tb.Row): def _get_etud_stats(self, etud: Identite) -> dict[str, list[str, float, float]]: retour: dict[str, tuple[str, float, float]] = { - "present": ["Présence(s)", 0.0, 0.0], - "retard": ["Retard(s)", 0.0, 0.0], - "absent": ["Absence(s)", 0.0, 0.0], + "present": ["Présences", 0.0, 0.0], + "retard": ["Retards", 0.0, 0.0], + "absent": ["Absences", 0.0, 0.0], } assi_metric = { diff --git a/app/templates/assiduites/pages/visu_assi.j2 b/app/templates/assiduites/pages/visu_assi.j2 index 250c884e7a..882eadb28d 100644 --- a/app/templates/assiduites/pages/visu_assi.j2 +++ b/app/templates/assiduites/pages/visu_assi.j2 @@ -1,11 +1,22 @@ +{% extends "sco_page.j2" %} + +{% block scripts %} + {{ super() }} + +{% endblock %} + +{% block app_content %} +