Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Milleville
SCODOC_R6A06
Commits
fdfffb70
Commit
fdfffb70
authored
2 years ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
Table jury BUT: ajout explication sur col RCUEs
parent
de23302b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/static/js/table_recap.js
+296
-270
296 additions, 270 deletions
app/static/js/table_recap.js
with
296 additions
and
270 deletions
app/static/js/table_recap.js
+
296
−
270
View file @
fdfffb70
// Tableau recap notes
// Tableau recap notes
$
(
function
()
{
$
(
function
()
{
$
(
function
()
{
$
(
function
()
{
if
(
$
(
'
table.table_recap
'
).
length
==
0
)
{
return
;
}
if
(
$
(
"
table.table_recap
"
).
length
==
0
)
{
return
;
}
let
hidden_colums
=
[
let
hidden_colums
=
[
"
etud_codes
"
,
"
identite_detail
"
,
"
etud_codes
"
,
"
partition_aux
"
,
"
partition_rangs
"
,
"
admission
"
,
"
identite_detail
"
,
"
col_empty
"
"
partition_aux
"
,
"
partition_rangs
"
,
"
admission
"
,
"
col_empty
"
,
];
];
// Etat (tri des colonnes) de la table:
// Etat (tri des colonnes) de la table:
const
url
=
new
URL
(
document
.
URL
);
const
url
=
new
URL
(
document
.
URL
);
const
formsemestre_id
=
url
.
searchParams
.
get
(
"
formsemestre_id
"
);
const
formsemestre_id
=
url
.
searchParams
.
get
(
"
formsemestre_id
"
);
const
order_info_key
=
JSON
.
stringify
([
url
.
pathname
,
formsemestre_id
]);
const
order_info_key
=
JSON
.
stringify
([
url
.
pathname
,
formsemestre_id
]);
const
etudids_key
=
JSON
.
stringify
([
"
etudids
"
,
url
.
origin
,
formsemestre_id
]);
const
etudids_key
=
JSON
.
stringify
([
"
etudids
"
,
url
.
origin
,
formsemestre_id
,
]);
const
noms_key
=
JSON
.
stringify
([
"
noms
"
,
url
.
origin
,
formsemestre_id
]);
const
noms_key
=
JSON
.
stringify
([
"
noms
"
,
url
.
origin
,
formsemestre_id
]);
let
order_info
;
let
order_info
;
if
(
formsemestre_id
)
{
if
(
formsemestre_id
)
{
...
@@ -30,7 +39,7 @@ $(function () {
...
@@ -30,7 +39,7 @@ $(function () {
// Les colonnes visibles sont mémorisées, il faut initialiser l'état des boutons
// Les colonnes visibles sont mémorisées, il faut initialiser l'état des boutons
function
update_buttons_labels
(
dt
)
{
function
update_buttons_labels
(
dt
)
{
// chaque bouton controle une classe stockée dans le data-group du span
// chaque bouton controle une classe stockée dans le data-group du span
document
.
querySelectorAll
(
"
button.dt-button
"
).
forEach
(
but
=>
{
document
.
querySelectorAll
(
"
button.dt-button
"
).
forEach
(
(
but
)
=>
{
let
g_span
=
but
.
querySelector
(
"
span > span
"
);
let
g_span
=
but
.
querySelector
(
"
span > span
"
);
if
(
g_span
)
{
if
(
g_span
)
{
let
group
=
g_span
.
dataset
[
"
group
"
];
let
group
=
g_span
.
dataset
[
"
group
"
];
...
@@ -66,24 +75,24 @@ $(function () {
...
@@ -66,24 +75,24 @@ $(function () {
}
}
function
toggle_col_group_visibility
(
dt
,
group
,
onoff
)
{
function
toggle_col_group_visibility
(
dt
,
group
,
onoff
)
{
if
(
onoff
)
{
if
(
onoff
)
{
dt
.
columns
(
'
.
'
+
group
).
visible
(
false
);
dt
.
columns
(
"
.
"
+
group
).
visible
(
false
);
}
else
{
}
else
{
dt
.
columns
(
'
.
'
+
group
).
visible
(
true
);
dt
.
columns
(
"
.
"
+
group
).
visible
(
true
);
}
}
update_buttons_labels
(
dt
);
update_buttons_labels
(
dt
);
}
}
// Definition des boutons au dessus de la table:
// Definition des boutons au dessus de la table:
let
buttons
=
[
let
buttons
=
[
{
{
extend
:
'
copyHtml5
'
,
extend
:
"
copyHtml5
"
,
text
:
'
Copier
'
,
text
:
"
Copier
"
,
exportOptions
:
{
orthogonal
:
'
export
'
}
exportOptions
:
{
orthogonal
:
"
export
"
}
,
},
},
{
{
extend
:
'
excelHtml5
'
,
extend
:
"
excelHtml5
"
,
// footer: true, // ne fonctionne pas ?
// footer: true, // ne fonctionne pas ?
exportOptions
:
{
orthogonal
:
'
export
'
},
exportOptions
:
{
orthogonal
:
"
export
"
},
title
:
document
.
querySelector
(
'
table.table_recap
'
).
dataset
.
filename
title
:
document
.
querySelector
(
"
table.table_recap
"
).
dataset
.
filename
,
},
},
{
{
// force affichage de toutes les colonnes
// force affichage de toutes les colonnes
...
@@ -91,7 +100,7 @@ $(function () {
...
@@ -91,7 +100,7 @@ $(function () {
action
:
function
(
e
,
dt
,
node
,
config
)
{
action
:
function
(
e
,
dt
,
node
,
config
)
{
dt
.
columns
().
visible
(
true
);
dt
.
columns
().
visible
(
true
);
update_buttons_labels
(
dt
);
update_buttons_labels
(
dt
);
}
}
,
},
},
{
{
text
:
'
<a title="Rétablir l
\'
affichage par défaut" class="clearreload">🔄</a>
'
,
text
:
'
<a title="Rétablir l
\'
affichage par défaut" class="clearreload">🔄</a>
'
,
...
@@ -99,7 +108,7 @@ $(function () {
...
@@ -99,7 +108,7 @@ $(function () {
localStorage
.
clear
();
localStorage
.
clear
();
console
.
log
(
"
cleared localStorage
"
);
console
.
log
(
"
cleared localStorage
"
);
location
.
reload
();
location
.
reload
();
}
}
,
},
},
{
{
text
:
'
<span data-group="identite_detail">Civilité</span>
'
,
text
:
'
<span data-group="identite_detail">Civilité</span>
'
,
...
@@ -115,23 +124,20 @@ $(function () {
...
@@ -115,23 +124,20 @@ $(function () {
},
},
];
// fin des boutons communs à toutes les tables recap
];
// fin des boutons communs à toutes les tables recap
if
(
$
(
'
table.table_recap
'
).
hasClass
(
"
jury
"
))
{
if
(
$
(
"
table.table_recap
"
).
hasClass
(
"
jury
"
))
{
// Table JURY:
// Table JURY:
// avec ou sans codes enregistrés
// avec ou sans codes enregistrés
buttons
.
push
(
buttons
.
push
({
{
text
:
'
<span data-group="recorded_code">Codes jury</span>
'
,
text
:
'
<span data-group="recorded_code">Codes jury</span>
'
,
action
:
toggle_col_but_visibility
,
action
:
toggle_col_but_visibility
,
});
});
if
(
$
(
'
table.table_recap
'
).
hasClass
(
"
apc
"
))
{
if
(
$
(
"
table.table_recap
"
).
hasClass
(
"
apc
"
))
{
// Boutons spécifiques à la table JURY BUT
// Boutons spécifiques à la table JURY BUT
buttons
.
push
(
buttons
.
push
({
{
text
:
'
<span data-group="cursus_but">Compétences</span>
'
,
text
:
'
<span data-group="cursus_but">Compétences</span>
'
,
action
:
toggle_col_but_visibility
,
action
:
toggle_col_but_visibility
,
});
});
buttons
.
push
(
buttons
.
push
({
{
text
:
'
<span data-group="col_rcue">RCUEs</span>
'
,
text
:
'
<span data-group="col_rcue">RCUEs</span>
'
,
action
:
toggle_col_but_visibility
,
action
:
toggle_col_but_visibility
,
});
});
...
@@ -139,71 +145,72 @@ $(function () {
...
@@ -139,71 +145,72 @@ $(function () {
}
else
{
}
else
{
// BOUTONS SPECIFIQUES A LA TABLE RECAP NON JURY
// BOUTONS SPECIFIQUES A LA TABLE RECAP NON JURY
buttons
.
push
(
buttons
.
push
(
$
(
'
table.table_recap
'
).
hasClass
(
"
apc
"
)
?
$
(
"
table.table_recap
"
).
hasClass
(
"
apc
"
)
{
?
{
text
:
'
<span data-group="col_res">Ressources</span>
'
,
text
:
'
<span data-group="col_res">Ressources</span>
'
,
action
:
toggle_col_ressources_visibility
,
action
:
toggle_col_ressources_visibility
,
}
:
{
}
:
{
name
:
"
toggle_mod
"
,
name
:
"
toggle_mod
"
,
text
:
"
Cacher les modules
"
,
text
:
"
Cacher les modules
"
,
action
:
function
(
e
,
dt
,
node
,
config
)
{
action
:
function
(
e
,
dt
,
node
,
config
)
{
let
onoff
=
node
.
hasClass
(
"
but_on
"
);
let
onoff
=
node
.
hasClass
(
"
but_on
"
);
toggle_col_group_visibility
(
dt
,
"
col_mod:not(.col_empty)
"
,
onoff
);
toggle_col_group_visibility
(
dt
,
"
col_mod:not(.col_empty)
"
,
onoff
);
toggle_col_group_visibility
(
dt
,
"
col_ue_bonus
"
,
onoff
);
toggle_col_group_visibility
(
dt
,
"
col_ue_bonus
"
,
onoff
);
toggle_col_group_visibility
(
dt
,
"
col_malus
"
,
onoff
);
toggle_col_group_visibility
(
dt
,
"
col_malus
"
,
onoff
);
}
}
,
}
}
);
);
if
(
$
(
'
table.table_recap
'
).
hasClass
(
"
apc
"
))
{
if
(
$
(
"
table.table_recap
"
).
hasClass
(
"
apc
"
))
{
buttons
.
push
({
buttons
.
push
({
text
:
'
<span data-group="col_sae">SAÉs</span>
'
,
text
:
'
<span data-group="col_sae">SAÉs</span>
'
,
action
:
toggle_col_but_visibility
,
action
:
toggle_col_but_visibility
,
});
});
}
}
// S'il y a des colonnes vides:
// S'il y a des colonnes vides:
if
(
$
(
'
table.table_recap td.col_empty
'
).
length
>
0
)
{
if
(
$
(
"
table.table_recap td.col_empty
"
).
length
>
0
)
{
buttons
.
push
({
// modules vides
buttons
.
push
({
// modules vides
text
:
'
<span data-group="col_empty">Vides</span>
'
,
text
:
'
<span data-group="col_empty">Vides</span>
'
,
action
:
toggle_col_but_visibility
,
action
:
toggle_col_but_visibility
,
});
});
}
}
// Boutons admission (pas en jury)
// Boutons admission (pas en jury)
if
(
!
$
(
'
table.table_recap
'
).
hasClass
(
"
jury
"
))
{
if
(
!
$
(
"
table.table_recap
"
).
hasClass
(
"
jury
"
))
{
buttons
.
push
(
buttons
.
push
({
{
text
:
'
<span data-group="admission">Admission</span>
'
,
text
:
'
<span data-group="admission">Admission</span>
'
,
action
:
toggle_col_but_visibility
,
action
:
toggle_col_but_visibility
,
}
});
);
}
}
}
}
// Boutons évaluations (si présentes)
// Boutons évaluations (si présentes)
if
(
$
(
'
table.table_recap
'
).
hasClass
(
"
with_evaluations
"
))
{
if
(
$
(
"
table.table_recap
"
).
hasClass
(
"
with_evaluations
"
))
{
buttons
.
push
(
buttons
.
push
({
{
text
:
'
<span data-group="eval">Évaluations</span>
'
,
text
:
'
<span data-group="eval">Évaluations</span>
'
,
action
:
toggle_col_but_visibility
,
action
:
toggle_col_but_visibility
,
}
});
);
}
}
// ------------- LA TABLE ---------
// ------------- LA TABLE ---------
try
{
try
{
let
table
=
$
(
'
table.table_recap
'
).
DataTable
(
let
table
=
$
(
"
table.table_recap
"
).
DataTable
({
{
paging
:
false
,
paging
:
false
,
searching
:
true
,
searching
:
true
,
info
:
false
,
info
:
false
,
autoWidth
:
false
,
autoWidth
:
false
,
fixedHeader
:
{
fixedHeader
:
{
header
:
true
,
header
:
true
,
footer
:
false
footer
:
false
,
},
},
orderCellsTop
:
true
,
// cellules ligne 1 pour tri
orderCellsTop
:
true
,
// cellules ligne 1 pour tri
aaSorting
:
[],
// Prevent initial sorting
aaSorting
:
[],
// Prevent initial sorting
colReorder
:
true
,
colReorder
:
true
,
stateSave
:
true
,
// enregistre état de la table (tris, ...)
stateSave
:
true
,
// enregistre état de la table (tris, ...)
"
columnDefs
"
:
[
columnDefs
:
[
{
{
// cache les codes, le détail de l'identité, les groupes, les colonnes admission et les vides
// cache les codes, le détail de l'identité, les groupes, les colonnes admission et les vides
targets
:
hidden_colums
,
targets
:
hidden_colums
,
...
@@ -211,50 +218,62 @@ $(function () {
...
@@ -211,50 +218,62 @@ $(function () {
},
},
{
{
// Elimine les 0 à gauche pour les exports excel et les "copy"
// Elimine les 0 à gauche pour les exports excel et les "copy"
targets
:
[
"
col_mod
"
,
"
col_moy_gen
"
,
"
col_moy_ue
"
,
"
col_res
"
,
"
col_sae
"
,
"
evaluation
"
,
"
col_rcue
"
],
targets
:
[
"
col_mod
"
,
"
col_moy_gen
"
,
"
col_moy_ue
"
,
"
col_res
"
,
"
col_sae
"
,
"
evaluation
"
,
"
col_rcue
"
,
],
render
:
function
(
data
,
type
,
row
)
{
render
:
function
(
data
,
type
,
row
)
{
return
type
===
'
export
'
?
data
.
replace
(
/0
(\d\.
.*
)
/
,
'
$1
'
)
:
data
;
return
type
===
"
export
"
?
data
.
replace
(
/0
(\d\.
.*
)
/
,
"
$1
"
)
:
data
;
}
}
,
},
},
{
{
// Elimine les "+"" pour les exports
// Elimine les "+"" pour les exports
targets
:
[
"
col_ue_bonus
"
,
"
col_malus
"
],
targets
:
[
"
col_ue_bonus
"
,
"
col_malus
"
],
render
:
function
(
data
,
type
,
row
)
{
render
:
function
(
data
,
type
,
row
)
{
return
type
===
'
export
'
?
data
.
replace
(
/.*
\+(\d?\d?\.\d\d)
.*/m
,
'
$1
'
).
replace
(
/0
(\d\.
.*
)
/
,
'
$1
'
)
:
data
;
return
type
===
"
export
"
}
?
data
.
replace
(
/.*
\+(\d?\d?\.\d\d)
.*/m
,
"
$1
"
)
.
replace
(
/0
(\d\.
.*
)
/
,
"
$1
"
)
:
data
;
},
},
},
{
{
// Elimine emoji warning sur UEs
// Elimine emoji warning sur UEs
targets
:
[
"
col_ues_validables
"
],
targets
:
[
"
col_ues_validables
"
],
render
:
function
(
data
,
type
,
row
)
{
render
:
function
(
data
,
type
,
row
)
{
return
type
===
'
export
'
?
data
.
replace
(
/
(\d
+
\/\d
+
)
.*/
,
'
$1
'
)
:
data
;
return
type
===
"
export
"
}
?
data
.
replace
(
/
(\d
+
\/\d
+
)
.*/
,
"
$1
"
)
}
:
data
;
},
},
],
],
dom
:
'
Bfrtip
'
,
dom
:
"
Bfrtip
"
,
buttons
:
buttons
,
buttons
:
buttons
,
"
drawCallback
"
:
function
(
settings
)
{
drawCallback
:
function
(
settings
)
{
// permet de conserver l'ordre de tri des colonnes
// permet de conserver l'ordre de tri des colonnes
let
table
=
$
(
'
table.table_recap
'
).
DataTable
();
let
table
=
$
(
"
table.table_recap
"
).
DataTable
();
let
order_info
=
JSON
.
stringify
(
table
.
order
());
let
order_info
=
JSON
.
stringify
(
table
.
order
());
if
(
formsemestre_id
)
{
if
(
formsemestre_id
)
{
localStorage
.
setItem
(
order_info_key
,
order_info
);
localStorage
.
setItem
(
order_info_key
,
order_info
);
}
}
let
etudids
=
[];
let
etudids
=
[];
document
.
querySelectorAll
(
"
td.identite_court
"
).
forEach
(
e
=>
{
document
.
querySelectorAll
(
"
td.identite_court
"
).
forEach
(
(
e
)
=>
{
etudids
.
push
(
e
.
dataset
.
etudid
);
etudids
.
push
(
e
.
dataset
.
etudid
);
});
});
let
noms
=
[];
let
noms
=
[];
document
.
querySelectorAll
(
"
td.identite_court
"
).
forEach
(
e
=>
{
document
.
querySelectorAll
(
"
td.identite_court
"
).
forEach
(
(
e
)
=>
{
noms
.
push
(
e
.
dataset
.
nomprenom
);
noms
.
push
(
e
.
dataset
.
nomprenom
);
});
});
localStorage
.
setItem
(
etudids_key
,
JSON
.
stringify
(
etudids
));
localStorage
.
setItem
(
etudids_key
,
JSON
.
stringify
(
etudids
));
localStorage
.
setItem
(
noms_key
,
JSON
.
stringify
(
noms
));
localStorage
.
setItem
(
noms_key
,
JSON
.
stringify
(
noms
));
},
},
"
order
"
:
order_info
,
order
:
order_info
,
}
});
);
update_buttons_labels
(
table
);
update_buttons_labels
(
table
);
}
catch
(
error
)
{
}
catch
(
error
)
{
// l'erreur peut etre causee par un ancien storage:
// l'erreur peut etre causee par un ancien storage:
...
@@ -264,13 +283,12 @@ $(function () {
...
@@ -264,13 +283,12 @@ $(function () {
location
.
reload
();
location
.
reload
();
}
}
});
});
$
(
'
table.table_recap tbody
'
).
on
(
'
click
'
,
'
tr
'
,
function
()
{
$
(
"
table.table_recap tbody
"
).
on
(
"
click
"
,
"
tr
"
,
function
()
{
if
(
$
(
this
).
hasClass
(
'
selected
'
))
{
if
(
$
(
this
).
hasClass
(
"
selected
"
))
{
$
(
this
).
removeClass
(
'
selected
'
);
$
(
this
).
removeClass
(
"
selected
"
);
}
}
else
{
else
{
$
(
"
table.table_recap tr.selected
"
).
removeClass
(
"
selected
"
);
$
(
'
table.table_recap tr.selected
'
).
removeClass
(
'
selected
'
);
$
(
this
).
addClass
(
"
selected
"
);
$
(
this
).
addClass
(
'
selected
'
);
}
}
});
});
// Pour montrer et surligner l'étudiant sélectionné:
// Pour montrer et surligner l'étudiant sélectionné:
...
@@ -282,4 +300,12 @@ $(function () {
...
@@ -282,4 +300,12 @@ $(function () {
row_selected
.
classList
.
add
(
"
selected
"
);
row_selected
.
classList
.
add
(
"
selected
"
);
}
}
});
});
// Ajoute bulle aide sur colonne RCUEs
$
(
function
()
{
// explication colonne RCUEs
let
th
=
document
.
querySelector
(
"
table.table_recap.apc th.col_rcues_validables
"
);
th
.
title
=
"
RCUEs validables avec ces notes
"
;
});
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment