Skip to content
Snippets Groups Projects
Commit d7e0f7dd authored by Thomas Fradet's avatar Thomas Fradet
Browse files

suivi : ajout msg si pas act suivie

parent b0c4c3e5
Branches
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment