From 2f5a786b2dca0aa623e57dd50ad17497e1fd36ba Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 22 Jul 2022 17:37:01 +0200 Subject: [PATCH] =?UTF-8?q?Place=20pour=20le=20futur=20=C3=A9diteur=20de?= =?UTF-8?q?=20partitions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_formsemestre_status.py | 11 ++++++++ app/static/css/partition_editor.css | 1 + app/static/js/partition_editor.js | 1 + app/templates/scolar/partition_editor.html | 6 +++++ app/views/scolar.py | 31 ++++++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 app/static/css/partition_editor.css create mode 100644 app/static/js/partition_editor.js create mode 100644 app/templates/scolar/partition_editor.html diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index ec4fb6da..2ea11955 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -355,6 +355,17 @@ def formsemestre_status_menubar(sem): menuGroupes.append( {"title": "Modifier les groupes", "submenu": submenu, "enabled": enabled} ) + menuGroupes.append( + { + "title": "Expérimental: éditeur de partitions", + "endpoint": "scolar.partition_editor", + "args": {"formsemestre_id": formsemestre_id}, + "enabled": sco_groups.sco_permissions_check.can_change_groups( + formsemestre_id + ), + "helpmsg": "Une spécialité de Mulhouse", + }, + ) menuNotes = [ { diff --git a/app/static/css/partition_editor.css b/app/static/css/partition_editor.css new file mode 100644 index 00000000..63071608 --- /dev/null +++ b/app/static/css/partition_editor.css @@ -0,0 +1 @@ +// Editeur de partitions \ No newline at end of file diff --git a/app/static/js/partition_editor.js b/app/static/js/partition_editor.js new file mode 100644 index 00000000..68ea379a --- /dev/null +++ b/app/static/js/partition_editor.js @@ -0,0 +1 @@ +// Ici viendra le code de Seb diff --git a/app/templates/scolar/partition_editor.html b/app/templates/scolar/partition_editor.html new file mode 100644 index 00000000..a5800ca4 --- /dev/null +++ b/app/templates/scolar/partition_editor.html @@ -0,0 +1,6 @@ +{# -*- mode: jinja-html -*- #} +

{% if not read_only %}Édition des p{% else %}P{%endif%}artitions

+ +
Une spécialité Mulhousaine vous sera prochainement servie ici
+ + diff --git a/app/views/scolar.py b/app/views/scolar.py index f1e860de..6c389601 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -51,6 +51,7 @@ from app.decorators import ( admin_required, login_required, ) +from app.models import formsemestre from app.models.etudiants import Identite from app.models.etudiants import make_etud_args from app.models.events import ScolarNews @@ -909,6 +910,36 @@ sco_publish( methods=["GET", "POST"], ) +# Nouvel éditeur de partitions et groupe, @SebL Jul 2022 +@bp.route("/partition_editor", methods=["GET", "POST"]) +@scodoc +@permission_required(Permission.ScoView) +@scodoc7func +def partition_editor(formsemestre_id: int): + formsemestre: FormSemestre = FormSemestre.query.get_or_404(formsemestre_id) + H = [ + html_sco_header.sco_header( + cssstyles=["css/partition_editor.css"], + javascripts=[ + "js/partition_editor.js", + ], + page_title=f"Partitions de {formsemestre.titre_annee()}", + ), + f"""

+

+ """, + render_template( + "scolar/partition_editor.html", + formsemestre=formsemestre, + read_only=not sco_groups.sco_permissions_check.can_change_groups( + formsemestre_id + ), + ), + html_sco_header.sco_footer(), + ] + + return "\n".join(H) + @bp.route("/create_partition_parcours", methods=["GET", "POST"]) @scodoc