diff --git a/app/scodoc/sco_groups_view.py b/app/scodoc/sco_groups_view.py
index d02e7cc74..b04741349 100644
--- a/app/scodoc/sco_groups_view.py
+++ b/app/scodoc/sco_groups_view.py
@@ -67,18 +67,24 @@ CSSSTYLES = html_sco_header.BOOTSTRAP_MULTISELECT_CSS
def groups_view(
group_ids=(),
fmt="html",
- # Options pour listes:
with_codes=0,
etat=None,
- with_paiement=0, # si vrai, ajoute colonnes infos paiement droits et finalisation inscription (lent car interrogation portail)
- with_archives=0, # ajoute colonne avec noms fichiers archivés
+ with_paiement=0,
+ with_archives=0,
with_annotations=0,
with_bourse=0,
- formsemestre_id=None, # utilise si aucun groupe selectionné
+ formsemestre_id=None,
):
"""Affichage des étudiants des groupes indiqués
group_ids: liste de group_id
fmt: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf
+
+ Options pour listes:
+ with_paiement: si vrai, ajoute colonnes infos paiement droits
+ et finalisation inscription (lent car interrogation portail)
+ with_archives: ajoute colonne avec noms fichiers archivés
+
+ formsemestre_id est utilisé si aucun groupe selectionné pour construire la liste des groupes.
"""
# Informations sur les groupes à afficher:
groups_infos = DisplayedGroupsInfos(
diff --git a/app/static/js/apo_semset_maq_status.js b/app/static/js/apo_semset_maq_status.js
index 445bdf876..161a22114 100644
--- a/app/static/js/apo_semset_maq_status.js
+++ b/app/static/js/apo_semset_maq_status.js
@@ -1,10 +1,9 @@
-
$(function () {
- $("div#export_help").accordion({
- heightStyle: "content",
- collapsible: true,
- active: false,
- });
+ $("div#export_help").accordion({
+ heightStyle: "content",
+ collapsible: true,
+ active: false,
+ });
});
// Affichage des listes par type
@@ -14,77 +13,89 @@ $(function () {
// -> surligne le cas sélectionné
function display(r, c, row, col) {
- if ((row != r) && (row != '*')) return 'none';
- if ((col != c) && (col != '*')) return 'none';
- return '';
+ if (row != r && row != "*") return "none";
+ if (col != c && col != "*") return "none";
+ return "";
}
function show_tag(all_rows, all_cols, tag) {
- // Filtrer tous les étudiants
- all_rows.split(',').forEach(function (r) {
- all_cols.split(',').forEach(function (c) {
- etudiants = r + c.substring(1);
- $(etudiants).css("display", "none");
- })
- })
- // sauf le tag
- $('.' + tag).css('display', '');
+ // Filtrer tous les étudiants
+ all_rows.split(",").forEach(function (r) {
+ all_cols.split(",").forEach(function (c) {
+ etudiants = r + c.substring(1);
+ $(etudiants).css("display", "none");
+ });
+ });
+ // sauf le tag
+ $("." + tag).css("display", "");
}
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");
+ $("#compte").html(effectifs);
+ if (filtre_row == "" && filtre_col == "") {
+ $("#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 {
- $("#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);
- }
+ $("#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) {
- etudiants = r + c.substring(1);
- $(etudiants).css("display", display(r, c, row, 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) {
+ etudiants = r + c.substring(1);
+ $(etudiants).css("display", display(r, c, row, col));
});
+ });
- $('.repartition td').css("background-color", "");
- $('.repartition th').css("background-color", "");
+ $(".repartition td").css("background-color", "");
+ $(".repartition th").css("background-color", "");
- if (row == '*' && col == '*') { // Aucun filtre
- } else if (row == '*') { // filtrage sur 1 colonne
- $(col).css("background-color", "lightblue");
- } else if (col == '*') { // Filtrage sur 1 ligne
- $(row + '>td').css("background-color", "lightblue");
- $(row + '>th').css("background-color", "lightblue");
- } else { // filtrage sur 1 case
- $(row + '>td' + col).css("background-color", "lightblue");
- }
+ if (row == "*" && col == "*") {
+ // Aucun filtre
+ } else if (row == "*") {
+ // filtrage sur 1 colonne
+ $(col).css("background-color", "lightblue");
+ } else if (col == "*") {
+ // Filtrage sur 1 ligne
+ $(row + ">td").css("background-color", "lightblue");
+ $(row + ">th").css("background-color", "lightblue");
+ } else {
+ // filtrage sur 1 case
+ $(row + ">td" + col).css("background-color", "lightblue");
+ }
- // Modifie le titre de la section pour indiquer la sélection:
- // elt est le lien cliqué
- // var td_class = elt.parentNode.className.trim();
- // if (td_class) {
- // var titre_col = $("table.repartition th.")[0].textContent.trim();
- // if (titre_col) {
- // $("h4#effectifs").html("Liste des étudiants de " + titre_col);
- // }
- // }
+ // Modifie le titre de la section pour indiquer la sélection:
+ // elt est le lien cliqué
+ // var td_class = elt.parentNode.className.trim();
+ // if (td_class) {
+ // var titre_col = $("table.repartition th.")[0].textContent.trim();
+ // if (titre_col) {
+ // $("h4#effectifs").html("Liste des étudiants de " + titre_col);
+ // }
+ // }
}
diff --git a/app/static/js/bulletin.js b/app/static/js/bulletin.js
index 843f70f83..ffb05347b 100644
--- a/app/static/js/bulletin.js
+++ b/app/static/js/bulletin.js
@@ -1,7 +1,6 @@
// Affichage anciens (non BUT) bulletin de notes
// (uses jQuery)
-
// Change visibility of UE details (les
de classe "notes_bulletin_row_mod" suivant)
// La table a la structure suivante:
//
+/-... | ...
@@ -11,40 +10,44 @@
// On change la visi de tous les jusqu'au notes_bulletin_row_ue suivant.
//
function toggle_vis_ue(e, new_state) {
- // e is the span containg the clicked +/- icon
- var tr = e.parentNode.parentNode;
- if (new_state == undefined) {
- // current state: use alt attribute of current image
- if (e.childNodes[0].alt == '+') {
- new_state = false;
- } else {
- new_state = true;
- }
- }
- // find next tr in siblings
- var tr = tr.nextSibling;
- //while ((tr != null) && sibl.tagName == 'TR') {
- var current = true;
- while ((tr != null) && current) {
- if ((tr.nodeType == 1) && (tr.tagName == 'TR')) {
- for (var i = 0; i < tr.classList.length; i++) {
- if ((tr.classList[i] == 'notes_bulletin_row_ue') || (tr.classList[i] == 'notes_bulletin_row_sum_ects'))
- current = false;
- }
- if (current) {
- if (new_state) {
- tr.style.display = 'none';
- } else {
- tr.style.display = 'table-row';
- }
- }
- }
- tr = tr.nextSibling;
- }
- if (new_state) {
- e.innerHTML = '';
- } else {
- e.innerHTML = '';
- }
+ // e is the span containg the clicked +/- icon
+ var tr = e.parentNode.parentNode;
+ if (new_state == undefined) {
+ // current state: use alt attribute of current image
+ if (e.childNodes[0].alt == "+") {
+ new_state = false;
+ } else {
+ new_state = true;
+ }
+ }
+ // find next tr in siblings
+ var tr = tr.nextSibling;
+ //while ((tr != null) && sibl.tagName == 'TR') {
+ var current = true;
+ while (tr != null && current) {
+ if (tr.nodeType == 1 && tr.tagName == "TR") {
+ for (var i = 0; i < tr.classList.length; i++) {
+ if (
+ tr.classList[i] == "notes_bulletin_row_ue" ||
+ tr.classList[i] == "notes_bulletin_row_sum_ects"
+ )
+ current = false;
+ }
+ if (current) {
+ if (new_state) {
+ tr.style.display = "none";
+ } else {
+ tr.style.display = "table-row";
+ }
+ }
+ }
+ tr = tr.nextSibling;
+ }
+ if (new_state) {
+ e.innerHTML =
+ '';
+ } else {
+ e.innerHTML =
+ '';
+ }
}
-
diff --git a/app/static/js/calabs.js b/app/static/js/calabs.js
index 50f4ff184..ebf64de98 100644
--- a/app/static/js/calabs.js
+++ b/app/static/js/calabs.js
@@ -12,13 +12,12 @@ var CURRENTWEEKCOLOR = "yellow";
// get all tr elements from this class
// (no getElementBuClassName)
-function getTRweek( week ) {
- var tablecal = document.getElementById('maincalendar');
- var all = tablecal.getElementsByTagName('tr');
- var res = [] ;
- for(var i=0; i < all.length; i++) {
- if (all[i].className == week)
- res[res.length] = all[i];
+function getTRweek(week) {
+ var tablecal = document.getElementById("maincalendar");
+ var all = tablecal.getElementsByTagName("tr");
+ var res = [];
+ for (var i = 0; i < all.length; i++) {
+ if (all[i].className == week) res[res.length] = all[i];
}
return res;
}
@@ -26,14 +25,13 @@ function getTRweek( week ) {
var HIGHLIGHTEDCELLS = [];
function deselectweeks() {
-
- for(var i=0; i < HIGHLIGHTEDCELLS.length; i++) {
+ for (var i = 0; i < HIGHLIGHTEDCELLS.length; i++) {
var row = rows[i];
if (row) {
- if (row.className.match('currentweek')) {
- row.style.backgroundColor = CURRENTWEEKCOLOR;
+ if (row.className.match("currentweek")) {
+ row.style.backgroundColor = CURRENTWEEKCOLOR;
} else {
- row.style.backgroundColor = WEEKDAYCOLOR;
+ row.style.backgroundColor = WEEKDAYCOLOR;
}
rows[i] = null;
}
@@ -44,11 +42,11 @@ function deselectweeks() {
function highlightweek(el) {
deselectweeks();
var week = el.className;
- if ((week == 'wkend') || (week.substring(0,2) != 'wk')) {
+ if (week == "wkend" || week.substring(0, 2) != "wk") {
return; /* does not hightlight weekends */
}
rows = getTRweek(week);
- for (var i=0; i < rows.length; i++) {
+ for (var i = 0; i < rows.length; i++) {
var row = rows[i];
row.style.backgroundColor = DAYHIGHLIGHT;
HIGHLIGHTEDCELLS[HIGHLIGHTEDCELLS.length] = row;
@@ -58,7 +56,7 @@ function highlightweek(el) {
// click on a day
function wclick(el) {
monday = el.className;
- form = document.getElementById('formw');
- form.datelundi.value = monday.substr(2).replace(/_/g,'/').split(' ')[0];
+ form = document.getElementById("formw");
+ form.datelundi.value = monday.substr(2).replace(/_/g, "/").split(" ")[0];
form.submit();
}
diff --git a/app/static/js/config_logos.js b/app/static/js/config_logos.js
index 56b7cd27d..8c129da1e 100644
--- a/app/static/js/config_logos.js
+++ b/app/static/js/config_logos.js
@@ -1,6 +1,5 @@
function submit_form() {
- $("#config_logos_form").submit();
+ $("#config_logos_form").submit();
}
-$(function () {
-})
\ No newline at end of file
+$(function () {});
diff --git a/app/static/js/detail_summary_persistence.js b/app/static/js/detail_summary_persistence.js
index 1a8848896..0b5645e65 100644
--- a/app/static/js/detail_summary_persistence.js
+++ b/app/static/js/detail_summary_persistence.js
@@ -13,70 +13,70 @@ les balises (fermées par défaut sauf si attribut open déjà activé dans le c
*/
-const ID_ATTRIBUTE = "ds_id"
+const ID_ATTRIBUTE = "ds_id";
function genere_id(detail, idnum) {
- let id = "ds_" + idnum;
- if (detail.getAttribute("id")) {
- id = "#" + detail.getAttribute("id");
- }
- detail.setAttribute(ID_ATTRIBUTE, id);
- return id;
+ let id = "ds_" + idnum;
+ if (detail.getAttribute("id")) {
+ id = "#" + detail.getAttribute("id");
+ }
+ detail.setAttribute(ID_ATTRIBUTE, id);
+ return id;
}
// remise à l'état initial. doit être exécuté dès le chargement de la page pour que l'état 'open'
// des balises soit celui indiqué par le serveur (et donc indépendant du localstorage)
function reset_detail(detail, id) {
- let opened = detail.getAttribute("open");
- if (opened) {
- detail.setAttribute("open", true);
- localStorage.setItem(id, true);
- } else {
- detail.removeAttribute("open");
- localStorage.setItem(id, false);
- }
+ let opened = detail.getAttribute("open");
+ if (opened) {
+ detail.setAttribute("open", true);
+ localStorage.setItem(id, true);
+ } else {
+ detail.removeAttribute("open");
+ localStorage.setItem(id, false);
+ }
}
function restore_detail(detail, id) {
- let status = localStorage.getItem(id);
- if (status == "true") {
- detail.setAttribute("open", true);
- } else {
- detail.removeAttribute("open");
- }
+ let status = localStorage.getItem(id);
+ if (status == "true") {
+ detail.setAttribute("open", true);
+ } else {
+ detail.removeAttribute("open");
+ }
}
function add_listener(detail) {
- detail.addEventListener('toggle', (e) => {
- let id = e.target.getAttribute(ID_ATTRIBUTE);
- let ante = e.target.getAttribute("open");
- if (ante == null) {
- localStorage.setItem(id, false);
- } else {
- localStorage.setItem(id, true);
- }
- e.stopPropagation();
- })
+ detail.addEventListener("toggle", (e) => {
+ let id = e.target.getAttribute(ID_ATTRIBUTE);
+ let ante = e.target.getAttribute("open");
+ if (ante == null) {
+ localStorage.setItem(id, false);
+ } else {
+ localStorage.setItem(id, true);
+ }
+ e.stopPropagation();
+ });
}
function reset_ds() {
- let idnum = 0;
- keepDetails = true;
- details = document.querySelectorAll("details")
- details.forEach(function (detail) {
- let id = genere_id(detail, idnum);
- console.log("Processing " + id)
- if (keepDetails) {
- restore_detail(detail, id);
- } else {
- reset_detail(detail, id);
- }
- add_listener(detail);
- idnum++;
- });
+ let idnum = 0;
+ keepDetails = true;
+ details = document.querySelectorAll("details");
+ details.forEach(function (detail) {
+ let id = genere_id(detail, idnum);
+ console.log("Processing " + id);
+ if (keepDetails) {
+ restore_detail(detail, id);
+ } else {
+ reset_detail(detail, id);
+ }
+ add_listener(detail);
+ idnum++;
+ });
}
-window.addEventListener('load', function() {
- console.log("details/summary persistence ON");
- reset_ds();
-})
+window.addEventListener("load", function () {
+ console.log("details/summary persistence ON");
+ reset_ds();
+});
diff --git a/app/static/js/edit_partition_form.js b/app/static/js/edit_partition_form.js
index 9d4b7fd92..c92090177 100644
--- a/app/static/js/edit_partition_form.js
+++ b/app/static/js/edit_partition_form.js
@@ -1,38 +1,32 @@
-
-
function _partition_set_attr(partition_id, attr_name, attr_value) {
- $.post(SCO_URL + '/partition_set_attr',
- {
- 'partition_id': partition_id,
- 'attr': attr_name,
- 'value': attr_value
- },
- function (result) {
- sco_message(result);
- });
- return;
+ $.post(
+ SCO_URL + "/partition_set_attr",
+ {
+ partition_id: partition_id,
+ attr: attr_name,
+ value: attr_value,
+ },
+ function (result) {
+ sco_message(result);
+ }
+ );
+ return;
}
// Met à jour bul_show_rank lorsque checkbox modifiees:
function update_rk(e) {
- var partition_id = $(e).attr('data-partition_id');
- var v;
- if (e.checked)
- v = '1';
- else
- v = '0';
- _partition_set_attr(partition_id, 'bul_show_rank', v);
+ var partition_id = $(e).attr("data-partition_id");
+ var v;
+ if (e.checked) v = "1";
+ else v = "0";
+ _partition_set_attr(partition_id, "bul_show_rank", v);
}
-
function update_show_in_list(e) {
- var partition_id = $(e).attr('data-partition_id');
- var v;
- if (e.checked)
- v = '1';
- else
- v = '0';
+ var partition_id = $(e).attr("data-partition_id");
+ var v;
+ if (e.checked) v = "1";
+ else v = "0";
- _partition_set_attr(partition_id, 'show_in_lists', v);
+ _partition_set_attr(partition_id, "show_in_lists", v);
}
-
diff --git a/app/static/js/edit_ue.js b/app/static/js/edit_ue.js
index 488d5ea94..ef4dc60c9 100644
--- a/app/static/js/edit_ue.js
+++ b/app/static/js/edit_ue.js
@@ -1,63 +1,72 @@
// Affiche et met a jour la liste des UE partageant le meme code
$().ready(function () {
- if (document.querySelector("#tf_ue_id")) {
- /* fonctions spécifiques pour edition UE */
- update_ue_list();
- $("#tf_ue_code").bind("keyup", update_ue_list);
+ if (document.querySelector("#tf_ue_id")) {
+ /* fonctions spécifiques pour edition UE */
+ update_ue_list();
+ $("#tf_ue_code").bind("keyup", update_ue_list);
- $("select#tf_type").change(function () {
- update_bonus_description();
- });
- update_bonus_description();
- }
+ $("select#tf_type").change(function () {
+ update_bonus_description();
+ });
+ update_bonus_description();
+ }
});
function update_bonus_description() {
- var ue_type = $("#tf_type")[0].value;
- if (ue_type == "1") { /* UE SPORT */
- $("#bonus_description").show();
- var query = "/ScoDoc/get_bonus_description/default";
- $.get(query, '', function (data) {
- $("#bonus_description").html(data);
- });
- } else {
- $("#bonus_description").html("");
- $("#bonus_description").hide();
- }
+ var ue_type = $("#tf_type")[0].value;
+ if (ue_type == "1") {
+ /* UE SPORT */
+ $("#bonus_description").show();
+ var query = "/ScoDoc/get_bonus_description/default";
+ $.get(query, "", function (data) {
+ $("#bonus_description").html(data);
+ });
+ } else {
+ $("#bonus_description").html("");
+ $("#bonus_description").hide();
+ }
}
function update_ue_list() {
- let ue_id = $("#tf_ue_id")[0].value;
- let ue_code = $("#tf_ue_code")[0].value;
- let query = SCO_URL + "/Notes/ue_sharing_code?ue_code=" + ue_code + "&hide_ue_id=" + ue_id + "&ue_id=" + ue_id;
- $.get(query, '', function (data) {
- $("#ue_list_code").html(data);
- });
+ let ue_id = $("#tf_ue_id")[0].value;
+ let ue_code = $("#tf_ue_code")[0].value;
+ let query =
+ SCO_URL +
+ "/Notes/ue_sharing_code?ue_code=" +
+ ue_code +
+ "&hide_ue_id=" +
+ ue_id +
+ "&ue_id=" +
+ ue_id;
+ $.get(query, "", function (data) {
+ $("#ue_list_code").html(data);
+ });
}
function set_ue_parcour(checkbox) {
- let url = checkbox.dataset.setter;
- const checkboxes = document.querySelectorAll('#choix_parcours input[type="checkbox"]:checked');
- const parcours_ids = [];
- checkboxes.forEach(function (checkbox) {
- parcours_ids.push(checkbox.value);
+ let url = checkbox.dataset.setter;
+ const checkboxes = document.querySelectorAll(
+ '#choix_parcours input[type="checkbox"]:checked'
+ );
+ const parcours_ids = [];
+ checkboxes.forEach(function (checkbox) {
+ parcours_ids.push(checkbox.value);
+ });
+
+ fetch(url, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(parcours_ids),
+ })
+ .then((response) => response.json())
+ .then((data) => {
+ if (data.status == 404) {
+ sco_error_message(data.message);
+ } else {
+ sco_message(data.message);
+ }
});
-
- fetch(url, {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(parcours_ids)
- })
- .then(response => response.json())
- .then(data => {
- if (data.status == 404) {
- sco_error_message(data.message);
- } else {
- sco_message(data.message);
- }
- });
}
-
diff --git a/app/static/js/etud_autocomplete.js b/app/static/js/etud_autocomplete.js
index 217707aaa..8f6e0bfa5 100644
--- a/app/static/js/etud_autocomplete.js
+++ b/app/static/js/etud_autocomplete.js
@@ -1,65 +1,68 @@
-
// Mécanisme d'auto-complétion (choix) d'un étudiant
// Il faut un champs #etudiant (text input) et à coté un champ hidden etudid qui sera rempli.
// utilise autoComplete.js, source https://tarekraafat.github.io/autoComplete.js
// EV 2023-06-01
function etud_autocomplete_config(with_dept = false) {
- return {
- selector: "#etudiant",
- placeHolder: "Nom...",
- threshold: 3,
- data: {
- src: async (query) => {
- try {
- // Fetch Data from external Source
- const source = await fetch(`/ScoDoc/api/etudiants/name/${query}`);
- // Data should be an array of `Objects` or `Strings`
- const data = await source.json();
- return data;
- } catch (error) {
- return error;
- }
- },
- // Data source 'Object' key to be searched
- keys: ["nom"]
+ return {
+ selector: "#etudiant",
+ placeHolder: "Nom...",
+ threshold: 3,
+ data: {
+ src: async (query) => {
+ try {
+ // Fetch Data from external Source
+ const source = await fetch(`/ScoDoc/api/etudiants/name/${query}`);
+ // Data should be an array of `Objects` or `Strings`
+ const data = await source.json();
+ return data;
+ } catch (error) {
+ return error;
+ }
+ },
+ // Data source 'Object' key to be searched
+ keys: ["nom"],
+ },
+ events: {
+ input: {
+ selection: (event) => {
+ const prenom = sco_capitalize(event.detail.selection.value.prenom);
+ const selection = with_dept
+ ? `${event.detail.selection.value.nom} ${prenom} (${event.detail.selection.value.dept_acronym})`
+ : `${event.detail.selection.value.nom} ${prenom}`;
+ // store etudid
+ const etudidField = document.getElementById("etudid");
+ etudidField.value = event.detail.selection.value.id;
+ autoCompleteJS.input.value = selection;
},
- events: {
- input: {
- selection: (event) => {
- const prenom = sco_capitalize(event.detail.selection.value.prenom);
- const selection = with_dept ? `${event.detail.selection.value.nom} ${prenom} (${event.detail.selection.value.dept_acronym})` : `${event.detail.selection.value.nom} ${prenom}`;
- // store etudid
- const etudidField = document.getElementById('etudid');
- etudidField.value = event.detail.selection.value.id;
- autoCompleteJS.input.value = selection;
- }
- }
- },
- resultsList: {
- element: (list, data) => {
- if (!data.results.length) {
- // Create "No Results" message element
- const message = document.createElement("div");
- // Add class to the created element
- message.setAttribute("class", "no_result");
- // Add message text content
- message.innerHTML = `Pas de résultat pour "${data.query}"`;
- // Append message element to the results list
- list.prepend(message);
- // Efface l'etudid
- const etudidField = document.getElementById('etudid');
- etudidField.value = "";
- }
- },
- noResults: true,
- },
- resultItem: {
- highlight: true,
- element: (item, data) => {
- const prenom = sco_capitalize(data.value.prenom);
- item.innerHTML += with_dept ? ` ${prenom} (${data.value.dept_acronym})` : ` ${prenom}`;
- },
- },
- }
+ },
+ },
+ resultsList: {
+ element: (list, data) => {
+ if (!data.results.length) {
+ // Create "No Results" message element
+ const message = document.createElement("div");
+ // Add class to the created element
+ message.setAttribute("class", "no_result");
+ // Add message text content
+ message.innerHTML = `Pas de résultat pour "${data.query}"`;
+ // Append message element to the results list
+ list.prepend(message);
+ // Efface l'etudid
+ const etudidField = document.getElementById("etudid");
+ etudidField.value = "";
+ }
+ },
+ noResults: true,
+ },
+ resultItem: {
+ highlight: true,
+ element: (item, data) => {
+ const prenom = sco_capitalize(data.value.prenom);
+ item.innerHTML += with_dept
+ ? ` ${prenom} (${data.value.dept_acronym})`
+ : ` ${prenom}`;
+ },
+ },
+ };
}
diff --git a/app/static/js/evaluations_recap.js b/app/static/js/evaluations_recap.js
index b3b60c3fb..3cedb7123 100644
--- a/app/static/js/evaluations_recap.js
+++ b/app/static/js/evaluations_recap.js
@@ -1,38 +1,37 @@
// Tableau recap evaluations du semestre
$(function () {
- $('table.evaluations_recap').DataTable(
- {
- paging: false,
- searching: true,
- info: false,
- autoWidth: false,
- fixedHeader: {
- header: true,
- footer: false
- },
- orderCellsTop: true, // cellules ligne 1 pour tri
- aaSorting: [], // Prevent initial sorting
- colReorder: true,
- "columnDefs": [
- {
- // colonne date, triable (XXX ne fonctionne pas)
- targets: ["date"],
- "type": "string",
- },
- ],
- dom: 'Bfrtip',
- buttons: [
- {
- extend: 'copyHtml5',
- text: 'Copier',
- exportOptions: { orthogonal: 'export' }
- },
- {
- extend: 'excelHtml5',
- exportOptions: { orthogonal: 'export' },
- title: document.querySelector('table.evaluations_recap').dataset.filename
- },
- ],
-
- })
+ $("table.evaluations_recap").DataTable({
+ paging: false,
+ searching: true,
+ info: false,
+ autoWidth: false,
+ fixedHeader: {
+ header: true,
+ footer: false,
+ },
+ orderCellsTop: true, // cellules ligne 1 pour tri
+ aaSorting: [], // Prevent initial sorting
+ colReorder: true,
+ columnDefs: [
+ {
+ // colonne date, triable (XXX ne fonctionne pas)
+ targets: ["date"],
+ type: "string",
+ },
+ ],
+ dom: "Bfrtip",
+ buttons: [
+ {
+ extend: "copyHtml5",
+ text: "Copier",
+ exportOptions: { orthogonal: "export" },
+ },
+ {
+ extend: "excelHtml5",
+ exportOptions: { orthogonal: "export" },
+ title: document.querySelector("table.evaluations_recap").dataset
+ .filename,
+ },
+ ],
+ });
});
diff --git a/app/static/js/export_results.js b/app/static/js/export_results.js
index ba117fa4a..e5be718bb 100644
--- a/app/static/js/export_results.js
+++ b/app/static/js/export_results.js
@@ -1,14 +1,11 @@
// Export table tous les resultats
// Menu choix parcours:
-$(function() {
- $('#parcours_sel').multiselect(
- {
- includeSelectAllOption: true,
- nonSelectedText:'Choisir le(s) parcours...',
- selectAllValue: '',
- numberDisplayed: 3,
- }
- );
+$(function () {
+ $("#parcours_sel").multiselect({
+ includeSelectAllOption: true,
+ nonSelectedText: "Choisir le(s) parcours...",
+ selectAllValue: "",
+ numberDisplayed: 3,
+ });
});
-
diff --git a/app/static/js/formation_recap.js b/app/static/js/formation_recap.js
index 0bcb009f4..6437cbf9a 100644
--- a/app/static/js/formation_recap.js
+++ b/app/static/js/formation_recap.js
@@ -3,26 +3,38 @@ var apo_ue_editor = null;
var apo_mod_editor = null;
$(document).ready(function () {
- var table_options = {
- "paging": false,
- "searching": false,
- "info": false,
- /* "autoWidth" : false, */
- "fixedHeader": {
- "header": true,
- "footer": true
- },
- "orderCellsTop": true, // cellules ligne 1 pour tri
- "aaSorting": [], // Prevent initial sorting
- };
- $('table#formation_table_recap').DataTable(table_options);
- let table_editable = document.querySelector("table#formation_table_recap.apo_editable");
- if (table_editable) {
- let apo_ue_save_url = document.querySelector("table#formation_table_recap.apo_editable").dataset.apo_ue_save_url;
- apo_ue_editor = new ScoFieldEditor("table#formation_table_recap tr.ue td.apo", apo_ue_save_url, false);
- let apo_mod_save_url = document.querySelector("table#formation_table_recap.apo_editable").dataset.apo_mod_save_url;
- apo_mod_editor = new ScoFieldEditor("table#formation_table_recap tr.mod td.apo", apo_mod_save_url, false);
- }
+ var table_options = {
+ paging: false,
+ searching: false,
+ info: false,
+ /* "autoWidth" : false, */
+ fixedHeader: {
+ header: true,
+ footer: true,
+ },
+ orderCellsTop: true, // cellules ligne 1 pour tri
+ aaSorting: [], // Prevent initial sorting
+ };
+ $("table#formation_table_recap").DataTable(table_options);
+ let table_editable = document.querySelector(
+ "table#formation_table_recap.apo_editable"
+ );
+ if (table_editable) {
+ let apo_ue_save_url = document.querySelector(
+ "table#formation_table_recap.apo_editable"
+ ).dataset.apo_ue_save_url;
+ apo_ue_editor = new ScoFieldEditor(
+ "table#formation_table_recap tr.ue td.apo",
+ apo_ue_save_url,
+ false
+ );
+ let apo_mod_save_url = document.querySelector(
+ "table#formation_table_recap.apo_editable"
+ ).dataset.apo_mod_save_url;
+ apo_mod_editor = new ScoFieldEditor(
+ "table#formation_table_recap tr.mod td.apo",
+ apo_mod_save_url,
+ false
+ );
+ }
});
-
-
diff --git a/app/static/js/formsemestre_edit.js b/app/static/js/formsemestre_edit.js
index 3394d659c..b763cc941 100644
--- a/app/static/js/formsemestre_edit.js
+++ b/app/static/js/formsemestre_edit.js
@@ -1,14 +1,13 @@
// Formulaire formsemestre_createwithmodules
function change_semestre_id() {
- var semestre_id = $("#tf_semestre_id")[0].value;
- for (var i = -1; i < 12; i++) {
- $(".sem" + i).hide();
- }
- $(".sem" + semestre_id).show();
+ var semestre_id = $("#tf_semestre_id")[0].value;
+ for (var i = -1; i < 12; i++) {
+ $(".sem" + i).hide();
+ }
+ $(".sem" + semestre_id).show();
}
-
-$(window).on('load', function () {
- change_semestre_id();
-});
\ No newline at end of file
+$(window).on("load", function () {
+ change_semestre_id();
+});
diff --git a/app/static/js/formsemestre_ext_edit_ue_validations.js b/app/static/js/formsemestre_ext_edit_ue_validations.js
index ed9576b52..571d27220 100644
--- a/app/static/js/formsemestre_ext_edit_ue_validations.js
+++ b/app/static/js/formsemestre_ext_edit_ue_validations.js
@@ -1,81 +1,83 @@
-
-
-
function compute_moyenne() {
- var notes = $(".tf_field_note input").map(
- function () { return parseFloat($(this).val()); }
- ).get();
- // les coefs sont donnes (ECTS en BUT)
- let coefs = $("form.tf_ext_edit_ue_validations").data("ue_coefs");
- // ou saisis (formations classiques)
- if (coefs == 'undefined') {
- coefs = $(".tf_field_coef input").map(
- function () { return parseFloat($(this).val()); }
- ).get();
+ var notes = $(".tf_field_note input")
+ .map(function () {
+ return parseFloat($(this).val());
+ })
+ .get();
+ // les coefs sont donnes (ECTS en BUT)
+ let coefs = $("form.tf_ext_edit_ue_validations").data("ue_coefs");
+ // ou saisis (formations classiques)
+ if (coefs == "undefined") {
+ coefs = $(".tf_field_coef input")
+ .map(function () {
+ return parseFloat($(this).val());
+ })
+ .get();
+ }
+ var N = notes.length;
+ var dp = 0;
+ var sum_coefs = 0;
+ for (var i = 0; i < N; i++) {
+ if (!(isNaN(notes[i]) || isNaN(coefs[i]))) {
+ dp += notes[i] * coefs[i];
+ sum_coefs += coefs[i];
}
- var N = notes.length;
- var dp = 0.;
- var sum_coefs = 0.;
- for (var i = 0; i < N; i++) {
- if (!(isNaN(notes[i]) || isNaN(coefs[i]))) {
- dp += notes[i] * coefs[i];
- sum_coefs += coefs[i];
- }
- }
- let moy = dp / sum_coefs;
- if (isNaN(moy)) {
- moy = "-";
- }
- if (typeof moy == "number") {
- moy = moy.toFixed(2);
- }
- return moy;
+ }
+ let moy = dp / sum_coefs;
+ if (isNaN(moy)) {
+ moy = "-";
+ }
+ if (typeof moy == "number") {
+ moy = moy.toFixed(2);
+ }
+ return moy;
}
// Callback select menu (UE code)
function enable_disable_fields_cb() {
- enable_disable_fields(this);
+ enable_disable_fields(this);
}
function enable_disable_fields(select_elt) {
- // input fields controled by this menu
- var input_fields = $(select_elt).parent().parent().find('input:not(.ext_coef_disabled)');
- var disabled = false;
- if ($(select_elt).val() === "None") {
- disabled = true;
+ // input fields controled by this menu
+ var input_fields = $(select_elt)
+ .parent()
+ .parent()
+ .find("input:not(.ext_coef_disabled)");
+ var disabled = false;
+ if ($(select_elt).val() === "None") {
+ disabled = true;
+ }
+ input_fields.each(function () {
+ if (disabled) {
+ let cur_value = $(this).val();
+ $(this).data("saved-value", cur_value);
+ $(this).val("");
+ } else {
+ let saved_value = $(this).data("saved-value");
+ if (typeof saved_value == "undefined") {
+ saved_value = "";
+ }
+ if (saved_value) {
+ $(this).val(saved_value);
+ }
}
- input_fields.each(function () {
- if (disabled) {
- let cur_value = $(this).val();
- $(this).data('saved-value', cur_value);
- $(this).val("");
- } else {
- let saved_value = $(this).data('saved-value');
- if (typeof saved_value == 'undefined') {
- saved_value = '';
- }
- if (saved_value) {
- $(this).val(saved_value);
- }
- }
- });
- input_fields.prop('disabled', disabled);
+ });
+ input_fields.prop("disabled", disabled);
}
function setup_text_fields() {
- $(".ueext_valid_select").each(
- function () {
- enable_disable_fields(this);
- }
- );
+ $(".ueext_valid_select").each(function () {
+ enable_disable_fields(this);
+ });
}
$().ready(function () {
- $(".tf_ext_edit_ue_validations").change(function () {
- $(".ext_sem_moy_val")[0].innerHTML = compute_moyenne();
- });
- $("form.tf_ext_edit_ue_validations input").blur(function () {
- $(".ext_sem_moy_val")[0].innerHTML = compute_moyenne();
- });
- $(".ueext_valid_select").change(enable_disable_fields_cb);
+ $(".tf_ext_edit_ue_validations").change(function () {
+ $(".ext_sem_moy_val")[0].innerHTML = compute_moyenne();
+ });
+ $("form.tf_ext_edit_ue_validations input").blur(function () {
+ $(".ext_sem_moy_val")[0].innerHTML = compute_moyenne();
+ });
+ $(".ueext_valid_select").change(enable_disable_fields_cb);
- setup_text_fields();
+ setup_text_fields();
});
diff --git a/app/static/js/groups_view.js b/app/static/js/groups_view.js
index 28bbeeba5..74433b643 100644
--- a/app/static/js/groups_view.js
+++ b/app/static/js/groups_view.js
@@ -1,225 +1,213 @@
// Affichage progressif du trombinoscope html
$().ready(function () {
- var spans = $(".unloaded_img");
- for (var i = 0; i < spans.length; i++) {
- var sp = spans[i];
- var etudid = sp.id;
- $(sp).load(SCO_URL + "/etud_photo_html?etudid=" + etudid);
- }
+ var spans = $(".unloaded_img");
+ for (var i = 0; i < spans.length; i++) {
+ var sp = spans[i];
+ var etudid = sp.id;
+ $(sp).load(SCO_URL + "/etud_photo_html?etudid=" + etudid);
+ }
});
// L'URL pour recharger l'état courant de la page (groupes et tab selectionnes)
// (ne fonctionne que pour les requetes GET: manipule la query string)
function groups_view_url() {
- var url = $.url();
- delete url.param()["group_ids"]; // retire anciens groupes de l'URL
- delete url.param()["curtab"]; // retire ancien tab actif
- if (CURRENT_TAB_HASH) {
- url.param()["curtab"] = CURRENT_TAB_HASH;
- }
- delete url.param()["formsemestre_id"];
- url.param()["formsemestre_id"] =
- $("#group_selector")[0].formsemestre_id.value;
+ var url = $.url();
+ delete url.param()["group_ids"]; // retire anciens groupes de l'URL
+ delete url.param()["curtab"]; // retire ancien tab actif
+ if (CURRENT_TAB_HASH) {
+ url.param()["curtab"] = CURRENT_TAB_HASH;
+ }
+ delete url.param()["formsemestre_id"];
+ url.param()["formsemestre_id"] =
+ $("#group_selector")[0].formsemestre_id.value;
- var selected_groups = $("#group_selector select").val();
- url.param()["group_ids"] = selected_groups; // remplace par groupes selectionnes
+ var selected_groups = $("#group_selector select").val();
+ url.param()["group_ids"] = selected_groups; // remplace par groupes selectionnes
- return url;
+ return url;
}
// Sélectionne le groupe "tous" et recharge la page:
function select_groupe_tous() {
- var url = groups_view_url();
- var default_group_id = $("#group_selector")[0].default_group_id.value;
- delete url.param()["group_ids"];
- url.param()["group_ids"] = [default_group_id];
+ var url = groups_view_url();
+ var default_group_id = $("#group_selector")[0].default_group_id.value;
+ delete url.param()["group_ids"];
+ url.param()["group_ids"] = [default_group_id];
- var query_string = $.param(url.param(), (traditional = true));
- window.location = url.attr("base") + url.attr("path") + "?" + query_string;
+ var query_string = $.param(url.param(), (traditional = true));
+ window.location = url.attr("base") + url.attr("path") + "?" + query_string;
}
// Recharge la page sans arguments group_ids
function remove_group_filter() {
- var url = groups_view_url();
- delete url.param()["group_ids"];
- var query_string = $.param(url.param(), (traditional = true));
- window.location = url.attr("base") + url.attr("path") + "?" + query_string;
+ var url = groups_view_url();
+ delete url.param()["group_ids"];
+ var query_string = $.param(url.param(), (traditional = true));
+ window.location = url.attr("base") + url.attr("path") + "?" + query_string;
}
// L'URL pour l'état courant de la page:
function get_current_url() {
- var url = groups_view_url();
- var query_string = $.param(url.param(), (traditional = true));
- return url.attr("base") + url.attr("path") + "?" + query_string;
+ var url = groups_view_url();
+ var query_string = $.param(url.param(), (traditional = true));
+ return url.attr("base") + url.attr("path") + "?" + query_string;
}
// Recharge la page en changeant les groupes selectionnés et en conservant le tab actif:
function submit_group_selector() {
- window.location = get_current_url();
+ window.location = get_current_url();
}
function show_current_tab() {
- if (document.getElementsByClassName("nav-tabs").length < 0) {
- $('.nav-tabs [href="#' + CURRENT_TAB_HASH + '"]').tab("show");
- }
+ if (document.getElementsByClassName("nav-tabs").length > 0) {
+ $('.nav-tabs [href="#' + CURRENT_TAB_HASH + '"]').tab("show");
+ }
}
var CURRENT_TAB_HASH = $.url().param()["curtab"];
$().ready(function () {
- $(".nav-tabs a").on("shown.bs.tab", function (e) {
- CURRENT_TAB_HASH = e.target.hash.slice(1); // sans le #
- });
+ $(".nav-tabs a").on("shown.bs.tab", function (e) {
+ CURRENT_TAB_HASH = e.target.hash.slice(1); // sans le #
+ });
- show_current_tab();
+ show_current_tab();
});
function change_list_options() {
- var url = groups_view_url();
- var selected_options = $("#group_list_options").val();
- var options = [
- "with_paiement",
- "with_archives",
- "with_annotations",
- "with_codes",
- "with_bourse",
- ];
- for (var i = 0; i < options.length; i++) {
- var option = options[i];
- delete url.param()[option];
- if ($.inArray(option, selected_options) >= 0) {
- url.param()[option] = 1;
- }
+ var url = groups_view_url();
+ var selected_options = $("#group_list_options").val();
+ var options = [
+ "with_paiement",
+ "with_archives",
+ "with_annotations",
+ "with_codes",
+ "with_bourse",
+ ];
+ for (var i = 0; i < options.length; i++) {
+ var option = options[i];
+ delete url.param()[option];
+ if ($.inArray(option, selected_options) >= 0) {
+ url.param()[option] = 1;
}
- var query_string = $.param(url.param(), (traditional = true));
- window.location = url.attr("base") + url.attr("path") + "?" + query_string;
+ }
+ var query_string = $.param(url.param(), (traditional = true));
+ window.location = url.attr("base") + url.attr("path") + "?" + query_string;
}
// Menu choix groupe:
function toggle_visible_etuds() {
- //
- $(".etud_elem").hide();
- var qargs = "";
- $("#group_ids_sel option:selected").each(function (index, opt) {
- var group_id = opt.value;
- $(".group-" + group_id).show();
- qargs += "&group_ids=" + group_id;
- });
- // Update url saisie tableur:
- var input_eval = $("#formnotes_evaluation_id");
- if (input_eval.length > 0) {
- var evaluation_id = input_eval[0].value;
- $("#menu_saisie_tableur a").attr(
- "href",
- "saisie_notes_tableur?evaluation_id=" + evaluation_id + qargs
- );
- // lien feuille excel:
- $("#lnk_feuille_saisie").attr(
- "href",
- "feuille_saisie_notes?evaluation_id=" + evaluation_id + qargs
- );
- }
- // Update champs form group_ids_str
- let group_ids_str = Array.from(
- document.querySelectorAll("#group_ids_sel option:checked")
- )
- .map(function (elem) {
- return elem.value;
- })
- .join();
- document
- .querySelectorAll("input.group_ids_str")
- .forEach((elem) => (elem.value = group_ids_str));
+ //
+ $(".etud_elem").hide();
+ var qargs = "";
+ $("#group_ids_sel option:selected").each(function (index, opt) {
+ var group_id = opt.value;
+ $(".group-" + group_id).show();
+ qargs += "&group_ids=" + group_id;
+ });
+ // Update url saisie tableur:
+ var input_eval = $("#formnotes_evaluation_id");
+ if (input_eval.length > 0) {
+ var evaluation_id = input_eval[0].value;
+ $("#menu_saisie_tableur a").attr(
+ "href",
+ "saisie_notes_tableur?evaluation_id=" + evaluation_id + qargs
+ );
+ // lien feuille excel:
+ $("#lnk_feuille_saisie").attr(
+ "href",
+ "feuille_saisie_notes?evaluation_id=" + evaluation_id + qargs
+ );
+ }
+ // Update champs form group_ids_str
+ let group_ids_str = Array.from(
+ document.querySelectorAll("#group_ids_sel option:checked")
+ )
+ .map(function (elem) {
+ return elem.value;
+ })
+ .join();
+ document
+ .querySelectorAll("input.group_ids_str")
+ .forEach((elem) => (elem.value = group_ids_str));
}
$().ready(function () {
- $("#group_ids_sel").multiselect({
- includeSelectAllOption: false,
- nonSelectedText: "choisir...",
- // buttonContainer: '',
- onChange: function (element, checked) {
- // Gestion du groupe "tous"
- if (
- checked == true &&
- $("#group_ids_sel").hasClass("default_deselect_others")
- ) {
- var default_group_id = $(".default_group")[0].value;
+ $("#group_ids_sel").multiselect({
+ includeSelectAllOption: false,
+ nonSelectedText: "choisir...",
+ // buttonContainer: '',
+ onChange: function (element, checked) {
+ // Gestion du groupe "tous"
+ if (
+ checked == true &&
+ $("#group_ids_sel").hasClass("default_deselect_others")
+ ) {
+ var default_group_id = $(".default_group")[0].value;
- if (element.hasClass("default_group")) {
- // click sur groupe "tous"
- // deselectionne les autres
- $("#group_ids_sel option:selected").each(function (
- index,
- opt
- ) {
- if (opt.value != default_group_id) {
- $("#group_ids_sel").multiselect(
- "deselect",
- opt.value
- );
- }
- });
- } else {
- // click sur un autre item
- // si le groupe "tous" est selectionne et que l'on coche un autre, le deselectionner
- var default_is_selected = false;
- $("#group_ids_sel option:selected").each(function (
- index,
- opt
- ) {
- if (opt.value == default_group_id) {
- default_is_selected = true;
- return false;
- }
- });
- if (default_is_selected) {
- $("#group_ids_sel").multiselect(
- "deselect",
- default_group_id
- );
- }
- }
+ if (element.hasClass("default_group")) {
+ // click sur groupe "tous"
+ // deselectionne les autres
+ $("#group_ids_sel option:selected").each(function (index, opt) {
+ if (opt.value != default_group_id) {
+ $("#group_ids_sel").multiselect("deselect", opt.value);
}
-
- toggle_visible_etuds();
- // referme le menu apres chaque choix:
- $("#group_selector .btn-group").removeClass("open");
-
- if ($("#group_ids_sel").hasClass("submit_on_change")) {
- submit_group_selector();
+ });
+ } else {
+ // click sur un autre item
+ // si le groupe "tous" est selectionne et que l'on coche un autre, le deselectionner
+ var default_is_selected = false;
+ $("#group_ids_sel option:selected").each(function (index, opt) {
+ if (opt.value == default_group_id) {
+ default_is_selected = true;
+ return false;
}
- },
- });
+ });
+ if (default_is_selected) {
+ $("#group_ids_sel").multiselect("deselect", default_group_id);
+ }
+ }
+ }
- // initial setup
- toggle_visible_etuds();
+ toggle_visible_etuds();
+ // referme le menu apres chaque choix:
+ $("#group_selector .btn-group").removeClass("open");
+
+ if ($("#group_ids_sel").hasClass("submit_on_change")) {
+ submit_group_selector();
+ }
+ },
+ });
+
+ // initial setup
+ toggle_visible_etuds();
});
// Trombinoscope
$().ready(function () {
- var elems = $(".trombi-photo");
- for (var i = 0; i < elems.length; i++) {
- $(elems[i]).qtip({
- content: {
- ajax: {
- url:
- SCO_URL +
- "/etud_info_html?with_photo=0&etudid=" +
- get_etudid_from_elem(elems[i]),
- },
- text: "Loading...",
- },
- position: {
- at: "right",
- my: "left top",
- },
- style: {
- classes: "qtip-etud",
- },
- // utile pour debugguer le css:
- // hide: { event: 'unfocus' }
- });
- }
+ var elems = $(".trombi-photo");
+ for (var i = 0; i < elems.length; i++) {
+ $(elems[i]).qtip({
+ content: {
+ ajax: {
+ url:
+ SCO_URL +
+ "/etud_info_html?with_photo=0&etudid=" +
+ get_etudid_from_elem(elems[i]),
+ },
+ text: "Loading...",
+ },
+ position: {
+ at: "right",
+ my: "left top",
+ },
+ style: {
+ classes: "qtip-etud",
+ },
+ // utile pour debugguer le css:
+ // hide: { event: 'unfocus' }
+ });
+ }
});
diff --git a/app/static/js/jury_but.js b/app/static/js/jury_but.js
index c53b223ad..945e93333 100644
--- a/app/static/js/jury_but.js
+++ b/app/static/js/jury_but.js
@@ -1,88 +1,90 @@
-
-
// active les menus des codes "manuels" (année, RCUEs)
function enable_manual_codes(elt) {
- $(".jury_but select.manual").prop("disabled", !elt.checked);
+ $(".jury_but select.manual").prop("disabled", !elt.checked);
}
// changement d'un menu code:
function change_menu_code(elt) {
- // Ajuste styles pour visualiser codes enregistrés/modifiés
- if (elt.value != elt.dataset.orig_code) {
- elt.parentElement.parentElement.classList.add("modified");
- } else {
- elt.parentElement.parentElement.classList.remove("modified");
- }
- if (elt.value == elt.dataset.orig_recorded) {
- elt.parentElement.parentElement.classList.add("recorded");
- } else {
- elt.parentElement.parentElement.classList.remove("recorded");
- }
- // Si RCUE passant en ADJ, change les menus des UEs associées ADJR
- if (elt.classList.contains("code_rcue")
- && elt.dataset.niveau_id
- && elt.value == "ADJ"
- && elt.value != elt.dataset.orig_recorded) {
- let ue_selects = elt.parentElement.parentElement.parentElement.querySelectorAll(
- "select.ue_rcue_" + elt.dataset.niveau_id);
- ue_selects.forEach(select => {
- if (select.value != "ADM") {
- select.value = "ADJR";
- change_menu_code(select); // pour changer les styles
- }
- });
- }
+ // Ajuste styles pour visualiser codes enregistrés/modifiés
+ if (elt.value != elt.dataset.orig_code) {
+ elt.parentElement.parentElement.classList.add("modified");
+ } else {
+ elt.parentElement.parentElement.classList.remove("modified");
+ }
+ if (elt.value == elt.dataset.orig_recorded) {
+ elt.parentElement.parentElement.classList.add("recorded");
+ } else {
+ elt.parentElement.parentElement.classList.remove("recorded");
+ }
+ // Si RCUE passant en ADJ, change les menus des UEs associées ADJR
+ if (
+ elt.classList.contains("code_rcue") &&
+ elt.dataset.niveau_id &&
+ elt.value == "ADJ" &&
+ elt.value != elt.dataset.orig_recorded
+ ) {
+ let ue_selects =
+ elt.parentElement.parentElement.parentElement.querySelectorAll(
+ "select.ue_rcue_" + elt.dataset.niveau_id
+ );
+ ue_selects.forEach((select) => {
+ if (select.value != "ADM") {
+ select.value = "ADJR";
+ change_menu_code(select); // pour changer les styles
+ }
+ });
+ }
}
$(function () {
- // Recupère la liste ordonnées des etudids
- // pour avoir le "suivant" et le "précédent"
- // (liens de navigation)
- const url = new URL(document.URL);
- const frags = url.pathname.split("/"); // .../formsemestre_validation_but/formsemestre_id/etudid
- const etudid = frags[frags.length - 1];
- const formsemestre_id = frags[frags.length - 2];
- const etudids_key = JSON.stringify(["etudids", url.origin, formsemestre_id]);
- const etudids_str = localStorage.getItem(etudids_key);
- const noms_key = JSON.stringify(["noms", url.origin, formsemestre_id]);
- const noms_str = localStorage.getItem(noms_key);
- if (etudids_str && noms_str) {
- const etudids = JSON.parse(etudids_str);
- const noms = JSON.parse(noms_str);
- const cur_idx = etudids.indexOf(etudid);
- let prev_idx = -1;
- let next_idx = -1
- if (cur_idx != -1) {
- if (cur_idx > 0) {
- prev_idx = cur_idx - 1;
- }
- if (cur_idx < etudids.length - 1) {
- next_idx = cur_idx + 1;
- }
- }
- if (prev_idx != -1) {
- let elem = document.querySelector("div.prev a");
- if (elem) {
- elem.href = elem.href.replace("PREV", etudids[prev_idx]);
- elem.innerHTML = noms[prev_idx];
- }
- } else {
- document.querySelector("div.prev").innerHTML = "";
- }
- if (next_idx != -1) {
- let elem = document.querySelector("div.next a");
- if (elem) {
- elem.href = elem.href.replace("NEXT", etudids[next_idx]);
- elem.innerHTML = noms[next_idx];
- }
- } else {
- document.querySelector("div.next").innerHTML = "";
- }
- } else {
- // Supprime les liens de navigation
- document.querySelector("div.prev").innerHTML = "";
- document.querySelector("div.next").innerHTML = "";
+ // Recupère la liste ordonnées des etudids
+ // pour avoir le "suivant" et le "précédent"
+ // (liens de navigation)
+ const url = new URL(document.URL);
+ const frags = url.pathname.split("/"); // .../formsemestre_validation_but/formsemestre_id/etudid
+ const etudid = frags[frags.length - 1];
+ const formsemestre_id = frags[frags.length - 2];
+ const etudids_key = JSON.stringify(["etudids", url.origin, formsemestre_id]);
+ const etudids_str = localStorage.getItem(etudids_key);
+ const noms_key = JSON.stringify(["noms", url.origin, formsemestre_id]);
+ const noms_str = localStorage.getItem(noms_key);
+ if (etudids_str && noms_str) {
+ const etudids = JSON.parse(etudids_str);
+ const noms = JSON.parse(noms_str);
+ const cur_idx = etudids.indexOf(etudid);
+ let prev_idx = -1;
+ let next_idx = -1;
+ if (cur_idx != -1) {
+ if (cur_idx > 0) {
+ prev_idx = cur_idx - 1;
+ }
+ if (cur_idx < etudids.length - 1) {
+ next_idx = cur_idx + 1;
+ }
}
+ if (prev_idx != -1) {
+ let elem = document.querySelector("div.prev a");
+ if (elem) {
+ elem.href = elem.href.replace("PREV", etudids[prev_idx]);
+ elem.innerHTML = noms[prev_idx];
+ }
+ } else {
+ document.querySelector("div.prev").innerHTML = "";
+ }
+ if (next_idx != -1) {
+ let elem = document.querySelector("div.next a");
+ if (elem) {
+ elem.href = elem.href.replace("NEXT", etudids[next_idx]);
+ elem.innerHTML = noms[next_idx];
+ }
+ } else {
+ document.querySelector("div.next").innerHTML = "";
+ }
+ } else {
+ // Supprime les liens de navigation
+ document.querySelector("div.prev").innerHTML = "";
+ document.querySelector("div.next").innerHTML = "";
+ }
});
// ----- Etat du formulaire jury pour éviter sortie sans enregistrer
@@ -91,29 +93,31 @@ let IS_SUBMITTING = false;
// Une chaine décrivant l'état du form
function get_form_state() {
- let codes = [];
- // il n'y a que des