Modif. icons lock/unlock

This commit is contained in:
Emmanuel Viennet 2025-01-14 01:15:40 +01:00
parent 388992961a
commit d6895bba8a
11 changed files with 87 additions and 16 deletions

View File

@ -617,7 +617,7 @@ def ue_delete(ue_id=None, delete_validations=False, dialog_confirmed=False):
def ue_table(formation_id=None, semestre_idx=1, msg=""):
"""Page affiochage ou édition d'une formation
"""Page affichage ou édition d'une formation
avec UEs, matières et module,
et liens pour éditer si non verrouillée et permission.
"""
@ -690,7 +690,13 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""):
current_user.has_permission(Permission.EditFormationTags) or has_perm_change
)
if locked:
lockicon = scu.icontag("lock32_img", title="verrouillé")
lockicon = scu.icontag(
"lock_25",
file_format="svg",
border="0",
height="20px",
title="Semestre verrouillé",
)
else:
lockicon = ""

View File

@ -483,7 +483,11 @@ def formation_list_table(detail: bool) -> GenTable:
formations: list[Formation] = Formation.query.filter_by(dept_id=g.scodoc_dept_id)
title = "Formations (programmes pédagogiques)"
lockicon = scu.icontag(
"lock32_img", title="Comporte des semestres verrouillés", border="0"
"lock_25",
file_format="svg",
border="0",
height="20px",
title="Comporte des semestres verrouillés",
)
suppricon = scu.icontag(
"delete_small_img", border="0", alt="supprimer", title="Supprimer"

View File

@ -120,11 +120,21 @@ def _convert_formsemestres_to_dicts(
emptygroupicon = scu.icontag(
"emptygroupicon_img", title="Pas d'inscrits", border="0"
)
lockicon = scu.icontag("lock32_img", title="verrouillé", border="0")
lockicon = scu.icontag(
"lock_25", file_format="svg", border="0", height="20px", title="verrouillé"
)
openlockicon = scu.icontag(
"lock_25_open",
file_format="svg",
border="0",
height="20px",
title="verrouillé",
)
else:
groupicon = "X"
emptygroupicon = ""
lockicon = "X"
openlockicon = ""
# génère liste de dict
sems = []
formsemestre: FormSemestre
@ -149,7 +159,7 @@ def _convert_formsemestres_to_dicts(
),
"formsemestre_id": formsemestre.id,
"groupicon": groupicon if nb_inscrits > 0 else emptygroupicon,
"lockimg": "" if formsemestre.etat else lockicon,
"lockimg": openlockicon if formsemestre.etat else lockicon,
"modalite": formsemestre.modalite,
"mois_debut": formsemestre.mois_debut(),
"mois_fin": formsemestre.mois_fin(),
@ -159,6 +169,7 @@ def _convert_formsemestres_to_dicts(
"session_id": formsemestre.session_id(),
"titre_num": formsemestre.titre_num(),
"tmpcode": (f"<td><tt>{formsemestre.id}</tt></td>" if showcodes else ""),
"_tr_attrs": f"data-formsemestre_id={formsemestre.id}",
}
sems.append(sem)
return sems

View File

@ -573,7 +573,7 @@ def _open_workbook(filelike, dump_debug=False) -> Workbook:
log("Excel_to_list: failure to import document")
if dump_debug:
dump_filename = "/tmp/last_scodoc_import_failure" + scu.XLSX_SUFFIX
log(f"Dumping problemetic file on {dump_filename}")
log(f"Dumping problematic file on {dump_filename}")
with open(dump_filename, "wb") as f:
f.write(filelike)
raise ScoValueError(

View File

@ -742,7 +742,13 @@ def formsemestre_recap_parcours_table(
else:
default_sem_info = ""
if not formsemestre.etat: # locked
lockicon = scu.icontag("lock32_img", title="verrouillé", border="0")
lockicon = scu.icontag(
"lock_25",
file_format="svg",
border="0",
height="20px",
title="verrouillé",
)
default_sem_info += lockicon
if (
formsemestre.formation.formation_code

View File

@ -308,11 +308,19 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
# 2ieme ligne: Semestre, Coef
H.append("""<tr><td class="fichetitre2">""")
if formsemestre.semestre_id >= 0:
H.append(f"""Semestre: </td><td>{formsemestre.semestre_id}""")
H.append(f"""Semestre: </td><td>{formsemestre.semestre_id} """)
else:
H.append("""</td><td>""")
if sem_locked:
H.append(scu.icontag("lock32_img", title="verrouillé"))
H.append(
scu.icontag(
"lock_25",
file_format="svg",
border="0",
height="20px",
title="verrouillé",
)
)
H.append("""</td><td class="fichetitre2">""")
if modimpl.module.is_apc():
H.append(_ue_coefs_html(modimpl))
@ -534,7 +542,11 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
#
H.append("""<tr><td colspan="8">""")
if sem_locked:
H.append(f"""{scu.icontag("lock32_img")} semestre verrouillé""")
H.append(
f"""{scu.icontag(
"lock_25", file_format="svg", border="0", height="20px", title="verrouillé"
)} semestre verrouillé"""
)
elif can_edit_evals:
H.append(
f"""<div class="moduleimpl_evaluations_table_bot">{bot_table_links}</div>"""
@ -732,6 +744,7 @@ def _ligne_evaluation(
etat_descr = "il manque des notes"
else:
etat_txt = ""
etat_descr = ""
if etat_txt:
if can_edit_evals:
etat_txt = f"""<a href="{ url_for("notes.evaluation_edit",

