Améliore présentation bilan ECTS + fix bug but_ects_valides si pas d'ECTS

This commit is contained in:
Emmanuel Viennet 2024-07-10 09:47:40 +02:00
parent 6ae433aa61
commit 45ec03ec11
4 changed files with 19 additions and 7 deletions

View File

@ -399,7 +399,7 @@ def but_ects_valides(
for v in validations:
key = (v.ue.semestre_idx, v.ue.niveau_competence.id)
if v.code in CODES_UE_VALIDES:
ects_dict[key] = v.ue.ects
ects_dict[key] = v.ue.ects or 0.0
return int(sum(ects_dict.values())) if ects_dict else 0
@ -417,15 +417,18 @@ def but_validations_ues(
validations = (
ScolarFormSemestreValidation.query.filter_by(etudid=etud.id)
.filter(ScolarFormSemestreValidation.ue_id != None)
.join(FormSemestre, ScolarFormSemestreValidation.formsemestre)
.join(UniteEns)
.join(ApcNiveau)
)
# restreint à certaines années (utile pour les ECTS du DUT120)
if annees_but:
validations = validations.filter(ApcNiveau.annee.in_(annees_but))
# Et restreint au référentiel de compétence:
return validations.join(ApcCompetence).filter_by(
referentiel_id=referentiel_competence_id
# restreint au référentiel de compétence et trie
return (
validations.join(ApcCompetence)
.filter_by(referentiel_id=referentiel_competence_id)
.order_by(FormSemestre.semestre_id, UniteEns.numero, UniteEns.acronyme)
)

View File

@ -13,6 +13,11 @@ div.ue_list_etud_validations ul.liste_validations li {
div.ue_list_etud_validations div.total_ects {
font-weight: bold;
margin-top: 16px;
margin-top: 24px;
margin-bottom: 12px;
}
div.ue_list_etud_validations ul li.new_semestre,
div.ue_list_etud_validations ul li:first-child {
margin-top: 16px;
}

View File

@ -8,7 +8,11 @@
<ul class="liste_validations">
{% for validation in validations %}
<li>{{ validation.html() | safe }}
<li
{% if loop.index0 > 0 and validation.formsemestre and loop.previtem.formsemestre.semestre_id != validation.formsemestre.semestre_id %}
class="new_semestre"
{% endif %}
>{{ validation.html() | safe }}
{% if edit_mode %}
{% if validation.formsemestre and validation.formsemestre.can_edit_jury() %}
<form class="inline-form">

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.6.990"
SCOVERSION = "9.7.0"
SCONAME = "ScoDoc"