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=""): 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, avec UEs, matières et module,
et liens pour éditer si non verrouillée et permission. 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 current_user.has_permission(Permission.EditFormationTags) or has_perm_change
) )
if locked: 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: else:
lockicon = "" 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) formations: list[Formation] = Formation.query.filter_by(dept_id=g.scodoc_dept_id)
title = "Formations (programmes pédagogiques)" title = "Formations (programmes pédagogiques)"
lockicon = scu.icontag( 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( suppricon = scu.icontag(
"delete_small_img", border="0", alt="supprimer", title="Supprimer" "delete_small_img", border="0", alt="supprimer", title="Supprimer"

View File

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

View File

@ -573,7 +573,7 @@ def _open_workbook(filelike, dump_debug=False) -> Workbook:
log("Excel_to_list: failure to import document") log("Excel_to_list: failure to import document")
if dump_debug: if dump_debug:
dump_filename = "/tmp/last_scodoc_import_failure" + scu.XLSX_SUFFIX 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: with open(dump_filename, "wb") as f:
f.write(filelike) f.write(filelike)
raise ScoValueError( raise ScoValueError(

View File

@ -742,7 +742,13 @@ def formsemestre_recap_parcours_table(
else: else:
default_sem_info = "" default_sem_info = ""
if not formsemestre.etat: # locked 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 default_sem_info += lockicon
if ( if (
formsemestre.formation.formation_code formsemestre.formation.formation_code

View File

@ -308,11 +308,19 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
# 2ieme ligne: Semestre, Coef # 2ieme ligne: Semestre, Coef
H.append("""<tr><td class="fichetitre2">""") H.append("""<tr><td class="fichetitre2">""")
if formsemestre.semestre_id >= 0: if formsemestre.semestre_id >= 0:
H.append(f"""Semestre: </td><td>{formsemestre.semestre_id}""") H.append(f"""Semestre: </td><td>{formsemestre.semestre_id} """)
else: else:
H.append("""</td><td>""") H.append("""</td><td>""")
if sem_locked: 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">""") H.append("""</td><td class="fichetitre2">""")
if modimpl.module.is_apc(): if modimpl.module.is_apc():
H.append(_ue_coefs_html(modimpl)) 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">""") H.append("""<tr><td colspan="8">""")
if sem_locked: 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: elif can_edit_evals:
H.append( H.append(
f"""<div class="moduleimpl_evaluations_table_bot">{bot_table_links}</div>""" f"""<div class="moduleimpl_evaluations_table_bot">{bot_table_links}</div>"""
@ -732,6 +744,7 @@ def _ligne_evaluation(
etat_descr = "il manque des notes" etat_descr = "il manque des notes"
else: else:
etat_txt = "" etat_txt = ""
etat_descr = ""
if etat_txt: if etat_txt:
if can_edit_evals: if can_edit_evals:
etat_txt = f"""<a href="{ url_for("notes.evaluation_edit", etat_txt = f"""<a href="{ url_for("notes.evaluation_edit",

View File

@ -72,7 +72,13 @@ def _menu_scolarite(
""" """
locked = not formsemestre.etat locked = not formsemestre.etat
if locked: 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 return lockicon # no menu
if not authuser.has_permission( if not authuser.has_permission(
Permission.EtudInscrit Permission.EtudInscrit

View File

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

View File

@ -38,12 +38,12 @@
x="248.80879" x="248.80879"
y="264.35934" /></clipPath></defs> y="264.35934" /></clipPath></defs>
<path <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" 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" id="path1"
clip-path="url(#clipPath7)" clip-path="url(#clipPath7)"
transform="translate(-256,-278.42314)" /><path 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" 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" id="path2"
clip-path="url(#clipPath6)" 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}}) <h2>Formation {{formation.titre}} ({{formation.acronyme}})
[version {{formation.version}}] code {{formation.formation_code}} [version {{formation.version}}] code {{formation.formation_code}}
{% if read_only %} {% 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 %} {% endif %}
</h2> </h2>

View File

@ -16,6 +16,25 @@ table.listesems tr td.titresem {
font-weight: bold; font-weight: bold;
font-size: 110%; 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 { div.semlist {
padding-right: 8px; padding-right: 8px;
} }
@ -63,6 +82,11 @@ div#gtrcontent table.semlist tbody tr.css_MEXT td {
color: #fefcdf; color: #fefcdf;
} }
div#gtrcontent table.semlist tbody tr.selected td {
background-color: yellow;
font-weight: bold;
}
table.semlist tr td { table.semlist tr td {
border: none; border: none;
} }