forked from ScoDoc/ScoDoc
Ajout explications sur états justificatifs + rename sco_archives_formsemestre.py
This commit is contained in:
parent
4d513bf318
commit
e8be809dff
@ -503,6 +503,7 @@ class Justificatif(ScoDocModel):
|
||||
archiver: JustificatifArchiver = JustificatifArchiver()
|
||||
filenames = archiver.list_justificatifs(archive_name, self.etudiant)
|
||||
accessible_filenames = []
|
||||
#
|
||||
for filename in filenames:
|
||||
if int(filename[1]) == current_user.id or current_user.has_permission(
|
||||
Permission.AbsJustifView
|
||||
|
@ -16,7 +16,9 @@ from app import log
|
||||
|
||||
|
||||
class Trace:
|
||||
"""gestionnaire de la trace des fichiers justificatifs"""
|
||||
"""gestionnaire de la trace des fichiers justificatifs
|
||||
XXX TODO à documenter: rôle et format des fichier strace
|
||||
"""
|
||||
|
||||
def __init__(self, path: str) -> None:
|
||||
self.path: str = path + "/_trace.csv"
|
||||
@ -205,6 +207,7 @@ class JustificatifArchiver(BaseArchiver):
|
||||
) -> list[tuple[str, int]]:
|
||||
"""
|
||||
Retourne la liste des noms de fichiers dans l'archive donnée
|
||||
avec l'uid de l'utilisateur ayant saisi le fichier.
|
||||
"""
|
||||
filenames: list[str] = []
|
||||
archive_id = self.get_id_from_name(etud.id, archive_name, dept_id=etud.dept_id)
|
||||
@ -212,9 +215,8 @@ class JustificatifArchiver(BaseArchiver):
|
||||
filenames = self.list_archive(archive_id, dept_id=etud.dept_id)
|
||||
trace: Trace = Trace(archive_id)
|
||||
traced = trace.get_trace(filenames)
|
||||
retour = [(key, value[2]) for key, value in traced.items()]
|
||||
|
||||
return retour
|
||||
return [(key, value[2]) for key, value in traced.items()]
|
||||
|
||||
def get_justificatif_file(self, archive_name: str, etud: Identite, filename: str):
|
||||
"""
|
||||
|
@ -56,12 +56,11 @@ from app.scodoc.sco_utils import ModuleType
|
||||
from app.scodoc.sco_permissions import Permission
|
||||
from app.scodoc.sco_exceptions import (
|
||||
ScoValueError,
|
||||
ScoInvalidDateError,
|
||||
ScoInvalidIdType,
|
||||
)
|
||||
from app.scodoc import html_sco_header
|
||||
from app.scodoc import htmlutils
|
||||
from app.scodoc import sco_archives
|
||||
from app.scodoc import sco_archives_formsemestre
|
||||
from app.scodoc import sco_bulletins
|
||||
from app.scodoc import codes_cursus
|
||||
from app.scodoc import sco_compute_moy
|
||||
@ -454,7 +453,9 @@ def formsemestre_status_menubar(formsemestre: FormSemestre) -> str:
|
||||
"title": "Documents archivés",
|
||||
"endpoint": "notes.formsemestre_list_archives",
|
||||
"args": {"formsemestre_id": formsemestre_id},
|
||||
"enabled": sco_archives.PV_ARCHIVER.list_obj_archives(formsemestre_id),
|
||||
"enabled": sco_archives_formsemestre.PV_ARCHIVER.list_obj_archives(
|
||||
formsemestre_id
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
--color-justi-clair: #48f6ff;
|
||||
--color-justi-attente: yellow;
|
||||
--color-justi-attente-stripe: #29b990; /* pink #fa25cb; */ /* #789dbb;*/
|
||||
--color-justi-modifie: rgb(255, 230, 0);
|
||||
--color-justi-invalide: #a84476;
|
||||
--color-nonwork: #badfff;
|
||||
|
||||
@ -694,6 +695,9 @@ tr.row-justificatif.valide td.assi-type {
|
||||
tr.row-justificatif.attente td.assi-type {
|
||||
background-color: var(--color-justi-attente);
|
||||
}
|
||||
tr.row-justificatif.modifie td.assi-type {
|
||||
background-color: var(--color-justi-modifie);
|
||||
}
|
||||
tr.row-justificatif.non_valide td.assi-type {
|
||||
background-color: var(--color-justi-invalide);
|
||||
}
|
||||
|
59
app/templates/assiduites/explication_etats_justifs.j2
Normal file
59
app/templates/assiduites/explication_etats_justifs.j2
Normal file
@ -0,0 +1,59 @@
|
||||
{# Explication des états des justificatifs #}
|
||||
|
||||
<div class="explication-etats-justifs">
|
||||
|
||||
<div class="valide">Justificatif valide</div>
|
||||
<div class="legend">ayant été considéré comme valide, justifie les absences
|
||||
ou retards de la période
|
||||
</div>
|
||||
|
||||
<div class="attente">Justificatif soumis</div>
|
||||
<div class="legend">en attente de validation. Les absences ne sont pas
|
||||
encore considérées comme justifiées.
|
||||
</div>
|
||||
|
||||
<div class="modifie">Justificatif modifié</div>
|
||||
<div class="legend">une information a été ajoutée ou modifiée. Doit être validé avant
|
||||
d'être pris en en compte.
|
||||
</div>
|
||||
|
||||
<div class="invalide">Justificatif invalide</div>
|
||||
<div class="legend">proposé mais considéré comme non valide.
|
||||
Les absences ne sont pas justifiées.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.explication-etats-justifs {
|
||||
margin-top: 32px;
|
||||
margin-left: 12px;
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
.explication-etats-justifs > div {
|
||||
margin-bottom: 8px;
|
||||
margin-right: 8px;
|
||||
padding: 6px;
|
||||
}
|
||||
.explication-etats-justifs div.legend {
|
||||
font-style: italic;
|
||||
}
|
||||
.valide {
|
||||
background-color: var(--color-justi);
|
||||
}
|
||||
|
||||
.attente {
|
||||
background-color: var(--color-justi-attente);
|
||||
}
|
||||
.modifie {
|
||||
background-color: var(--color-justi-modifie);
|
||||
}
|
||||
.invalide {
|
||||
background-color: var(--color-justi-invalide);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
@ -120,6 +120,8 @@ div.submit > input {
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include "assiduites/explication_etats_justifs.j2" %}
|
||||
|
||||
{% endblock app_content %}
|
||||
|
||||
{% block scripts %}
|
||||
|
@ -4,4 +4,7 @@
|
||||
<h2>Liste de l'assiduité et des justificatifs de {{sco.etud.html_link_fiche()|safe}}</h2>
|
||||
{{tableau | safe }}
|
||||
</div>
|
||||
|
||||
{% include "assiduites/explication_etats_justifs.j2" %}
|
||||
|
||||
{% endblock app_content %}
|
||||
|
@ -103,7 +103,7 @@ from app.scodoc import html_sco_header
|
||||
from app.pe import pe_view
|
||||
from app.scodoc import sco_apogee_compare
|
||||
from app.scodoc import sco_archives
|
||||
from app.scodoc import sco_archive_formsemestre
|
||||
from app.scodoc import sco_archives_formsemestre
|
||||
from app.scodoc import sco_assiduites
|
||||
from app.scodoc import sco_bulletins
|
||||
from app.scodoc import sco_bulletins_pdf
|
||||
@ -2973,24 +2973,24 @@ sco_publish(
|
||||
)
|
||||
sco_publish(
|
||||
"/formsemestre_archive",
|
||||
sco_archive_formsemestre.formsemestre_archive,
|
||||
sco_archives_formsemestre.formsemestre_archive,
|
||||
Permission.ScoView,
|
||||
methods=["GET", "POST"],
|
||||
)
|
||||
sco_publish(
|
||||
"/formsemestre_delete_archive",
|
||||
sco_archive_formsemestre.formsemestre_delete_archive,
|
||||
sco_archives_formsemestre.formsemestre_delete_archive,
|
||||
Permission.ScoView,
|
||||
methods=["GET", "POST"],
|
||||
)
|
||||
sco_publish(
|
||||
"/formsemestre_list_archives",
|
||||
sco_archive_formsemestre.formsemestre_list_archives,
|
||||
sco_archives_formsemestre.formsemestre_list_archives,
|
||||
Permission.ScoView,
|
||||
)
|
||||
sco_publish(
|
||||
"/formsemestre_get_archived_file",
|
||||
sco_archive_formsemestre.formsemestre_get_archived_file,
|
||||
sco_archives_formsemestre.formsemestre_get_archived_file,
|
||||
Permission.ScoView,
|
||||
)
|
||||
sco_publish("/view_apo_csv", sco_etape_apogee_view.view_apo_csv, Permission.EditApogee)
|
||||
|
@ -10,7 +10,7 @@ from tests.unit import yaml_setup, call_view
|
||||
import app
|
||||
from app.models import Formation, FormSemestre
|
||||
from app.scodoc import (
|
||||
sco_archive_formsemestre,
|
||||
sco_archives_formsemestre,
|
||||
sco_cost_formation,
|
||||
sco_debouche,
|
||||
sco_edit_ue,
|
||||
@ -182,8 +182,8 @@ def test_formsemestre_misc_views(test_client):
|
||||
assert isinstance(ans, Response)
|
||||
assert ans.status == "200 OK"
|
||||
assert ans.mimetype == scu.JSON_MIMETYPE
|
||||
ans = sco_archive_formsemestre.formsemestre_archive(formsemestre.id)
|
||||
ans = sco_archive_formsemestre.formsemestre_list_archives(formsemestre.id)
|
||||
ans = sco_archives_formsemestre.formsemestre_archive(formsemestre.id)
|
||||
ans = sco_archives_formsemestre.formsemestre_list_archives(formsemestre.id)
|
||||
|
||||
# ----- MENU STATISTIQUES
|
||||
ans = sco_report.formsemestre_report_counts(formsemestre.id)
|
||||
|
Loading…
Reference in New Issue
Block a user