affichage coefs UE dans bulles tableau bord semestre + qq typos

This commit is contained in:
Emmanuel Viennet 2021-12-10 15:27:52 +01:00
parent e5324e214c
commit 2f9b2a5a2d
3 changed files with 21 additions and 14 deletions

View File

@ -35,12 +35,12 @@ from flask import url_for
from flask_login import current_user from flask_login import current_user
from app import log from app import log
from app.models import Module
import app.scodoc.sco_utils as scu import app.scodoc.sco_utils as scu
from app.scodoc.sco_utils import ModuleType from app.scodoc.sco_utils import ModuleType
import app.scodoc.notesdb as ndb import app.scodoc.notesdb as ndb
from app.scodoc.sco_permissions import Permission from app.scodoc.sco_permissions import Permission
from app.scodoc.sco_exceptions import ScoValueError, ScoInvalidDateError from app.scodoc.sco_exceptions import ScoValueError, ScoInvalidDateError
import sco_version
from app.scodoc import html_sco_header from app.scodoc import html_sco_header
from app.scodoc import htmlutils from app.scodoc import htmlutils
from app.scodoc import sco_abs from app.scodoc import sco_abs
@ -63,6 +63,7 @@ from app.scodoc import sco_preferences
from app.scodoc import sco_users from app.scodoc import sco_users
from app.scodoc.gen_tables import GenTable from app.scodoc.gen_tables import GenTable
from app.scodoc.sco_formsemestre_custommenu import formsemestre_custommenu_html from app.scodoc.sco_formsemestre_custommenu import formsemestre_custommenu_html
import sco_version
def _build_menu_stats(formsemestre_id): def _build_menu_stats(formsemestre_id):
@ -1112,13 +1113,19 @@ def formsemestre_tableau_modules(
H = [] H = []
prev_ue_id = None prev_ue_id = None
for modimpl in modimpls: for modimpl in modimpls:
mod = modimpl["module"] # mod = modimpl["module"]
mod_descr = ( mod = Module.query.get(modimpl["module_id"])
"Module " mod_descr = "Module " + mod.titre
+ modimpl["module"]["titre"] if mod.is_apc():
+ ", coef. " coef_descr = ", ".join(
+ str(modimpl["module"]["coefficient"]) [f"{ue_acro}: {co}" for ue_acro, co in mod.ue_coefs_descr()]
) )
if coef_descr:
mod_descr += "coefs: " + coef_descr
else:
mod_descr += " (pas de coefficients) "
else:
mod_descr += ", coef. " + str(mod.coefficient)
mod_ens = sco_users.user_info(modimpl["responsable_id"])["nomcomplet"] mod_ens = sco_users.user_info(modimpl["responsable_id"])["nomcomplet"]
if modimpl["ens"]: if modimpl["ens"]:
mod_ens += " (resp.), " + ", ".join( mod_ens += " (resp.), " + ", ".join(
@ -1185,11 +1192,11 @@ def formsemestre_tableau_modules(
H.append( H.append(
'<td class="formsemestre_status_code"><a href="moduleimpl_status?moduleimpl_id=%s" title="%s" class="stdlink">%s</a></td>' '<td class="formsemestre_status_code"><a href="moduleimpl_status?moduleimpl_id=%s" title="%s" class="stdlink">%s</a></td>'
% (modimpl["moduleimpl_id"], mod_descr, mod["code"]) % (modimpl["moduleimpl_id"], mod_descr, mod.code)
) )
H.append( H.append(
'<td class="scotext"><a href="moduleimpl_status?moduleimpl_id=%s" title="%s" class="formsemestre_status_link">%s</a></td>' '<td class="scotext"><a href="moduleimpl_status?moduleimpl_id=%s" title="%s" class="formsemestre_status_link">%s</a></td>'
% (modimpl["moduleimpl_id"], mod_descr, mod["abbrev"] or mod["titre"]) % (modimpl["moduleimpl_id"], mod_descr, mod.abbrev or mod.titre)
) )
H.append('<td class="formsemestre_status_inscrits">%s</td>' % len(mod_inscrits)) H.append('<td class="formsemestre_status_inscrits">%s</td>' % len(mod_inscrits))
H.append( H.append(
@ -1201,7 +1208,7 @@ def formsemestre_tableau_modules(
) )
) )
if mod["module_type"] in ( if mod.module_type in (
ModuleType.STANDARD, ModuleType.STANDARD,
ModuleType.RESSOURCE, ModuleType.RESSOURCE,
ModuleType.SAE, ModuleType.SAE,
@ -1227,7 +1234,7 @@ def formsemestre_tableau_modules(
' <span><a class="redlink" href="moduleimpl_status?moduleimpl_id=%s" title="Il y a des notes en attente">[en attente]</a></span>' ' <span><a class="redlink" href="moduleimpl_status?moduleimpl_id=%s" title="Il y a des notes en attente">[en attente]</a></span>'
% modimpl["moduleimpl_id"] % modimpl["moduleimpl_id"]
) )
elif mod["module_type"] == ModuleType.MALUS: elif mod.module_type == ModuleType.MALUS:
nb_malus_notes = sum( nb_malus_notes = sum(
[ [
e["etat"]["nb_notes"] e["etat"]["nb_notes"]

View File

@ -48,7 +48,7 @@
{% if editable %} {% if editable %}
<ul> <ul>
<li class="notes_ue_list notes_ue_list_add"><a class="stdlink" href="{{ <li class="notes_ue_list notes_ue_list_add"><a class="stdlink" href="{{
url_for("notes.ue_create", url_for('notes.ue_create',
scodoc_dept=g.scodoc_dept, scodoc_dept=g.scodoc_dept,
formation_id=formation.id, formation_id=formation.id,
)}}" )}}"

View File

@ -51,7 +51,7 @@
</ul> </ul>
<ul> <ul>
<li><a href="url_for('notes.ue_edit', scodoc_dept=g.scodoc_dept, ue_id=ue.id)" <li><a href="{{url_for('notes.ue_edit', scodoc_dept=g.scodoc_dept, ue_id=ue.id)}}"
>modifier cette UE</a> >modifier cette UE</a>
</li> </li>
<li><a href="{{url_for("notes.ue_table", <li><a href="{{url_for("notes.ue_table",