diff --git a/sco_etape_bilan.py b/sco_etape_bilan.py index 371cfc0b..7dcdcda8 100644 --- a/sco_etape_bilan.py +++ b/sco_etape_bilan.py @@ -90,6 +90,7 @@ l'inscrition de semestres décalés (S1 en septembre, ...). Le filtrage s'effctue sur la date et non plus sur la parité du semestre (1-3/2-4). """ +import json from sco_portal_apogee import get_inscrits_etape from notes_log import log @@ -540,7 +541,7 @@ class EtapeBilan: ind_col, comptage, "", - self.titres[ind_col].replace("
", " / "), + json.dumps(self.titres[ind_col].replace("
", " / "))[1:-1], ) elif ind_col == COL_CUMUL: javascript = "doFiltrage(%s, %s, '.%s', '*', '%s', '%s', '%s');" % ( @@ -548,7 +549,7 @@ class EtapeBilan: self.all_cols_str, ind_row, " (%d étudiants)" % count, - self.titres[ind_row], + json.dumps(self.titres[ind_row])[1:-1], "", ) else: @@ -558,10 +559,10 @@ class EtapeBilan: ind_row, ind_col, comptage, - self.titres[ind_row], - self.titres[ind_col].replace("
", " / "), + json.dumps(self.titres[ind_row])[1:-1], + json.dumps(self.titres[ind_col].replace("
", " / "))[1:-1], ) - return "%d" % (javascript, count) + return '%d' % (javascript, count) def _diagtable(self): H = [] diff --git a/static/js/apo_semset_maq_status.js b/static/js/apo_semset_maq_status.js index 3b2a3487..445bdf87 100644 --- a/static/js/apo_semset_maq_status.js +++ b/static/js/apo_semset_maq_status.js @@ -1,6 +1,6 @@ -$(function() { - $( "div#export_help" ).accordion( { +$(function () { + $("div#export_help").accordion({ heightStyle: "content", collapsible: true, active: false, @@ -21,8 +21,8 @@ function display(r, c, row, col) { function show_tag(all_rows, all_cols, tag) { // Filtrer tous les étudiants - all_rows.split(',').forEach(function(r) { - all_cols.split(',').forEach(function(c) { + all_rows.split(',').forEach(function (r) { + all_cols.split(',').forEach(function (c) { etudiants = r + c.substring(1); $(etudiants).css("display", "none"); }) @@ -34,36 +34,36 @@ function show_tag(all_rows, all_cols, tag) { function show_filtres(effectifs, filtre_row, filtre_col) { $("#compte").html(effectifs); if ((filtre_row == '') && (filtre_col == '')) { - $("#sans_filtre").css("display", ""); - $("#filtre_row").css("display", "none"); - $("#filtre_col").css("display", "none"); + $("#sans_filtre").css("display", ""); + $("#filtre_row").css("display", "none"); + $("#filtre_col").css("display", "none"); } else { - $("#sans_filtre").css("display", "none"); - if (filtre_row == '') { - $("#filtre_row").css("display", "none"); - $("#filtre_col").css("display", ""); - $("#filtre_col").html("Filtre sur code étape: " + filtre_col); - } else if (filtre_col == '') { - $("#filtre_row").css("display", ""); - $("#filtre_col").css("display", "none"); - $("#filtre_row").html("Filtre sur semestre: " + filtre_row); - } else { - $("#filtre_row").css("display", ""); - $("#filtre_col").css("display", ""); - $("#filtre_row").html("Filtre sur semestre: " + filtre_row); - $("#filtre_col").html("Filtre sur code étape: " + filtre_col); - } + $("#sans_filtre").css("display", "none"); + if (filtre_row == '') { + $("#filtre_row").css("display", "none"); + $("#filtre_col").css("display", ""); + $("#filtre_col").html("Filtre sur code étape: " + filtre_col); + } else if (filtre_col == '') { + $("#filtre_row").css("display", ""); + $("#filtre_col").css("display", "none"); + $("#filtre_row").html("Filtre sur semestre: " + filtre_row); + } else { + $("#filtre_row").css("display", ""); + $("#filtre_col").css("display", ""); + $("#filtre_row").html("Filtre sur semestre: " + filtre_row); + $("#filtre_col").html("Filtre sur code étape: " + filtre_col); + } } } function doFiltrage(all_rows, all_cols, row, col, effectifs, filtre_row, filtre_col) { show_filtres(effectifs, filtre_row, filtre_col) - all_rows.split(',').forEach(function(r) { - all_cols.split(',').forEach(function(c) { + all_rows.split(',').forEach(function (r) { + all_cols.split(',').forEach(function (c) { etudiants = r + c.substring(1); $(etudiants).css("display", display(r, c, row, col)); - }) - }) + }); + }); $('.repartition td').css("background-color", ""); $('.repartition th').css("background-color", "");