View File

@ -72,7 +72,13 @@ def _menu_scolarite(
"""
locked = not formsemestre.etat
if locked:
lockicon = scu.icontag("lock32_img", title="verrouillé", border="0")
lockicon = scu.icontag(
"lock_25",
file_format="svg",
border="0",
height="20px",
title="Semestre verrouillé",
)
return lockicon # no menu
if not authuser.has_permission(
Permission.EtudInscrit

View File

@ -1690,8 +1690,7 @@ def confirm_dialog(
H.append('<p class="help">' + help_msg + "</p>")
if add_headers:
return render_template(template, content="\n".join(H))
else:
return "\n".join(H)
return "\n".join(H)
def objects_renumber(db, obj_list) -> None:

View File

@ -38,12 +38,12 @@
x="248.80879"
y="264.35934" /></clipPath></defs>
<path
style="fill:#cfd8dd"
style="fill:#666666"
d="m 533.44444,997.90814 v -342.348 c 0,-142.441 116.537,-260.838 258.978,-260.647 142.446,0.191 257.39976,116.13869 258.27496,258.625 l 1.8054,293.92884 c 0.1976,32.1664 66.6107,-190.12414 56.4386,-159.60784 l -46.6516,139.95495 c -10.1721,30.51629 104.8956,63.33866 104.8956,31.17166 V 653.53814 c 0,-50.614 -9.926,-99.746 -29.502,-146.029 -18.896,-44.675 -45.935,-84.785 -80.366,-119.217 -34.432,-34.431 -74.54196,-61.471 -119.21696,-80.366 -46.283,-19.577 -95.415,-29.503 -146.029,-29.503 -50.615,0 -99.746,9.926 -146.03,29.503 -44.675,18.896 -84.786,45.935 -119.217,80.366 -34.43,34.43 -61.469,74.541 -80.366,119.217 -19.576,46.283 -29.503,95.414 -29.503,146.029 v 344.371 h 116.489 z"
id="path1"
clip-path="url(#clipPath7)"
transform="translate(-256,-278.42314)" /><path
style="fill:#f7e07f"
style="fill:#f09b15;fill-opacity:1"
d="M 1270.286,1734.865 H 296 c -22.091,0 -40,-17.909 -40,-40 v -725.47 c 0,-22.091 17.909,-40 40,-40 h 974.286 c 22.091,0 40,17.909 40,40 v 725.47 c 0,22.092 -17.909,40 -40,40 z"
id="path2"
clip-path="url(#clipPath6)"

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -11,7 +11,9 @@
<h2>Formation {{formation.titre}} ({{formation.acronyme}})
[version {{formation.version}}] code {{formation.formation_code}}
{% if read_only %}
{{scu.icontag("lock32_img", title="verrouillé")|safe}}
{{scu.icontag(
"lock_25", file_format="svg", border="0", height="20px", title="verrouillé"
)|safe}}
{% endif %}
</h2>

View File

@ -16,6 +16,25 @@ table.listesems tr td.titresem {
font-weight: bold;
font-size: 110%;
}
td.lockimg {
text-align: center;
}
a.disabled-link {
pointer-events: none;
color: gray;
text-decoration: none;
cursor: not-allowed;
}
#formsemestres-select-infos {
margin-left: 16px;
color: purple;
font-weight: normal;
}
#formsemestres-select-infos a {
margin-left: 8px;
text-decoration: underline;
}
div.semlist {
padding-right: 8px;
}
@ -63,6 +82,11 @@ div#gtrcontent table.semlist tbody tr.css_MEXT td {
color: #fefcdf;
}
div#gtrcontent table.semlist tbody tr.selected td {
background-color: yellow;
font-weight: bold;
}
table.semlist tr td {
border: none;
}