diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index ec4fb6dac..2ea119552 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 000000000..63071608a --- /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 000000000..68ea379af --- /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 000000000..a5800ca42 --- /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 f1e860deb..6c389601a 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