diff --git a/app/scodoc/sco_moduleimpl_status.py b/app/scodoc/sco_moduleimpl_status.py index 5bce46078..41daf04d9 100644 --- a/app/scodoc/sco_moduleimpl_status.py +++ b/app/scodoc/sco_moduleimpl_status.py @@ -155,6 +155,31 @@ def moduleimpl_evaluation_menu(evaluation_id, nbnotes=0): return htmlutils.make_menu("actions", menuEval, alone=True) +def _ue_coefs_html(coefs_descr) -> str: + """ """ + max_coef = max([x[1] for x in coefs_descr]) + H = """ +
+
Coefficients vers les UE
+ """ + if coefs_descr: + H += f""" +
+ """ + "\n".join( + [ + f"""
{coef}
{ue_acronyme}
""" + for ue_acronyme, coef in coefs_descr + ] + ) + else: + H += """
non définis""" + H += """ +
+
+ """ + return H + + def moduleimpl_status(moduleimpl_id=None, partition_id=None): """Tableau de bord module (liste des evaluations etc)""" modimpl = ModuleImpl.query.get_or_404(moduleimpl_id) @@ -226,16 +251,11 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None): H.append("""""") if not sem["etat"]: H.append(scu.icontag("lock32_img", title="verrouillé")) - H.append("""Coef. dans le semestre: """) + H.append("""""") if modimpl.module.is_apc(): - coefs_descr = modimpl.module.ue_coefs_descr() - if coefs_descr: - coefs_descr_txt = ", ".join(["%s: %s" % x for x in coefs_descr]) - else: - coefs_descr_txt = """non définis""" - H.append(coefs_descr_txt) + H.append(_ue_coefs_html(modimpl.module.ue_coefs_descr())) else: - H.append(f"{modimpl.module.coefficient}") + H.append(f"Coef. dans le semestre: {modimpl.module.coefficient}") H.append("""""") # 3ieme ligne: Formation H.append( diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index afa6fe303..d7b8db211 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -1291,6 +1291,29 @@ div.moduleimpl_type_ressource { background-color:#f5e9d2; } +div#modimpl_coefs { + position: absolute; +} +.coefs_histo{ + height: 32px; + display: flex; + gap: 4px; + color: rgb(0, 0, 0); + text-align: center; + align-items: flex-end; + font-weight: normal; + font-size: 60%; +} +.coefs_histo>div{ + background: #09c; + box-sizing: border-box; + padding: 4px; + height: calc(100% * var(--coef) / var(--max)); +} +.coefs_histo>div:nth-child(odd){ + background-color: #9c0; +} + span.moduleimpl_abs_link { padding-right: 2em; }