diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a090b96e4770ea690ce15e4fd4b443d4115139a..0e63f7f19efa84552b5c260049e4af47f5d244de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -342,7 +342,7 @@ Variable courseid non définie remplacée par $COURSE->id plus sécurisée. #### Message quand pas d'activité à suivre -[ ] Lorsqu'une section ne contient pas d'activité suivies, afficher un message au lieu de la liste des étudiants avec aucune activité en colonne et 0% pour chaque. +[x] Lorsqu'une section ne contient pas d'activité suivies, afficher un message au lieu de la liste des étudiants avec aucune activité en colonne et 0% pour chaque. Il indique qu'aucune activité n'est suivie pour cette section. Le message indiquant qu'aucun étudiant n'est retourné par les filtres ne peut apparaître que s'il y a des activités suivies. ### Cron diff --git a/view/view_suivi_unit3.php b/view/view_suivi_unit3.php index e27efa9f12f5079557b0defa287458c5dfac654c..a2de44f873372ef2904f837f057f5206de7db606 100644 --- a/view/view_suivi_unit3.php +++ b/view/view_suivi_unit3.php @@ -130,91 +130,91 @@ if (isset($_GET['filter'])) { ?> <style> -/* Permet la rotation des entêtes du tableau */ -th.th-rotate { - /* Something you can count on */ - height: 140px; - white-space: nowrap; -} + /* Permet la rotation des entêtes du tableau */ + th.th-rotate { + /* Something you can count on */ + height: 140px; + white-space: nowrap; + } -th.th-rotate > div { - transform: - /* Magic Numbers */ - translate(17px, 49px) - /* 45 is really 360 - 45 */ - rotate(315deg); - width: 30px; -} -th.th-rotate > div > span { - border-bottom: 1px solid #ccc; - padding: 5px 10px; -} -/* Change la couleur une ligne sur deux dans le tableau */ -#table-body tr:nth-child(even) { background: #fafafa; } -#table-body tr:nth-child(odd) { background: #eee; } -/* Colorie la cellule en fonction de l'achèvement */ -.state-0 { background-color: rgba(0, 143, 132, 0.23); } -.state-1 { background-color: #009085; } -.state-2 { background-color: #009085; } -.state-3 { background-color: rgba(214, 141, 1, 0.4); } - - -#first-column-head { - vertical-align: bottom; - padding-bottom: 0.5rem; -} + th.th-rotate > div { + transform: + /* Magic Numbers */ + translate(17px, 49px) + /* 45 is really 360 - 45 */ + rotate(315deg); + width: 30px; + } + th.th-rotate > div > span { + border-bottom: 1px solid #ccc; + padding: 5px 10px; + } + /* Change la couleur une ligne sur deux dans le tableau */ + #table-body tr:nth-child(even) { background: #fafafa; } + #table-body tr:nth-child(odd) { background: #eee; } + /* Colorie la cellule en fonction de l'achèvement */ + .state-0 { background-color: rgba(0, 143, 132, 0.23); } + .state-1 { background-color: #009085; } + .state-2 { background-color: #009085; } + .state-3 { background-color: rgba(214, 141, 1, 0.4); } + + + #first-column-head { + vertical-align: bottom; + padding-bottom: 0.5rem; + } -.pointer-help { - cursor: help; -} + .pointer-help { + cursor: help; + } -.stud_perc { - min-width: 45px; - display: inline-block; -} + .stud_perc { + min-width: 45px; + display: inline-block; + } -#table-body td { border-right: 1px solid #eee; } + #table-body td { border-right: 1px solid #eee; } -/* Scroll de la table */ -#table-body { - display: block; - overflow-y:scroll; - margin-right: 10rem; - height: 300px; - height: 50vh; -} + /* Scroll de la table */ + #table-body { + display: block; + overflow-y:scroll; + margin-right: 10rem; + height: 300px; + height: 50vh; + } -#suivi { - margin-bottom: 1rem; -} + #suivi { + margin-bottom: 1rem; + } -#suivi thead { - display: block; overflow-x:scroll; -} + #suivi thead { + display: block; overflow-x:scroll; + } -#suivi thead tr th:nth-child(1) { - width:20em; - min-width:20em; -} -#suivi thead tr th { - min-width:32px; -} -#suivi tbody tr th { - width:20em; - min-width:20em; - word-break: break-word; -} -#suivi tbody tr td { - min-width:32px; -} + #suivi thead tr th:nth-child(1) { + width:20em; + min-width:20em; + } + #suivi thead tr th { + min-width:32px; + } + #suivi tbody tr th { + width:20em; + min-width:20em; + word-break: break-word; + } + #suivi tbody tr td { + min-width:32px; + } -#suivi input[type="checkbox"] { - margin: 5px; - font-size: 1rem; -} + #suivi input[type="checkbox"] { + margin: 5px; + font-size: 1rem; + } -.mb1 { margin-bottom: 1rem; } -.mt1 { margin-top: 1rem; } + .mb1 { margin-bottom: 1rem; } + .mt1 { margin-top: 1rem; } </style> @@ -357,7 +357,9 @@ th.th-rotate > div > span { <a href="#" class="select_all_studs">Sélectionner tout</a> || <a href="#" class="send_msg_sel">Message aux étudiants sélectionnés</a> </div> -<div id="no_result" class="alert alert-warning">Aucun étudiants trouvé. Vérifiez la section, le groupe et le filtre choisi.</div> +<div id="no_result" class="alert alert-warning" style="display: none;">Aucun étudiants trouvé. Vérifiez la section, le groupe et le filtre choisi.</div> + +<div id="no_result_activity" class="alert alert-warning" style="display: none;">Aucune activité se semble suivie pour cette section. </div> <table id="suivi"> <thead> @@ -406,14 +408,37 @@ var data = { counter++; } } - // console.log(counter); + var no_rows = false; if (counter == 0) { + no_rows = true; + } + + var cols = document.querySelectorAll("#suivi > thead > tr > th.th-rotate"); + var counter = 0; + for (var i = 0; i < cols.length; i++) { + if (cols[i].style.display != "none") { + counter++; + } + } + var no_cols = false; + if (counter == 0) { + no_cols = true; + } + + if (no_cols) { + document.getElementById('no_result_activity').style.display = ""; + document.getElementById('no_result').style.display = "none"; document.getElementById('suivi').style.display = "none"; + } else if (no_rows) { + document.getElementById('no_result_activity').style.display = "none"; document.getElementById('no_result').style.display = ""; + document.getElementById('suivi').style.display = "none"; } else { - document.getElementById('suivi').style.display = ""; + document.getElementById('no_result_activity').style.display = "none"; document.getElementById('no_result').style.display = "none"; + document.getElementById('suivi').style.display = ""; } + } function set_table_head() {