Add col. version in refcomp table

This commit is contained in:
Emmanuel Viennet 2022-12-02 23:02:42 +01:00 committed by iziram
parent 8ef19b14c7
commit acb8e6aab2

View File

@ -73,7 +73,7 @@ def refcomp_delete(refcomp_id):
def refcomp_table(): def refcomp_table():
"""Liste html des ref. comp. chargés dans ce département""" """Liste html des ref. comp. chargés dans ce département"""
refs = ApcReferentielCompetences.query.filter_by(dept_id=g.scodoc_dept_id) refs = ApcReferentielCompetences.query.filter_by(dept_id=g.scodoc_dept_id)
columns_ids = ("type_titre", "specialite_long", "json", "nb_formations") columns_ids = ("type_titre", "specialite_long", "version", "json", "nb_formations")
if current_user.has_permission(Permission.ScoChangeFormation): if current_user.has_permission(Permission.ScoChangeFormation):
columns_ids = ("suppr",) + columns_ids columns_ids = ("suppr",) + columns_ids
suppr_icon = scu.icontag( suppr_icon = scu.icontag(
@ -85,6 +85,7 @@ def refcomp_table():
"suppr": "", "suppr": "",
"type_titre": "Type", "type_titre": "Type",
"specialite_long": "Spécialité", "specialite_long": "Spécialité",
"version": "Version",
"json": "Export", "json": "Export",
"nb_formations": "Formations", "nb_formations": "Formations",
}, },
@ -95,6 +96,7 @@ def refcomp_table():
"_specialite_long_target": url_for( "_specialite_long_target": url_for(
"notes.refcomp_show", scodoc_dept=g.scodoc_dept, refcomp_id=ref.id "notes.refcomp_show", scodoc_dept=g.scodoc_dept, refcomp_id=ref.id
), ),
"version": ref.get_version(),
"json": "json", "json": "json",
"_json_target": url_for( "_json_target": url_for(
"notes.refcomp", scodoc_dept=g.scodoc_dept, refcomp_id=ref.id "notes.refcomp", scodoc_dept=g.scodoc_dept, refcomp_id=ref.id