From 16b3221daae63c77d2500f690f3a8698041ac650 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 29 Jun 2022 18:16:37 +0200 Subject: [PATCH] =?UTF-8?q?Refactoring=20/=20ann=C3=A9e=20BUT=20sur=20fich?= =?UTF-8?q?e=20=C3=A9tudiant=20(montage=20provoisoire)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/jury_but.py | 1 + app/scodoc/sco_page_etud.py | 9 +- app/static/css/jury_but.css | 12 ++- app/views/notes.py | 170 +++++++----------------------------- 4 files changed, 48 insertions(+), 144 deletions(-) diff --git a/app/but/jury_but.py b/app/but/jury_but.py index 39d477bf0..ee23b9750 100644 --- a/app/but/jury_but.py +++ b/app/but/jury_but.py @@ -200,6 +200,7 @@ class DecisionsProposeesAnnee(DecisionsProposees): formsemestre: FormSemestre, ): super().__init__(etud=etud) + self.formsemestre_id = formsemestre.id formsemestre_impair, formsemestre_pair = self.comp_formsemestres(formsemestre) assert ( (formsemestre_pair is None) diff --git a/app/scodoc/sco_page_etud.py b/app/scodoc/sco_page_etud.py index 2631ef45c..b0690ea43 100644 --- a/app/scodoc/sco_page_etud.py +++ b/app/scodoc/sco_page_etud.py @@ -36,6 +36,7 @@ from flask_login import current_user import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb from app import log +from app.but import jury_but_view from app.models.etudiants import make_etud_args from app.scodoc import html_sco_header from app.scodoc import htmlutils @@ -445,6 +446,10 @@ def ficheEtud(etudid=None): else: info["groupes_row"] = "" info["menus_etud"] = menus_etud(etudid) + + # raccordement provisoire pour juillet 2022, avant refonte complète de cette fiche... + info["but_infos_mkup"] = jury_but_view.infos_fiche_etud_html(etudid) + tmpl = """
@@ -477,6 +482,8 @@ def ficheEtud(etudid=None): %(inscriptions_mkup)s +%(but_infos_mkup)s +
%(adm_data)s @@ -513,7 +520,7 @@ def ficheEtud(etudid=None): """ header = html_sco_header.sco_header( page_title="Fiche étudiant %(prenom)s %(nom)s" % info, - cssstyles=["libjs/jQuery-tagEditor/jquery.tag-editor.css"], + cssstyles=["libjs/jQuery-tagEditor/jquery.tag-editor.css", "css/jury_but.css"], javascripts=[ "libjs/jinplace-1.2.1.min.js", "js/ue_list.js", diff --git a/app/static/css/jury_but.css b/app/static/css/jury_but.css index 42571c998..61211a574 100644 --- a/app/static/css/jury_but.css +++ b/app/static/css/jury_but.css @@ -65,11 +65,17 @@ font-weight: bold; } + .but_navigation { padding-top: 16px; - grid-column: 1 / -1; - display: flex; - justify-content: space-between; + margin-left: 50px; + margin-right: 50px; +} + +.but_navigation div { + display: inline-block; + margin-left: 50px; + margin-right: 50px; } div.but_section_annee { diff --git a/app/views/notes.py b/app/views/notes.py index dd19d717b..eba139599 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -31,7 +31,6 @@ Module notes: issu de ScoDoc7 / ZNotes.py Emmanuel Viennet, 2021 """ -from email.policy import default from operator import itemgetter import time from xml.etree import ElementTree @@ -43,6 +42,7 @@ from flask_login import current_user from app.but import jury_but, jury_but_validation_auto from app.but.forms import jury_but_forms +from app.but import jury_but_view from app.comp import res_sem from app.comp.res_but import ResultatsSemestreBUT from app.comp.res_compat import NotesTableCompat @@ -2281,13 +2281,7 @@ def formsemestre_validation_but( etudid=etudid, ) ) - if deca.code_valide and not read_only: - erase_span = f"""effacer décisions""" - else: - erase_span = "" + warning = "" if len(deca.niveaux_competences) != len(deca.decisions_rcue_by_niveau): warning += f"""
Attention: {len(deca.niveaux_competences)} @@ -2305,69 +2299,10 @@ def formsemestre_validation_but(
-
-
- Décision de jury pour l'année : { - _gen_but_select("code_annee", deca.codes, deca.code_valide, - disabled=True, klass="manual") - } - ({'non ' if deca.code_valide is None else ''}enregistrée) - {erase_span} -
-
{deca.explanation}
-
-
Niveaux de compétences et unités d'enseignement :
-
-
-
S{1}
-
S{2}
-
RCUE
""" ) - for niveau in deca.niveaux_competences: - H.append( - f"""
-
{niveau.competence.titre}
-
""" - ) - dec_rcue = deca.decisions_rcue_by_niveau.get(niveau.id) - if dec_rcue is None: - break - # Semestre impair - H.append( - _gen_but_niveau_ue( - dec_rcue.rcue.ue_1, - dec_rcue.rcue.moy_ue_1, - deca.decisions_ues[dec_rcue.rcue.ue_1.id], - disabled=read_only, - ) - ) - # Semestre pair - H.append( - _gen_but_niveau_ue( - dec_rcue.rcue.ue_2, - dec_rcue.rcue.moy_ue_2, - deca.decisions_ues[dec_rcue.rcue.ue_2.id], - disabled=read_only, - ) - ) - # RCUE - H.append( - f"""
-
{scu.fmt_note(dec_rcue.rcue.moy_rcue)}
-
{ - _gen_but_select("code_rcue_"+str(niveau.id), - dec_rcue.codes, - dec_rcue.code_valide, - disabled=True, klass="manual" - ) - }
-
""" - ) - H.append("
") # but_annee + H.append(jury_but_view.show_etud(deca, read_only=read_only)) if read_only: H.append( @@ -2389,39 +2324,36 @@ def formsemestre_validation_but(
""" ) + # --- Navigation + prev = f"""précédent + """ + next = f"""suivant + """ H.append( - f"""
-
- retour à la liste + f""" +
+ -
""" + + +
+ """ ) - # # --- Navigation - # prev = f"""précédent - # """ - # H.append( - # f""" - #
- # - # - # - #
""" - # ) - H.append("") # but_annee + H.append("") H.append( render_template( @@ -2436,48 +2368,6 @@ def formsemestre_validation_but( return "\n".join(H) + html_sco_header.sco_footer() -def _gen_but_select( - name: str, - codes: list[str], - code_valide: str, - disabled: bool = False, - klass: str = "", -) -> str: - "Le menu html select avec les codes" - h = "\n".join( - [ - f"""""" - for code in codes - ] - ) - return f""" - """ - - -def _gen_but_niveau_ue( - ue: UniteEns, moy_ue: float, dec_ue: jury_but.DecisionsProposeesUE, disabled=False -): - return f"""
-
{ue.acronyme}
-
{scu.fmt_note(moy_ue)}
-
{ - _gen_but_select("code_ue_"+str(ue.id), - dec_ue.codes, - dec_ue.code_valide, disabled=disabled - ) - }
-
""" - - @bp.route( "/formsemestre_validation_auto_but/", methods=["GET", "POST"] )