From b2c98af29332326167c03c1c0aa4b8ad70ba925b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 18 Nov 2021 11:29:38 +0100 Subject: [PATCH] WIP: Edition formations --- app/static/css/table_editor.css | 3 --- app/templates/pn/form_descr.html | 2 +- app/templates/pn/form_modules_ue_coefs.html | 14 ++++---------- app/views/pn_modules.py | 11 ++++++----- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/app/static/css/table_editor.css b/app/static/css/table_editor.css index 4a4bcf8b2..40f8738f9 100644 --- a/app/static/css/table_editor.css +++ b/app/static/css/table_editor.css @@ -1,8 +1,5 @@ /* table_editor, par Sébastien L. */ -body { - font-family: Arial, Helvetica, sans-serif; -} /***************************/ /* Le tableau */ diff --git a/app/templates/pn/form_descr.html b/app/templates/pn/form_descr.html index 2d55cf532..347180257 100644 --- a/app/templates/pn/form_descr.html +++ b/app/templates/pn/form_descr.html @@ -29,7 +29,7 @@ {% if editable %}
modifier ces informations
{% endif %} diff --git a/app/templates/pn/form_modules_ue_coefs.html b/app/templates/pn/form_modules_ue_coefs.html index 1d63131c3..01df62afe 100644 --- a/app/templates/pn/form_modules_ue_coefs.html +++ b/app/templates/pn/form_modules_ue_coefs.html @@ -1,9 +1,10 @@ -
Semestre: - {% for i in semestre_ids %} {% endfor %} + -10) { + if (semestre_idx >= 0) { let base_url = "{{data_source}}"; let data_url = base_url.replace(/\/[\-0-9]*$/, "/" + semestre_idx); console.log("data_url=", data_url); diff --git a/app/views/pn_modules.py b/app/views/pn_modules.py index a40f6f1e0..7f9134583 100644 --- a/app/views/pn_modules.py +++ b/app/views/pn_modules.py @@ -151,12 +151,13 @@ def set_module_ue_coef(): return scu.json_error("ok", success=True, status=201) -@bp.route("/edit_modules_ue_coefs/", defaults={"semestre_idx": -100}) -@bp.route("/edit_modules_ue_coefs//") +@bp.route("/edit_modules_ue_coefs") @scodoc @permission_required(Permission.ScoChangeFormation) -def edit_modules_ue_coefs(formation_id, semestre_idx=None): +def edit_modules_ue_coefs(semestre_idx=None): """Formulaire édition grille coefs EU/modules""" + formation_id = int(request.args["formation_id"]) + semestre_idx = int(request.args.get("semestre_idx", -1)) formation = models.Formation.query.filter_by( formation_id=formation_id ).first_or_404() @@ -185,13 +186,13 @@ def edit_modules_ue_coefs(formation_id, semestre_idx=None): "notes.table_modules_ue_coefs", scodoc_dept=g.scodoc_dept, formation_id=formation_id, - semestre_idx=semestre_idx or "", + semestre_idx=semestre_idx, ), data_save=url_for( "notes.set_module_ue_coef", scodoc_dept=g.scodoc_dept, ), - semestre_idx=int(semestre_idx), + semestre_idx=semestre_idx, semestre_ids=range(1, formation.get_parcours().NB_SEM + 1), ), html_sco_header.sco_footer(),