From 630ecac026695e2daf7e252f06925f89bd84fefb Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 24 Dec 2022 21:35:18 -0300 Subject: [PATCH] =?UTF-8?q?Jury=20BUT:=20compl=C3=A8te=20logs=20=C3=A9tudi?= =?UTF-8?q?ants.=20+=20cosmetic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/jury_but.py | 25 +++++++++++++++---- app/but/jury_but_view.py | 9 ++++--- app/models/but_validations.py | 5 ++++ app/models/validations.py | 6 +++-- app/scodoc/sco_formsemestre_validation.py | 8 +++--- app/static/css/jury_but.css | 11 ++++---- .../but/documentation_codes_jury.html | 2 +- 7 files changed, 46 insertions(+), 20 deletions(-) diff --git a/app/but/jury_but.py b/app/but/jury_but.py index 42b65372..f994544b 100644 --- a/app/but/jury_but.py +++ b/app/but/jury_but.py @@ -356,9 +356,9 @@ class DecisionsProposeesAnnee(DecisionsProposees): dec_ue.compute_codes() # Reste à attribuer ADM, ADJ, PASD, PAS1NCI, RED, NAR - expl_rcues = ( - f"{self.nb_validables} niveau validable(s) sur {self.nb_competences}" - ) + plural = self.nb_validables > 1 + expl_rcues = f"""{self.nb_validables} niveau{"x" if plural else ""} validable{ + "s" if plural else ""} sur {self.nb_competences}""" if self.admis: self.codes = [sco_codes.ADM] + self.codes self.explanation = expl_rcues @@ -778,6 +778,11 @@ class DecisionsProposeesAnnee(DecisionsProposees): ordre=self.annee_but, ) for validation in validations: + Scolog.logdb( + "jury_but", + etudid=self.etud.id, + msg=f"Validation année BUT{self.annee_but}: effacée", + ) db.session.delete(validation) db.session.flush() self.invalidate_formsemestre_cache() @@ -933,7 +938,7 @@ class DecisionsProposeesRCUE(DecisionsProposees): Scolog.logdb( method="jury_but", etudid=self.etud.id, - msg=f"Validation RCUE {repr(self.rcue)}", + msg=f"Validation {self.rcue}: {code}", ) db.session.add(self.validation) if self.rcue.formsemestre_1 is not None: @@ -1088,6 +1093,11 @@ class DecisionsProposeesUE(DecisionsProposees): self.erase() if code is None: self.validation = None + Scolog.logdb( + method="jury_but", + etudid=self.etud.id, + msg=f"Validation UE {self.ue.id} {self.ue.acronyme}: effacée", + ) else: self.validation = ScolarFormSemestreValidation( etudid=self.etud.id, @@ -1099,7 +1109,7 @@ class DecisionsProposeesUE(DecisionsProposees): Scolog.logdb( method="jury_but", etudid=self.etud.id, - msg=f"Validation UE {self.ue.id}", + msg=f"Validation UE {self.ue.id} {self.ue.acronyme}({self.moy_ue}): {code}", ) db.session.add(self.validation) log(f"DecisionsProposeesUE: recording {self.validation}") @@ -1115,6 +1125,11 @@ class DecisionsProposeesUE(DecisionsProposees): ) for validation in validations: log(f"DecisionsProposeesUE: deleting {validation}") + Scolog.logdb( + method="jury_but", + etudid=self.etud.id, + msg=f"Validation UE {validation.ue.id} {validation.ue.acronyme}: effacée", + ) db.session.delete(validation) db.session.flush() diff --git a/app/but/jury_but_view.py b/app/but/jury_but_view.py index a3c0dc0a..9d3b9d2a 100644 --- a/app/but/jury_but_view.py +++ b/app/but/jury_but_view.py @@ -61,11 +61,12 @@ def show_etud(deca: DecisionsProposeesAnnee, read_only: bool = True) -> str: ({'non ' if deca.code_valide is None else ''}enregistrée) {erase_span} -
{deca.explanation}
""" ) + div_explanation = f"""
{deca.explanation}
""" else: H.append("""
Pas de décision annuelle (sem. impair).
""") + div_explanation = "" H.append("""""") formsemestre_1 = deca.formsemestre_impair @@ -80,8 +81,10 @@ def show_etud(deca: DecisionsProposeesAnnee, read_only: bool = True) -> str: formsemestre_1, formsemestre_2 = formsemestre_2, formsemestre_1 H.append( f""" -
Niveaux de compétences et unités d'enseignement du BUT{ - deca.annee_but}
+
+ Niveaux de compétences et unités d'enseignement du BUT{deca.annee_but} +
+ {div_explanation}
{"S" +str(formsemestre_1.semestre_id) diff --git a/app/models/but_validations.py b/app/models/but_validations.py index 7e729a96..ad191d29 100644 --- a/app/models/but_validations.py +++ b/app/models/but_validations.py @@ -145,6 +145,11 @@ class RegroupementCoherentUE: self.ue_1.acronyme}({self.moy_ue_1}) { self.ue_2.acronyme}({self.moy_ue_2})>""" + def __str__(self) -> str: + return f"""RCUE { + self.ue_1.acronyme}({self.moy_ue_1}) + { + self.ue_2.acronyme}({self.moy_ue_2})""" + def query_validations( self, ) -> flask_sqlalchemy.BaseQuery: # list[ApcValidationRCUE] diff --git a/app/models/validations.py b/app/models/validations.py index 545b7863..5998ccd7 100644 --- a/app/models/validations.py +++ b/app/models/validations.py @@ -116,7 +116,9 @@ class ScolarAutorisationInscription(db.Model): semestre_id=semestre_id, ) db.session.add(autorisation) - Scolog.logdb("autorise_etud", etudid=etudid, msg=f"passage vers S{semestre_id}") + Scolog.logdb( + "autorise_etud", etudid=etudid, msg=f"Passage vers S{semestre_id}: autorisé" + ) @classmethod def delete_autorisation_etud( @@ -133,7 +135,7 @@ class ScolarAutorisationInscription(db.Model): Scolog.logdb( "autorise_etud", etudid=etudid, - msg=f"annule passage vers S{autorisation.semestre_id}", + msg=f"Passage vers S{autorisation.semestre_id}: effacé", ) db.session.flush() diff --git a/app/scodoc/sco_formsemestre_validation.py b/app/scodoc/sco_formsemestre_validation.py index b94db987..2a8e226f 100644 --- a/app/scodoc/sco_formsemestre_validation.py +++ b/app/scodoc/sco_formsemestre_validation.py @@ -39,7 +39,7 @@ from app import db, log from app.comp import res_sem from app.comp.res_compat import NotesTableCompat -from app.models import FormSemestre +from app.models import FormSemestre, UniteEns from app.models.notes import etud_has_notes_attente from app.models.validations import ( ScolarAutorisationInscription, @@ -1171,8 +1171,8 @@ def do_formsemestre_validate_previous_ue( """ formsemestre = FormSemestre.query.get_or_404(formsemestre_id) nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre) + ue: UniteEns = UniteEns.query.get_or_404(ue_id) - sem = sco_formsemestre.get_formsemestre(formsemestre_id) cnx = ndb.GetDBConnexion() if ue_coefficient != None: sco_formsemestre.do_formsemestre_uecoef_edit_or_create( @@ -1197,10 +1197,10 @@ def do_formsemestre_validate_previous_ue( cnx, method="formsemestre_validate_previous_ue", etudid=etudid, - msg="Validation UE %s" % ue_id, + msg=f"Validation UE prec. {ue_id} {ue.acronyme}: {code}", commit=False, ) - _invalidate_etud_formation_caches(etudid, sem["formation_id"]) + _invalidate_etud_formation_caches(etudid, formsemestre.formation_id) cnx.commit() diff --git a/app/static/css/jury_but.css b/app/static/css/jury_but.css index 8efa4a61..d8e84425 100644 --- a/app/static/css/jury_but.css +++ b/app/static/css/jury_but.css @@ -1,18 +1,17 @@ /* Saisie décision de jury BUT */ -.jury_but form { +.jury_but { font-family: Verdana, Geneva, Tahoma, sans-serif; } -.jury_but .titre_parcours { +.jury_but .titre_parcours, +.jury_but .nom_etud { font-size: 130%; padding-bottom: 12px; } .jury_but .nom_etud { - font-size: 100%; font-weight: bold; - padding-bottom: 12px; } .but_annee { @@ -111,7 +110,9 @@ div.but_settings { .but_explanation { color: blueviolet; font-style: italic; - padding-top: 12px; + padding-top: 4px; + padding-bottom: 12px; + ; } select:disabled { diff --git a/app/templates/but/documentation_codes_jury.html b/app/templates/but/documentation_codes_jury.html index abd3a742..bde91be3 100644 --- a/app/templates/but/documentation_codes_jury.html +++ b/app/templates/but/documentation_codes_jury.html @@ -2,7 +2,7 @@

Ci-dessous la signification de chaque code est expliquée, ainsi que la correspondance avec certains codes préconisés par l'AMUE et l'ADIUT pour Apogée. - +
On distingue les codes ScoDoc (utilisés ci-dessus et dans les différentes tables générées par ScoDoc) et leur transcription vers Apogée lors des exports (transcription paramétrable par votre administrateur ScoDoc).