Modify SCO_URL in all js: no trailing slash.

This commit is contained in:
Emmanuel Viennet 2024-04-10 18:40:32 +02:00
parent 58b831513d
commit 9bd05ea241
16 changed files with 32 additions and 32 deletions

View File

@ -1,6 +1,6 @@
function _partition_set_attr(partition_id, attr_name, attr_value) {
$.post(
SCO_URL + "/partition_set_attr",
SCO_URL + "partition_set_attr",
{
partition_id: partition_id,
attr: attr_name,

View File

@ -33,7 +33,7 @@ function update_ue_list() {
let ue_code = $("#tf_ue_code")[0].value;
let query =
SCO_URL +
"/Notes/ue_sharing_code?ue_code=" +
"Notes/ue_sharing_code?ue_code=" +
ue_code +
"&hide_ue_id=" +
ue_id +

View File

@ -16,7 +16,7 @@ function display_itemsuivis(active) {
.off("click")
.click(function (e) {
e.preventDefault();
$.post(SCO_URL + "/itemsuivi_create", {
$.post(SCO_URL + "itemsuivi_create", {
etudid: etudid,
fmt: "json",
}).done(item_insert_new);
@ -26,7 +26,7 @@ function display_itemsuivis(active) {
}
// add existing items
$.get(
SCO_URL + "/itemsuivi_list_etud",
SCO_URL + "itemsuivi_list_etud",
{ etudid: etudid, fmt: "json" },
function (L) {
for (var i in L) {
@ -95,7 +95,7 @@ function item_nodes(itemsuivi_id, item_date, situation, tags, readonly) {
dp.blur(function (e) {
var date = this.value;
// console.log('selected text: ' + date);
$.post(SCO_URL + "/itemsuivi_set_date", {
$.post(SCO_URL + "itemsuivi_set_date", {
item_date: date,
itemsuivi_id: itemsuivi_id,
});
@ -103,7 +103,7 @@ function item_nodes(itemsuivi_id, item_date, situation, tags, readonly) {
dp.datepicker({
onSelect: function (date, instance) {
// console.log('selected: ' + date + 'for itemsuivi_id ' + itemsuivi_id);
$.post(SCO_URL + "/itemsuivi_set_date", {
$.post(SCO_URL + "itemsuivi_set_date", {
item_date: date,
itemsuivi_id: itemsuivi_id,
});
@ -161,7 +161,7 @@ function Date2DMY(date) {
}
function itemsuivi_suppress(itemsuivi_id) {
$.post(SCO_URL + "/itemsuivi_suppress", { itemsuivi_id: itemsuivi_id });
$.post(SCO_URL + "itemsuivi_suppress", { itemsuivi_id: itemsuivi_id });
// Clear items and rebuild:
$("ul.listdebouches li.itemsuivi").remove();
display_itemsuivis(0);

View File

@ -37,7 +37,7 @@ $().ready(function () {
ajax: {
url:
SCO_URL +
"/etud_info_html?etudid=" +
"etud_info_html?etudid=" +
get_etudid_from_elem(elems[i]) +
qs,
type: "GET",

View File

@ -19,7 +19,7 @@ function loadGroupes() {
$("#gmsg")[0].style.display = "block";
var partition_id = document.formGroup.partition_id.value;
$.get(SCO_URL + "/XMLgetGroupsInPartition", {
$.get(SCO_URL + "XMLgetGroupsInPartition", {
partition_id: partition_id,
}).done(function (data) {
var nodes = data.getElementsByTagName("group");
@ -384,7 +384,7 @@ function handleError(msg) {
}
function submitGroups() {
var url = SCO_URL + "/setGroups";
var url = SCO_URL + "setGroups";
// build post request body: groupname \n etudid; ...
var groupsLists = "";
var groupsToCreate = "";
@ -443,7 +443,7 @@ function GotoAnother() {
} else
document.location =
SCO_URL +
"/affect_groups?partition_id=" +
"affect_groups?partition_id=" +
document.formGroup.other_partition_id.value;
}

View File

@ -5,7 +5,7 @@ $().ready(function () {
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);
$(sp).load(SCO_URL + "etud_photo_html?etudid=" + etudid);
}
});
@ -194,7 +194,7 @@ $().ready(function () {
ajax: {
url:
SCO_URL +
"/etud_info_html?with_photo=0&etudid=" +
"etud_info_html?with_photo=0&etudid=" +
get_etudid_from_elem(elems[i]),
},
text: "Loading...",

View File

@ -34,7 +34,7 @@ function get_notes_and_draw(formsemestre_id, etudid) {
*/
var query =
SCO_URL +
"/Notes/formsemestre_bulletinetud?formsemestre_id=" +
"Notes/formsemestre_bulletinetud?formsemestre_id=" +
formsemestre_id +
"&etudid=" +
etudid +

View File

@ -42,7 +42,7 @@ async function save_note(elem, v, etudid) {
$("#sco_msg").html("en cours...").show();
try {
const response = await fetch(
SCO_URL + "/../api/evaluation/" + evaluation_id + "/notes/set",
SCO_URL + "../api/evaluation/" + evaluation_id + "/notes/set",
{
method: "POST",
headers: {

View File

@ -6,7 +6,7 @@ $(function () {
delay: 300, // wait 300ms before suggestions
minLength: 2, // min nb of chars before suggest
position: { collision: "flip" }, // automatic menu position up/down
source: SCO_URL + "/search_etud_by_name",
source: SCO_URL + "search_etud_by_name",
select: function (event, ui) {
$(".in-expnom").val(ui.item.value);
$("#form-chercheetud").submit();

View File

@ -5,6 +5,6 @@ $().ready(function () {
for (var i = 0; i < spans.size(); i++) {
var sp = spans[i];
var etudid = sp.id;
$(sp).load(SCO_URL + "/etud_photo_html?etudid=" + etudid);
$(sp).load(SCO_URL + "etud_photo_html?etudid=" + etudid);
}
});

View File

@ -22,7 +22,7 @@ document.addEventListener("DOMContentLoaded", () => {
async function delete_validation(etudid, validation_type, validation_id) {
const response = await fetch(
`${SCO_URL}/../api/etudiant/${etudid}/jury/${validation_type}/${validation_id}/delete`,
`${SCO_URL}../api/etudiant/${etudid}/jury/${validation_type}/${validation_id}/delete`,
{
method: "POST",
}
@ -38,7 +38,7 @@ async function delete_validation(etudid, validation_type, validation_id) {
function update_ue_list() {
var ue_id = $("#tf_ue_id")[0].value;
if (ue_id) {
var query = SCO_URL + "/Notes/ue_sharing_code?ue_id=" + ue_id;
var query = SCO_URL + "Notes/ue_sharing_code?ue_id=" + ue_id;
$.get(query, "", function (data) {
$("#ue_list_code").html(data);
});

View File

@ -335,7 +335,7 @@ Calendrier de l'assiduité
document.querySelectorAll('[assi_id]').forEach((el, i) => {
el.addEventListener('click', () => {
const assi_id = el.getAttribute('assi_id');
window.open(`${SCO_URL}/Assiduites/tableau_assiduite_actions?type=assiduite&action=details&obj_id=${assi_id}`);
window.open(`${SCO_URL}Assiduites/tableau_assiduite_actions?type=assiduite&action=details&obj_id=${assi_id}`);
})
});

View File

@ -102,6 +102,6 @@
<script src="{{scu.STATIC_DIR}}/js/scodoc.js"></script>
<script>
const SCO_URL = "{% if g.scodoc_dept %}{{
url_for('scolar.index_html', scodoc_dept=g.scodoc_dept)[:-11] }}{% endif %}";
url_for('scolar.index_html', scodoc_dept=g.scodoc_dept)}}{% endif %}";
</script>
{% endblock %}

View File

@ -152,7 +152,7 @@ document.addEventListener('DOMContentLoaded', function() {
calendar = new Calendar(container, options);
fetch(`${SCO_URL}/../api/formsemestre/{{formsemestre.id}}/edt?{{groups_query_args|safe}}&show_modules_titles={{show_modules_titles}}`)
fetch(`${SCO_URL}../api/formsemestre/{{formsemestre.id}}/edt?{{groups_query_args|safe}}&show_modules_titles={{show_modules_titles}}`)
.then(r=>{return r.json()})
.then(events=>{
if (typeof events == 'string') {

View File

@ -132,7 +132,7 @@ document.addEventListener('DOMContentLoaded', () => {
const v_id = event.target.dataset.v_id;
const validation_type = event.target.dataset.type;
if (confirm("Supprimer cette validation ?")) {
fetch(`${SCO_URL}/../api/etudiant/${etudid}/jury/${validation_type}/${v_id}/delete`,
fetch(`${SCO_URL}../api/etudiant/${etudid}/jury/${validation_type}/${v_id}/delete`,
{
method: "POST",
}).then(response => {

View File

@ -51,7 +51,7 @@
<script>
window.onload = function () { enableTooltips("gtrcontent") };
const SCO_URL = "{{ url_for('scolar.index_html', scodoc_dept=g.scodoc_dept)[:-11] }}";
const SCO_URL = "{{ url_for('scolar.index_html', scodoc_dept=g.scodoc_dept) }}";
</script>
{% endblock %}