forked from ScoDoc/ScoDoc
Assiduites : fix liste num page #714
This commit is contained in:
parent
d55f90469c
commit
864a5a9405
@ -1024,6 +1024,10 @@ def _filter_manager(requested, assiduites_query: Query) -> Query:
|
||||
if user_id is not False:
|
||||
assiduites_query: Query = scass.filter_by_user_id(assiduites_query, user_id)
|
||||
|
||||
order = requested.args.get("order", None)
|
||||
if order is not None:
|
||||
assiduites_query: Query = assiduites_query.order_by(Assiduite.date_debut.desc())
|
||||
|
||||
return assiduites_query
|
||||
|
||||
|
||||
|
@ -696,4 +696,10 @@ def _filter_manager(requested, justificatifs_query):
|
||||
justificatifs_query, Justificatif, formsemestre
|
||||
)
|
||||
|
||||
order = requested.args.get("order", None)
|
||||
if order is not None:
|
||||
justificatifs_query: Query = justificatifs_query.order_by(
|
||||
Justificatif.date_debut.desc()
|
||||
)
|
||||
|
||||
return justificatifs_query
|
||||
|
@ -1107,6 +1107,7 @@ def _get_sorted_etuds(evaluation: Evaluation, etudids: list, formsemestre_id: in
|
||||
evaluation.date_debut.date().isoformat() if evaluation.date_debut else ""
|
||||
)
|
||||
warn_abs_lst = []
|
||||
# XXX TODO-ASSIDUITE (issue #686)
|
||||
if evaluation.is_matin():
|
||||
nbabs = 0 # TODO-ASSIDUITE sco_abs.count_abs(etudid, jour_iso, jour_iso, matin=True)
|
||||
nbabsjust = 0 # TODO-ASSIDUITE sco_abs.count_abs_just(etudid, jour_iso, jour_iso, matin=True)
|
||||
|
@ -1065,8 +1065,9 @@ function actualizeEtudAssiduite(etudid) {
|
||||
});
|
||||
}
|
||||
|
||||
function getAllAssiduitesFromEtud(etudid, action) {
|
||||
const url_api = getUrl() + `/api/assiduites/${etudid}`;
|
||||
function getAllAssiduitesFromEtud(etudid, action, order = false) {
|
||||
const url_api =
|
||||
getUrl() + `/api/assiduites/${etudid}${order ? "/query?order" : ""}`;
|
||||
|
||||
$.ajax({
|
||||
async: true,
|
||||
@ -1634,8 +1635,9 @@ function createJustificatif(justif, success = () => {}) {
|
||||
});
|
||||
}
|
||||
|
||||
function getAllJustificatifsFromEtud(etudid, action) {
|
||||
const url_api = getUrl() + `/api/justificatifs/${etudid}`;
|
||||
function getAllJustificatifsFromEtud(etudid, action, order = false) {
|
||||
const url_api =
|
||||
getUrl() + `/api/justificatifs/${etudid}${order ? "/query?order" : ""}`;
|
||||
$.ajax({
|
||||
async: true,
|
||||
type: "GET",
|
||||
|
@ -150,7 +150,7 @@
|
||||
paginationContainerAssiduites.querySelector('.pagination_moins').addEventListener('click', () => {
|
||||
if (currentPageAssiduites > 1) {
|
||||
currentPageAssiduites--;
|
||||
paginationContainerAssiduites.querySelector('#paginationAssi').value = currentPageAssiduites
|
||||
paginationContainerAssiduites.querySelector('#paginationAssi').value = currentPageAssiduites + ""
|
||||
assiduiteCallBack(array);
|
||||
|
||||
}
|
||||
@ -159,7 +159,7 @@
|
||||
paginationContainerAssiduites.querySelector('.pagination_plus').addEventListener('click', () => {
|
||||
if (currentPageAssiduites < totalPages) {
|
||||
currentPageAssiduites++;
|
||||
paginationContainerAssiduites.querySelector('#paginationAssi').value = currentPageAssiduites
|
||||
paginationContainerAssiduites.querySelector('#paginationAssi').value = currentPageAssiduites + ""
|
||||
assiduiteCallBack(array);
|
||||
}
|
||||
})
|
||||
@ -199,8 +199,12 @@
|
||||
|
||||
if (assi) {
|
||||
paginationContainerAssiduites.querySelector('#paginationAssi').appendChild(paginationButton)
|
||||
if (i == currentPageAssiduites)
|
||||
paginationContainerAssiduites.querySelector('#paginationAssi').value = i + "";
|
||||
} else {
|
||||
paginationContainerJustificatifs.querySelector('#paginationJusti').appendChild(paginationButton)
|
||||
if (i == currentPageJustificatifs)
|
||||
paginationContainerJustificatifs.querySelector('#paginationJusti').value = i + "";
|
||||
}
|
||||
}
|
||||
updateActivePaginationButton(assi);
|
||||
@ -230,8 +234,8 @@
|
||||
}
|
||||
|
||||
function loadAll() {
|
||||
try { getAllAssiduitesFromEtud(etudid, assiduiteCallBack) } catch (_) { }
|
||||
try { getAllJustificatifsFromEtud(etudid, justificatifCallBack) } catch (_) { }
|
||||
try { getAllAssiduitesFromEtud(etudid, assiduiteCallBack, true) } catch (_) { }
|
||||
try { getAllJustificatifsFromEtud(etudid, justificatifCallBack, true) } catch (_) { }
|
||||
}
|
||||
|
||||
function order(keyword, callback = () => { }, el, assi = true) {
|
||||
|
@ -157,7 +157,6 @@ def test_general(test_client):
|
||||
editer_supprimer_justificatif(etuds[0])
|
||||
|
||||
|
||||
# XXX TODO-ASSIDUITE (issue #696)
|
||||
def verif_migration_abs_assiduites():
|
||||
"""Vérification que le script de migration fonctionne correctement"""
|
||||
downgrade_module(assiduites=True, justificatifs=True)
|
||||
|
Loading…
Reference in New Issue
Block a user