From ebceb70f054c84574179b114871b9179f4617578 Mon Sep 17 00:00:00 2001 From: Iziram Date: Mon, 19 Aug 2024 09:55:07 +0200 Subject: [PATCH 01/15] frontend: fix ligne semestre scolar/index.j2 --- app/templates/scolar/index.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/templates/scolar/index.j2 b/app/templates/scolar/index.j2 index f82acbb9..7038bd83 100644 --- a/app/templates/scolar/index.j2 +++ b/app/templates/scolar/index.j2 @@ -98,6 +98,14 @@ div.effectif { max-width: 1024px; /* Maximum width */ margin: 0 auto 0 0; /* Centers divs if they are narrower than 1024px */ } + +@media screen and (max-width: 768px) { + /*Fix for mobile*/ + .cur-formsemestres { + width: auto; + } +} + .cur-formsemestre { display: flex; align-items: center; @@ -143,6 +151,7 @@ div.effectif { display: flex; flex-direction: column; font-size: 14px; + white-space: nowrap; } .responsable { font-weight: bold; From 1437c1bafa4bbce09e3c5c00f16f0ed8566ed165 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 15 Aug 2024 00:04:35 +0200 Subject: [PATCH 02/15] Templates: partition_editor, ue_table, evaluation_listenotes --- app/scodoc/sco_edit_ue.py | 36 +++++++++++------------- app/templates/babase.j2 | 3 ++ app/templates/base.j2 | 5 ++-- app/templates/scolar/partition_editor.j2 | 34 ++++++++++++++++------ app/views/notes.py | 13 ++++----- app/views/scolar.py | 30 ++++++-------------- 6 files changed, 63 insertions(+), 58 deletions(-) diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index 0fbc05f3..33327d99 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -25,9 +25,7 @@ # ############################################################################## -"""Ajout/Modification/Suppression UE - -""" +"""Ajout/Modification/Suppression UE""" 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é)" ) 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"""

{formation.html()} {lockicon}

""", @@ -1069,8 +1053,22 @@ du programme" (menu "Semestre") si vous avez un semestre en cours); warn, _ = sco_formsemestre_validation.check_formation_ues(formation) H.append(warn) - H.append(html_sco_header.sco_footer()) - return "".join(H) + return render_template( + "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): diff --git a/app/templates/babase.j2 b/app/templates/babase.j2 index 94baa48d..00a1a6da 100644 --- a/app/templates/babase.j2 +++ b/app/templates/babase.j2 @@ -13,6 +13,9 @@ + {% for css in cssstyles %} + + {% endfor %} {%- endblock styles %} {%- endblock head %} diff --git a/app/templates/base.j2 b/app/templates/base.j2 index 17872666..24341c4d 100644 --- a/app/templates/base.j2 +++ b/app/templates/base.j2 @@ -62,9 +62,8 @@ {% endblock %} {% block content %} -
- {% include "flashed_messages.j2" %} -
+ +{% include "flashed_messages.j2" %} {# application content needs to be provided in the app_content block #}
diff --git a/app/templates/scolar/partition_editor.j2 b/app/templates/scolar/partition_editor.j2 index a9de162e..66fb7e49 100644 --- a/app/templates/scolar/partition_editor.j2 +++ b/app/templates/scolar/partition_editor.j2 @@ -1,15 +1,32 @@ {# -*- mode: jinja-html -*- #} +{% extends "sco_page.j2" %} -{% if not is_edt_configured %} - -{% endif %} +{% block title %} + Partitions de {{ formsemestre.titre_annee() }} +{% endblock title %} +{% block styles %} + {{ super() }} + + + {% if not is_edt_configured %} + + {% endif %} +{% endblock %} + + +{% block scripts %} + {{ super() }} + +{% endblock %} + +{% block app_content %}

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

- +

@@ -1024,3 +1041,4 @@ span.calendarEdit { } +{% endblock %} diff --git a/app/views/notes.py b/app/views/notes.py index 697eee5c..587132cd 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -1762,19 +1762,18 @@ def evaluation_listenotes(): raise ScoValueError("evaluation_listenotes: id invalides !") from exc 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 ) if fmt == "html": - H = html_sco_header.sco_header( - page_title=page_title, + return render_template( + "sco_page.j2", + content=content, + title=page_title, cssstyles=["css/verticalhisto.css"], javascripts=["js/etud_info.js"], ) - F = html_sco_header.sco_footer() - return H + html_content + F - else: - return html_content + return content sco_publish( diff --git a/app/views/scolar.py b/app/views/scolar.py index d5c97446..6cf569af 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -944,27 +944,15 @@ def partition_editor(formsemestre_id: int, edit_partition=False): formsemestre: FormSemestre = FormSemestre.query.get_or_404(formsemestre_id) edit_partition = bool(int(edit_partition)) if edit_partition else False formsemestre.setup_parcours_groups() - H = [ - html_sco_header.sco_header( - cssstyles=["css/partition_editor.css"], - javascripts=[ - "js/partition_editor.js", - ], - page_title=f"Partitions de {formsemestre.titre_annee()}", - ), - """

""", - render_template( - "scolar/partition_editor.j2", - formsemestre=formsemestre, - read_only=not formsemestre.can_change_groups(), - edit_partition=edit_partition, - is_edt_configured=sco_edt_cal.is_edt_configured(), - scu=scu, - ), - html_sco_header.sco_footer(), - ] - - return "\n".join(H) + return render_template( + "scolar/partition_editor.j2", + formsemestre=formsemestre, + read_only=not formsemestre.can_change_groups(), + edit_partition=edit_partition, + is_edt_configured=sco_edt_cal.is_edt_configured(), + sco=ScoData(formsemestre=formsemestre), + scu=scu, + ) @bp.route("/students_groups_auto_assignment", methods=["GET", "POST"]) From 99b0f23bcab1279432ae6dd7c59aa3d2fde44212 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 15 Aug 2024 17:06:07 +0200 Subject: [PATCH 03/15] minor css fixes --- app/scodoc/html_sco_header.py | 8 ++++---- app/scodoc/sco_archives_formsemestre.py | 2 +- app/scodoc/sco_edit_ue.py | 8 +++++--- app/scodoc/sco_find_etud.py | 2 +- app/scodoc/sco_recapcomplet.py | 2 +- app/scodoc/sco_report.py | 2 +- app/static/css/scodoc97.css | 3 ++- app/templates/formsemestre/menu.j2 | 10 +++++----- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/scodoc/html_sco_header.py b/app/scodoc/html_sco_header.py index 54e0176b..28d6249b 100644 --- a/app/scodoc/html_sco_header.py +++ b/app/scodoc/html_sco_header.py @@ -134,7 +134,7 @@ def scodoc_top_html_header(page_title="ScoDoc: bienvenue"): def sco_header( # optional args page_title="", # page title - no_side_bar=False, # hide sidebar + no_sidebar=False, # hide sidebar cssstyles=(), # additionals CSS sheets javascripts=(), # additionals JS filenames to load scripts=(), # script to put in page header @@ -154,13 +154,13 @@ def sco_header( params = { "page_title": page_title or sco_version.SCONAME, - "no_side_bar": no_side_bar, + "no_sidebar": no_sidebar, "ScoURL": url_for("scolar.index_html", scodoc_dept=g.scodoc_dept), "encoding": scu.SCO_ENCODING, "titrebandeau_mkup": "" + titrebandeau + "", "authuser": current_user.user_name, } - if no_side_bar: + if no_sidebar: params["margin_left"] = "1em" else: params["margin_left"] = "140px" @@ -217,7 +217,7 @@ def sco_header( {scu.CUSTOM_HTML_HEADER} -{'' if no_side_bar else html_sidebar.sidebar(etudid)} +{'' if no_sidebar else html_sidebar.sidebar(etudid)}
""" ) diff --git a/app/scodoc/sco_archives_formsemestre.py b/app/scodoc/sco_archives_formsemestre.py index f2fbde23..cbcbd201 100644 --- a/app/scodoc/sco_archives_formsemestre.py +++ b/app/scodoc/sco_archives_formsemestre.py @@ -127,7 +127,7 @@ def do_formsemestre_archive( [ html_sco_header.sco_header( page_title=f"Moyennes archivées le {date}", - no_side_bar=True, + no_sidebar=True, ), f'

Valeurs archivées le {date}

', """ {% endblock %} From 3d74979237fdfe252a163088d96a71071211403e Mon Sep 17 00:00:00 2001 From: Iziram Date: Tue, 20 Aug 2024 15:03:41 +0200 Subject: [PATCH 10/15] scodoc9_mobile.css in progress --- app/static/css/scodoc9_mobile.css | 14 ++++++++++++++ app/templates/sco_page.j2 | 1 + 2 files changed, 15 insertions(+) create mode 100644 app/static/css/scodoc9_mobile.css diff --git a/app/static/css/scodoc9_mobile.css b/app/static/css/scodoc9_mobile.css new file mode 100644 index 00000000..d3ff6918 --- /dev/null +++ b/app/static/css/scodoc9_mobile.css @@ -0,0 +1,14 @@ +/* == Gestion des styles pour les mobiles == */ + +@media screen and (max-width: 768px) { + + /* <== Module Assiduité ==> */ + #ajout-assiduite-etud .description>textarea, + #ajout-justificatif-etud .raison>textarea { + width: 90%; + } + + #ajout-assiduite-etud #modimpl { + max-width: 200px; + } +} \ No newline at end of file diff --git a/app/templates/sco_page.j2 b/app/templates/sco_page.j2 index 0eb04f4c..43d73a6a 100644 --- a/app/templates/sco_page.j2 +++ b/app/templates/sco_page.j2 @@ -5,6 +5,7 @@ {{super()}} + From 9caa6bf75dfbb2437cd544449b7285de1bc86acc Mon Sep 17 00:00:00 2001 From: Iziram Date: Tue, 20 Aug 2024 15:04:09 +0200 Subject: [PATCH 11/15] fix taille champs desc / raison et modimpl form assiduite --- app/templates/assiduites/pages/ajout_assiduite_etud.j2 | 4 ++-- app/templates/assiduites/pages/ajout_justificatif_etud.j2 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/assiduites/pages/ajout_assiduite_etud.j2 b/app/templates/assiduites/pages/ajout_assiduite_etud.j2 index aa017568..561f18cc 100644 --- a/app/templates/assiduites/pages/ajout_assiduite_etud.j2 +++ b/app/templates/assiduites/pages/ajout_assiduite_etud.j2 @@ -95,8 +95,8 @@ div.submit > input { {{ render_field_errors(form, 'est_just') }}
{# Description #} -
-
{{ form.description.label }}
+
+ {{ form.description.label }} {{ form.description() }} {{ render_field_errors(form, 'description') }}
diff --git a/app/templates/assiduites/pages/ajout_justificatif_etud.j2 b/app/templates/assiduites/pages/ajout_justificatif_etud.j2 index eafe7194..3aeba96a 100644 --- a/app/templates/assiduites/pages/ajout_justificatif_etud.j2 +++ b/app/templates/assiduites/pages/ajout_justificatif_etud.j2 @@ -106,7 +106,7 @@ div.submit > input { {{ render_field_errors(form, 'etat') }}
{# Raison #} -
+
{% if (not justif) or can_view_justif_detail %}
{{ form.raison.label }}
{{ form.raison() }} From 71f88dfa975718f3805acf355402e184335e92cd Mon Sep 17 00:00:00 2001 From: Iziram Date: Tue, 20 Aug 2024 15:08:40 +0200 Subject: [PATCH 12/15] bilan_etud : responsive in progress --- app/static/css/scodoc9_mobile.css | 3 ++- app/templates/assiduites/pages/bilan_etud.j2 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/static/css/scodoc9_mobile.css b/app/static/css/scodoc9_mobile.css index d3ff6918..f86f73f9 100644 --- a/app/static/css/scodoc9_mobile.css +++ b/app/static/css/scodoc9_mobile.css @@ -8,7 +8,8 @@ width: 90%; } - #ajout-assiduite-etud #modimpl { + #modimpl, + #moduleimpl_select { max-width: 200px; } } \ No newline at end of file diff --git a/app/templates/assiduites/pages/bilan_etud.j2 b/app/templates/assiduites/pages/bilan_etud.j2 index 74586c5f..a2dafcd7 100644 --- a/app/templates/assiduites/pages/bilan_etud.j2 +++ b/app/templates/assiduites/pages/bilan_etud.j2 @@ -76,6 +76,7 @@ Bilan assiduité de {{sco.etud.nomprenom}} id="stats_date_debut" value="{{date_debut}}"> +
From 4f40713787ee626ae0fe0d08f4b10bbfccb83f7d Mon Sep 17 00:00:00 2001 From: Iziram Date: Tue, 20 Aug 2024 15:20:14 +0200 Subject: [PATCH 13/15] fix pagination tableaux --- app/templates/assiduites/widgets/tableau.j2 | 29 ++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/app/templates/assiduites/widgets/tableau.j2 b/app/templates/assiduites/widgets/tableau.j2 index 77f6d838..b0370409 100644 --- a/app/templates/assiduites/widgets/tableau.j2 +++ b/app/templates/assiduites/widgets/tableau.j2 @@ -58,7 +58,7 @@ {% if total_pages > 1 %} @@ -235,7 +235,30 @@ max-width: fit-content; } - .pagination li{ + .pagination li>*{ cursor: pointer; + + /*Style pour les boutons de pagination*/ + border: 1px solid #ccc; + background-color: #f1f1f1; + padding: 8px 16px; + font-size: 16px; + border-radius: 4px; + margin: 8px 1px; + + } + .pagination li:hover >a, .pagination li.active>*{ + /*Style pour les boutons actifs*/ + background-color: var(--sco-color-ues); + color: white !important; + + } + + .pagination li.disabled>*{ + /*Style pour les boutons désactivés*/ + opacity: 0.5; + cursor: default; + pointer-events: none; + user-select: none; } From 07f09ddead2add14ffc4304e907c654fba2b864b Mon Sep 17 00:00:00 2001 From: Iziram Date: Tue, 20 Aug 2024 17:56:59 +0200 Subject: [PATCH 14/15] signal_assiduites_group : rendu mobile --- app/static/css/scodoc9_mobile.css | 83 +++++++++++++++++++ .../pages/signal_assiduites_group.j2 | 21 +++-- app/templates/assiduites/widgets/timeline.j2 | 11 ++- 3 files changed, 103 insertions(+), 12 deletions(-) diff --git a/app/static/css/scodoc9_mobile.css b/app/static/css/scodoc9_mobile.css index f86f73f9..d4b8c521 100644 --- a/app/static/css/scodoc9_mobile.css +++ b/app/static/css/scodoc9_mobile.css @@ -12,4 +12,87 @@ #moduleimpl_select { max-width: 200px; } + + #timeline { + flex-wrap: wrap-reverse; + } + + .time-buttons { + display: flex; + justify-content: space-evenly; + } + + #timeline .inputs { + flex-direction: row; + justify-content: space-evenly; + width: 100%; + padding: 8px; + } + + #timeline .inputs>input { + width: 100%; + text-align: center; + } + + .timeline-container .period-handle::before { + width: 40px !important; + height: 100% !important; + content: ""; + display: block; + background-color: red; + border-radius: 12px; + opacity: 0.5; + position: absolute; + top: 0; + + mix-blend-mode: color-dodge; + + } + + .timeline-container .period-handle.left::before { + transform: translateX(-50%); + left: 0; + } + + .timeline-container .period-handle.right::before { + transform: translateX(50%); + right: 0; + } + + .selectors .infos { + flex-direction: column; + } + + .selectors .infos .date-input { + display: flex; + flex-direction: row; + justify-content: space-evenly; + } + + .mass-selection { + flex-wrap: wrap; + } + + .etud_row { + grid-template-columns: 2% 20% auto 25% !important; + max-width: 350px; + gap: 8px; + } + + .etud_row .assiduites_bar { + grid-column: 4 !important; + grid-row: 1; + } + + .etud_row .btns_field.single { + grid-column: 3 !important; + grid-row: 1; + } + + .rbtn::before { + --size: 35px; + width: var(--size) !important; + height: var(--size) !important; + } + } \ No newline at end of file diff --git a/app/templates/assiduites/pages/signal_assiduites_group.j2 b/app/templates/assiduites/pages/signal_assiduites_group.j2 index b939944a..0e3de93f 100644 --- a/app/templates/assiduites/pages/signal_assiduites_group.j2 +++ b/app/templates/assiduites/pages/signal_assiduites_group.j2 @@ -115,6 +115,7 @@ padding: 5px; border-radius: 5px; text-decoration: none; + z-index: 100; } html{ @@ -152,20 +153,22 @@
Groupes : {{grp|safe}}
-
- - +
+ +
+ +
+
-
{{timeline|safe}} -
+
diff --git a/app/templates/assiduites/widgets/timeline.j2 b/app/templates/assiduites/widgets/timeline.j2 index eaac2b84..e16045f0 100644 --- a/app/templates/assiduites/widgets/timeline.j2 +++ b/app/templates/assiduites/widgets/timeline.j2 @@ -3,7 +3,7 @@
-
+
@@ -12,8 +12,6 @@