From 688fc5401fa148b166f137614c34717b1266dbeb Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 7 Dec 2022 15:52:50 +0100 Subject: [PATCH] Gestion du champ 'boursier' --- app/scodoc/sco_etud.py | 3 --- app/scodoc/sco_groups_view.py | 19 +++++++++++++++---- app/scodoc/sco_page_etud.py | 6 +++++- app/static/css/scodoc.css | 8 ++++++++ app/static/js/groups_view.js | 2 +- app/views/scolar.py | 7 ++++--- tests/unit/test_abs_demijournee.py | 2 +- tools/format_import_etudiants.txt | 1 + 8 files changed, 35 insertions(+), 13 deletions(-) diff --git a/app/scodoc/sco_etud.py b/app/scodoc/sco_etud.py index bcf06fce..d4edc89c 100644 --- a/app/scodoc/sco_etud.py +++ b/app/scodoc/sco_etud.py @@ -923,9 +923,6 @@ def fill_etuds_info(etuds: list[dict], add_admission=True): rap += "%s" % etud["commentaire"] etud["rap"] = rap - # if etud['boursier_prec']: - # pass - if etud.get("telephone"): etud["telephonestr"] = "Tél.: " + format_telephone(etud["telephone"]) else: diff --git a/app/scodoc/sco_groups_view.py b/app/scodoc/sco_groups_view.py index 1a4fe0ab..667a292b 100644 --- a/app/scodoc/sco_groups_view.py +++ b/app/scodoc/sco_groups_view.py @@ -75,6 +75,7 @@ def groups_view( with_paiement=0, # si vrai, ajoute colonnes infos paiement droits et finalisation inscription (lent car interrogation portail) with_archives=0, # ajoute colonne avec noms fichiers archivés with_annotations=0, + with_bourse=0, formsemestre_id=None, # utilise si aucun groupe selectionné ): """Affichage des étudiants des groupes indiqués @@ -98,6 +99,7 @@ def groups_view( with_paiement=with_paiement, with_archives=with_archives, with_annotations=with_annotations, + with_bourse=with_bourse, ) H = [ @@ -137,6 +139,7 @@ def groups_view( with_paiement=with_paiement, with_archives=with_archives, with_annotations=with_annotations, + with_bourse=with_bourse, ), "", """
""", @@ -429,6 +432,7 @@ def groups_table( with_paiement=0, # si vrai, ajoute colonnes infos paiement droits et finalisation inscription (lent car interrogation portail) with_archives=0, # ajoute colonne avec noms fichiers archivés with_annotations=0, + with_bourse=0, ): """liste etudiants inscrits dans ce semestre format: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf @@ -444,12 +448,14 @@ def groups_table( with_paiement = int(with_paiement) with_archives = int(with_archives) with_annotations = int(with_annotations) + with_bourse = int(with_bourse) - base_url_np = groups_infos.base_url + "&with_codes=%s" % with_codes + base_url_np = groups_infos.base_url + f"&with_codes={with_codes}" base_url = ( base_url_np - + "&with_paiement=%s&with_archives=%s&with_annotations=%s" - % (with_paiement, with_archives, with_annotations) + + f"""&with_paiement={with_paiement}&with_archives={ + with_archives}&with_annotations={with_annotations + }&with_bourse={with_bourse}""" ) # columns_ids = ["civilite_str", "nom_disp", "prenom"] # colonnes a inclure @@ -467,6 +473,7 @@ def groups_table( "paiementinscription_str": "Paiement", "etudarchive": "Fichiers", "annotations_str": "Annotations", + "bourse_str": "Boursier", "etape": "Etape", "semestre_groupe": "Semestre-Groupe", # pour Moodle } @@ -504,6 +511,8 @@ def groups_table( if with_annotations: sco_etud.add_annotations_to_etud_list(groups_infos.members) columns_ids += ["annotations_str"] + if with_bourse: + columns_ids += ["bourse_str"] moodle_sem_name = groups_infos.formsemestre["session_id"] moodle_groupenames = set() # ajoute liens @@ -524,7 +533,7 @@ def groups_table( etud["_prenom_target"] = fiche_url etud["_nom_disp_td_attrs"] = 'id="%s" class="etudinfo"' % (etud["etudid"]) - + etud["bourse_str"] = "oui" if etud["boursier"] else "non" if etud["etat"] == "D": etud["_css_row_class"] = "etuddem" # et groupes: @@ -625,6 +634,7 @@ def groups_table( "with_archives": "Fichiers archivés", "with_annotations": "Annotations", "with_codes": "Codes", + "with_bourse": "Statut boursier", } for option in options: if locals().get(option, False): @@ -762,6 +772,7 @@ def groups_table( "codelycee", "type_admission", "boursier_prec", + "boursier", "debouche", "parcours", "codeparcours", diff --git a/app/scodoc/sco_page_etud.py b/app/scodoc/sco_page_etud.py index 2bc1cc7a..9d747f45 100644 --- a/app/scodoc/sco_page_etud.py +++ b/app/scodoc/sco_page_etud.py @@ -446,6 +446,10 @@ def ficheEtud(etudid=None): else: info["groupes_row"] = "" info["menus_etud"] = menus_etud(etudid) + if info["boursier"]: + info["bourse_span"] = """boursier""" + else: + info["bourse_span"] = "" # raccordement provisoire pour juillet 2022, avant refonte complète de cette fiche... info["but_infos_mkup"] = jury_but_view.infos_fiche_etud_html(etudid) @@ -463,7 +467,7 @@ def ficheEtud(etudid=None):
- + %(groupes_row)s
Situation :%(situation)s
Situation :%(situation)s %(bourse_span)s
Né%(ne)s le :%(info_naissance)s
diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index dabfdcfe..9dd4cf91 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -787,6 +787,14 @@ td.fichetitre2 { vertical-align: top; } +.ficheEtud span.boursier { + background-color: red; + color: white; + margin-left: 12px; + padding: 4px; + border-radius: 12px; +} + td.fichetitre2 .formula { font-weight: normal; color: rgb(0, 64, 0); diff --git a/app/static/js/groups_view.js b/app/static/js/groups_view.js index 8bfe49e4..5c59018d 100644 --- a/app/static/js/groups_view.js +++ b/app/static/js/groups_view.js @@ -69,7 +69,7 @@ $().ready(function () { function change_list_options() { var url = groups_view_url(); var selected_options = $("#group_list_options").val(); - var options = ["with_paiement", "with_archives", "with_annotations", "with_codes"]; + var options = ["with_paiement", "with_archives", "with_annotations", "with_codes", "with_bourse"]; for (var i = 0; i < options.length; i++) { var option = options[i]; delete url.param()[option]; diff --git a/app/views/scolar.py b/app/views/scolar.py index 1d68769f..6bb24e9f 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -437,7 +437,6 @@ sco_publish( @bp.route("/groups_view") @scodoc @permission_required_compat_scodoc7(Permission.ScoView) -# @permission_required(Permission.ScoView) @scodoc7func def groups_view( group_ids=(), @@ -448,6 +447,7 @@ def groups_view( with_paiement=0, # si vrai, ajoute colonnes infos paiement droits et finalisation inscription (lent car interrogation portail) with_archives=0, # ajoute colonne avec noms fichiers archivés with_annotations=0, + with_bourse=0, formsemestre_id=None, ): return sco_groups_view.groups_view( @@ -456,9 +456,10 @@ def groups_view( # Options pour listes: with_codes=with_codes, etat=etat, - with_paiement=with_paiement, # si vrai, ajoute colonnes infos paiement droits et finalisation inscription (lent car interrogation portail) - with_archives=with_archives, # ajoute colonne avec noms fichiers archivés + with_paiement=with_paiement, + with_archives=with_archives, with_annotations=with_annotations, + with_bourse=with_bourse, formsemestre_id=formsemestre_id, ) diff --git a/tests/unit/test_abs_demijournee.py b/tests/unit/test_abs_demijournee.py index e148b943..c486a984 100644 --- a/tests/unit/test_abs_demijournee.py +++ b/tests/unit/test_abs_demijournee.py @@ -122,7 +122,7 @@ def test_abs_basic(test_client): - partition_create - create_group - set_group - - EtatAbsenceGr + - EtatAbsencesGr - AddBilletAbsence - billets_etud """ diff --git a/tools/format_import_etudiants.txt b/tools/format_import_etudiants.txt index 658c6d2c..3ba04f50 100644 --- a/tools/format_import_etudiants.txt +++ b/tools/format_import_etudiants.txt @@ -28,6 +28,7 @@ anglais; real; admissions; 1; note de anglais en terminale francais; real; admissions; 1; note de francais au bac type_admission; text; admissions; 1; voie d'admission (APB, APB-PC, CEF, ...) boursier_prec; integer; admissions; 1; 0/1 etait boursier dans le cycle precedent (lycee) ? +boursier; integer; identite; 1; 0/1 est actuellement boursier qualite; real; admissions; 1; note de qualite du dossier rapporteur; text; admissions; 1; identite du rapporteur (enseignant IUT) decision; text; admissions; 1; decision (admis, attente, ...)