forked from ScoDoc/ScoDoc
JS table recap: initialisation des labels des boutons
This commit is contained in:
parent
add2dc3a14
commit
393c205cb9
@ -25,7 +25,33 @@ $(function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Les boutons dépendent du mode BUT ou classique:
|
|
||||||
|
// Les colonnes visibles étant mémorisé, il faut initialiser les titres des boutons
|
||||||
|
function update_buttons_labels(dt) {
|
||||||
|
dt.buttons('toggle_ident:name').text(dt.columns(".identite_detail").visible()[0] ? "Nom seul" : "Civ/Nom/Prénom");
|
||||||
|
dt.buttons('toggle_partitions:name').text(dt.columns(".partition_aux").visible()[0] ? "Cacher les groupes" : "Montrer groupes");
|
||||||
|
if (!$('table.table_recap').hasClass("table_jury_but")) {
|
||||||
|
// Bouton "rangs groupes", sauf pour table jury BUT
|
||||||
|
dt.buttons('toggle_partitions_rangs:name').text(dt.columns(".partition_rangs").visible()[0] ? "Cacher rangs groupes" : "Rangs groupes");
|
||||||
|
dt.buttons('toggle_admission:name').text(dt.columns(".admission").visible()[0] ? "Cacher infos admission" : "Montrer infos admission");
|
||||||
|
} else {
|
||||||
|
// table jury BUT: avec ou sans codes enregistrés
|
||||||
|
dt.buttons('toggle_recorded_code:name').text(dt.columns(".recorded_code").visible()[0] ? "Cacher codes jury" : "Code jury enregistrés");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Boutons non visibles en mode jury:
|
||||||
|
if (!$('table.table_recap').hasClass("jury")) {
|
||||||
|
// Ces boutons dépendent du mode BUT ou classique:
|
||||||
|
if ($('table.table_recap').hasClass("apc")) {
|
||||||
|
dt.buttons('toggle_res:name').text(dt.columns(".col_res").visible()[0] ? "Cacher les ressources" : "Montrer les ressources");
|
||||||
|
dt.buttons('toggle_sae:name').text(dt.columns(".col_sae").visible()[0] ? "Cacher les SAÉs" : "Montrer les SAÉs");
|
||||||
|
} else {
|
||||||
|
dt.buttons('toggle_mod:name').text(dt.columns(".col_mod:not(.col_empty)").visible()[0] ? "Cacher les modules" : "Montrer les modules");
|
||||||
|
}
|
||||||
|
dt.buttons('toggle_col_empty:name').text(dt.columns(".col_empty").visible()[0] ? "Cacher mod. vides" : "Montrer mod. vides");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let buttons = [
|
let buttons = [
|
||||||
{
|
{
|
||||||
name: "toggle_ident",
|
name: "toggle_ident",
|
||||||
@ -34,7 +60,7 @@ $(function () {
|
|||||||
let visible = dt.columns(".identite_detail").visible()[0];
|
let visible = dt.columns(".identite_detail").visible()[0];
|
||||||
dt.columns(".identite_detail").visible(!visible);
|
dt.columns(".identite_detail").visible(!visible);
|
||||||
dt.columns(".identite_court").visible(visible);
|
dt.columns(".identite_court").visible(visible);
|
||||||
dt.buttons('toggle_ident:name').text(visible ? "Civ/Nom/Prénom" : "Nom");
|
update_buttons_labels(dt);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -43,7 +69,7 @@ $(function () {
|
|||||||
action: function (e, dt, node, config) {
|
action: function (e, dt, node, config) {
|
||||||
let visible = dt.columns(".partition_aux").visible()[0];
|
let visible = dt.columns(".partition_aux").visible()[0];
|
||||||
dt.columns(".partition_aux").visible(!visible);
|
dt.columns(".partition_aux").visible(!visible);
|
||||||
dt.buttons('toggle_partitions:name').text(visible ? "Montrer groupes" : "Cacher les groupes");
|
update_buttons_labels(dt);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -56,7 +82,7 @@ $(function () {
|
|||||||
action: function (e, dt, node, config) {
|
action: function (e, dt, node, config) {
|
||||||
let rangs_visible = dt.columns(".partition_rangs").visible()[0];
|
let rangs_visible = dt.columns(".partition_rangs").visible()[0];
|
||||||
dt.columns(".partition_rangs").visible(!rangs_visible);
|
dt.columns(".partition_rangs").visible(!rangs_visible);
|
||||||
dt.buttons('toggle_partitions_rangs:name').text(rangs_visible ? "Rangs groupes" : "Cacher rangs groupes");
|
update_buttons_labels(dt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -68,7 +94,7 @@ $(function () {
|
|||||||
action: function (e, dt, node, config) {
|
action: function (e, dt, node, config) {
|
||||||
let visible = dt.columns(".recorded_code").visible()[0];
|
let visible = dt.columns(".recorded_code").visible()[0];
|
||||||
dt.columns(".recorded_code").visible(!visible);
|
dt.columns(".recorded_code").visible(!visible);
|
||||||
dt.buttons('toggle_recorded_code:name').text(visible ? "Code jury enregistrés" : "Cacher codes jury");
|
update_buttons_labels(dt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -78,13 +104,13 @@ $(function () {
|
|||||||
$('table.table_recap').hasClass("apc") ?
|
$('table.table_recap').hasClass("apc") ?
|
||||||
{
|
{
|
||||||
name: "toggle_res",
|
name: "toggle_res",
|
||||||
text: "Cacher les ressources",
|
text: "Visilité ressources",
|
||||||
action: function (e, dt, node, config) {
|
action: function (e, dt, node, config) {
|
||||||
let visible = dt.columns(".col_res").visible()[0];
|
let visible = dt.columns(".col_res").visible()[0];
|
||||||
dt.columns(".col_res").visible(!visible);
|
dt.columns(".col_res").visible(!visible);
|
||||||
dt.columns(".col_ue_bonus").visible(!visible);
|
dt.columns(".col_ue_bonus").visible(!visible);
|
||||||
dt.columns(".col_malus").visible(!visible);
|
dt.columns(".col_malus").visible(!visible);
|
||||||
dt.buttons('toggle_res:name').text(visible ? "Montrer les ressources" : "Cacher les ressources");
|
update_buttons_labels(dt);
|
||||||
}
|
}
|
||||||
} : {
|
} : {
|
||||||
name: "toggle_mod",
|
name: "toggle_mod",
|
||||||
@ -94,30 +120,28 @@ $(function () {
|
|||||||
dt.columns(".col_mod:not(.col_empty)").visible(!visible);
|
dt.columns(".col_mod:not(.col_empty)").visible(!visible);
|
||||||
dt.columns(".col_ue_bonus").visible(!visible);
|
dt.columns(".col_ue_bonus").visible(!visible);
|
||||||
dt.columns(".col_malus").visible(!visible);
|
dt.columns(".col_malus").visible(!visible);
|
||||||
dt.buttons('toggle_mod:name').text(visible ? "Montrer les modules" : "Cacher les modules");
|
update_buttons_labels(dt);
|
||||||
visible = dt.columns(".col_empty").visible()[0];
|
|
||||||
dt.buttons('toggle_col_empty:name').text(visible ? "Cacher mod. vides" : "Montrer mod. vides");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if ($('table.table_recap').hasClass("apc")) {
|
if ($('table.table_recap').hasClass("apc")) {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
name: "toggle_sae",
|
name: "toggle_sae",
|
||||||
text: "Cacher les SAÉs",
|
text: "Visibilité SAÉs",
|
||||||
action: function (e, dt, node, config) {
|
action: function (e, dt, node, config) {
|
||||||
let visible = dt.columns(".col_sae").visible()[0];
|
let visible = dt.columns(".col_sae").visible()[0];
|
||||||
dt.columns(".col_sae").visible(!visible);
|
dt.columns(".col_sae").visible(!visible);
|
||||||
dt.buttons('toggle_sae:name').text(visible ? "Montrer les SAÉs" : "Cacher les SAÉs");
|
update_buttons_labels(dt);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
buttons.push({
|
buttons.push({
|
||||||
name: "toggle_col_empty",
|
name: "toggle_col_empty",
|
||||||
text: "Montrer mod. vides",
|
text: "Visibilité mod. vides",
|
||||||
action: function (e, dt, node, config) {
|
action: function (e, dt, node, config) {
|
||||||
let visible = dt.columns(".col_empty").visible()[0];
|
let visible = dt.columns(".col_empty").visible()[0];
|
||||||
dt.columns(".col_empty").visible(!visible);
|
dt.columns(".col_empty").visible(!visible);
|
||||||
dt.buttons('toggle_col_empty:name').text(visible ? "Montrer mod. vides" : "Cacher mod. vides");
|
update_buttons_labels(dt);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -129,7 +153,7 @@ $(function () {
|
|||||||
action: function (e, dt, node, config) {
|
action: function (e, dt, node, config) {
|
||||||
let visible = dt.columns(".admission").visible()[0];
|
let visible = dt.columns(".admission").visible()[0];
|
||||||
dt.columns(".admission").visible(!visible);
|
dt.columns(".admission").visible(!visible);
|
||||||
dt.buttons('toggle_admission:name').text(visible ? "Montrer infos admission" : "Cacher infos admission");
|
update_buttons_labels(dt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -209,6 +233,7 @@ $(function () {
|
|||||||
"order": order_info,
|
"order": order_info,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
update_buttons_labels(table);
|
||||||
});
|
});
|
||||||
$('table.table_recap tbody').on('click', 'tr', function () {
|
$('table.table_recap tbody').on('click', 'tr', function () {
|
||||||
if ($(this).hasClass('selected')) {
|
if ($(this).hasClass('selected')) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
SCOVERSION = "9.4.26"
|
SCOVERSION = "9.4.27"
|
||||||
|
|
||||||
SCONAME = "ScoDoc"
|
SCONAME = "ScoDoc"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user