Templates: partition_editor, ue_table, evaluation_listenotes

This commit is contained in:
Emmanuel Viennet 2024-08-15 00:04:35 +02:00 committed by Iziram
parent ebceb70f05
commit 1437c1bafa
6 changed files with 63 additions and 58 deletions

View File

@ -25,9 +25,7 @@
# #
############################################################################## ##############################################################################
"""Ajout/Modification/Suppression UE """Ajout/Modification/Suppression UE"""
"""
import re import re
@ -765,20 +763,6 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""): # was ue_list
"delete_small_dis_img", title="Suppression impossible (module utilisé)" "delete_small_dis_img", title="Suppression impossible (module utilisé)"
) )
H = [ H = [
html_sco_header.sco_header(
cssstyles=html_sco_header.BOOTSTRAP_CSS
+ ["libjs/jQuery-tagEditor/jquery.tag-editor.css", "css/ue_table.css"],
javascripts=html_sco_header.BOOTSTRAP_JS
+ [
"libjs/jinplace-1.2.1.min.js",
"js/ue_list.js",
"js/edit_ue.js",
"libjs/jQuery-tagEditor/jquery.tag-editor.min.js",
"libjs/jQuery-tagEditor/jquery.caret.min.js",
"js/module_tag_editor.js",
],
page_title=f"Formation {formation.acronyme} v{formation.version}",
),
f"""<h2>{formation.html()} {lockicon} f"""<h2>{formation.html()} {lockicon}
</h2> </h2>
""", """,
@ -1069,8 +1053,22 @@ du programme" (menu "Semestre") si vous avez un semestre en cours);
warn, _ = sco_formsemestre_validation.check_formation_ues(formation) warn, _ = sco_formsemestre_validation.check_formation_ues(formation)
H.append(warn) H.append(warn)
H.append(html_sco_header.sco_footer()) return render_template(
return "".join(H) "sco_page_dept.j2",
content="".join(H),
page_title=f"Formation {formation.acronyme} v{formation.version}",
cssstyles=html_sco_header.BOOTSTRAP_MULTISELECT_CSS
+ ["libjs/jQuery-tagEditor/jquery.tag-editor.css", "css/ue_table.css"],
javascripts=html_sco_header.BOOTSTRAP_MULTISELECT_JS
+ [
"libjs/jinplace-1.2.1.min.js",
"js/ue_list.js",
"js/edit_ue.js",
"libjs/jQuery-tagEditor/jquery.tag-editor.min.js",
"libjs/jQuery-tagEditor/jquery.caret.min.js",
"js/module_tag_editor.js",
],
)
def _html_select_semestre_idx(formation_id, semestre_ids, semestre_idx): def _html_select_semestre_idx(formation_id, semestre_ids, semestre_idx):

View File

@ -13,6 +13,9 @@
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="{{scu.STATIC_DIR}}/libjs/bootstrap/css/bootstrap.css" rel="stylesheet"> <link href="{{scu.STATIC_DIR}}/libjs/bootstrap/css/bootstrap.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="{{scu.STATIC_DIR}}/libjs/bootstrap-multiselect-1.1.2/bootstrap-multiselect.min.css"> <link type="text/css" rel="stylesheet" href="{{scu.STATIC_DIR}}/libjs/bootstrap-multiselect-1.1.2/bootstrap-multiselect.min.css">
{% for css in cssstyles %}
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/{{css}}">
{% endfor %}
{%- endblock styles %} {%- endblock styles %}
{%- endblock head %} {%- endblock head %}
</head> </head>

View File

@ -62,9 +62,8 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container flashes">
{% include "flashed_messages.j2" %} {% include "flashed_messages.j2" %}
</div>
{# application content needs to be provided in the app_content block #} {# application content needs to be provided in the app_content block #}
<div class="container"> <div class="container">

View File

@ -1,4 +1,13 @@
{# -*- mode: jinja-html -*- #} {# -*- mode: jinja-html -*- #}
{% extends "sco_page.j2" %}
{% block title %}
Partitions de {{ formsemestre.titre_annee() }}
{% endblock title %}
{% block styles %}
{{ super() }}
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/css/partition_editor.css">
{% if not is_edt_configured %} {% if not is_edt_configured %}
<style> <style>
@ -7,9 +16,17 @@ span.calendarEdit {
} }
</style> </style>
{% endif %} {% endif %}
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{scu.STATIC_DIR}}/js/partition_editor.js"></script>
{% endblock %}
{% block app_content %}
<h1>{% if not read_only %}Édition des p{% else %}P{%endif%}artitions</h1> <h1>{% if not read_only %}Édition des p{% else %}P{%endif%}artitions</h1>
<h2></h2>
<main> <main>
<div class="wait"></div> <div class="wait"></div>
@ -1024,3 +1041,4 @@ span.calendarEdit {
} }
</script> </script>
{% endblock %}

View File

@ -1762,19 +1762,18 @@ def evaluation_listenotes():
raise ScoValueError("evaluation_listenotes: id invalides !") from exc raise ScoValueError("evaluation_listenotes: id invalides !") from exc
fmt = vals.get("fmt", "html") fmt = vals.get("fmt", "html")
html_content, page_title = sco_liste_notes.do_evaluation_listenotes( content, page_title = sco_liste_notes.do_evaluation_listenotes(
evaluation_id=evaluation_id, moduleimpl_id=moduleimpl_id, fmt=fmt evaluation_id=evaluation_id, moduleimpl_id=moduleimpl_id, fmt=fmt
) )
if fmt == "html": if fmt == "html":
H = html_sco_header.sco_header( return render_template(
page_title=page_title, "sco_page.j2",
content=content,
title=page_title,
cssstyles=["css/verticalhisto.css"], cssstyles=["css/verticalhisto.css"],
javascripts=["js/etud_info.js"], javascripts=["js/etud_info.js"],
) )
F = html_sco_header.sco_footer() return content
return H + html_content + F
else:
return html_content
sco_publish( sco_publish(

View File

@ -944,27 +944,15 @@ def partition_editor(formsemestre_id: int, edit_partition=False):
formsemestre: FormSemestre = FormSemestre.query.get_or_404(formsemestre_id) formsemestre: FormSemestre = FormSemestre.query.get_or_404(formsemestre_id)
edit_partition = bool(int(edit_partition)) if edit_partition else False edit_partition = bool(int(edit_partition)) if edit_partition else False
formsemestre.setup_parcours_groups() formsemestre.setup_parcours_groups()
H = [ return render_template(
html_sco_header.sco_header(
cssstyles=["css/partition_editor.css"],
javascripts=[
"js/partition_editor.js",
],
page_title=f"Partitions de {formsemestre.titre_annee()}",
),
"""<h2></h2>""",
render_template(
"scolar/partition_editor.j2", "scolar/partition_editor.j2",
formsemestre=formsemestre, formsemestre=formsemestre,
read_only=not formsemestre.can_change_groups(), read_only=not formsemestre.can_change_groups(),
edit_partition=edit_partition, edit_partition=edit_partition,
is_edt_configured=sco_edt_cal.is_edt_configured(), is_edt_configured=sco_edt_cal.is_edt_configured(),
sco=ScoData(formsemestre=formsemestre),
scu=scu, scu=scu,
), )
html_sco_header.sco_footer(),
]
return "\n".join(H)
@bp.route("/students_groups_auto_assignment", methods=["GET", "POST"]) @bp.route("/students_groups_auto_assignment", methods=["GET", "POST"])