1
0
forked from ScoDoc/ScoDoc

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) { function _partition_set_attr(partition_id, attr_name, attr_value) {
$.post( $.post(
SCO_URL + "/partition_set_attr", SCO_URL + "partition_set_attr",
{ {
partition_id: partition_id, partition_id: partition_id,
attr: attr_name, attr: attr_name,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,6 +5,6 @@ $().ready(function () {
for (var i = 0; i < spans.size(); i++) { for (var i = 0; i < spans.size(); i++) {
var sp = spans[i]; var sp = spans[i];
var etudid = sp.id; 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) { async function delete_validation(etudid, validation_type, validation_id) {
const response = await fetch( 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", method: "POST",
} }
@ -38,7 +38,7 @@ async function delete_validation(etudid, validation_type, validation_id) {
function update_ue_list() { function update_ue_list() {
var ue_id = $("#tf_ue_id")[0].value; var ue_id = $("#tf_ue_id")[0].value;
if (ue_id) { 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) { $.get(query, "", function (data) {
$("#ue_list_code").html(data); $("#ue_list_code").html(data);
}); });

View File

@ -149,7 +149,7 @@ Calendrier de l'assiduité
list-style-type: none; list-style-type: none;
} }
.pageContent { .pageContent {
margin-top: 1vh; margin-top: 1vh;
@ -335,7 +335,7 @@ Calendrier de l'assiduité
document.querySelectorAll('[assi_id]').forEach((el, i) => { document.querySelectorAll('[assi_id]').forEach((el, i) => {
el.addEventListener('click', () => { el.addEventListener('click', () => {
const assi_id = el.getAttribute('assi_id'); 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 src="{{scu.STATIC_DIR}}/js/scodoc.js"></script>
<script> <script>
const SCO_URL = "{% if g.scodoc_dept %}{{ 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> </script>
{% endblock %} {% endblock %}

View File

@ -152,7 +152,7 @@ document.addEventListener('DOMContentLoaded', function() {
calendar = new Calendar(container, options); 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(r=>{return r.json()})
.then(events=>{ .then(events=>{
if (typeof events == 'string') { if (typeof events == 'string') {

View File

@ -17,8 +17,8 @@ et permet de les effacer une par une.
<p class="help"> <p class="help">
<b>Attention</b>, il vous appartient de vérifier la cohérence du résultat ! <b>Attention</b>, il vous appartient de vérifier la cohérence du résultat !
En principe, <b>l'usage de cette page devrait rester exceptionnel</b>. En principe, <b>l'usage de cette page devrait rester exceptionnel</b>.
Aucune annulation n'est ici possible (vous devrez re-saisir les décisions via les Aucune annulation n'est ici possible (vous devrez re-saisir les décisions via les
pages de saisie de jury habituelles). pages de saisie de jury habituelles).
</p> </p>
{% if sem_vals.first() %} {% if sem_vals.first() %}
<div class="jury_decisions_list jury_decisions_sems"> <div class="jury_decisions_list jury_decisions_sems">
@ -27,7 +27,7 @@ pages de saisie de jury habituelles).
{% for v in sem_vals %} {% for v in sem_vals %}
<li>{{v.html()|safe}} <li>{{v.html()|safe}}
<form> <form>
<button <button
data-v_id="{{v.id}}" data-type="validation_formsemestre" data-etudid="{{etud.id}}" data-v_id="{{v.id}}" data-type="validation_formsemestre" data-etudid="{{etud.id}}"
>effacer</button></form> >effacer</button></form>
</li> </li>
@ -101,8 +101,8 @@ pages de saisie de jury habituelles).
{% endif %} {% endif %}
{% if not( {% if not(
sem_vals.first() or ue_vals.first() or rcue_vals.first() sem_vals.first() or ue_vals.first() or rcue_vals.first()
or annee_but_vals.first() or autorisations.first()) or annee_but_vals.first() or autorisations.first())
%} %}
<div> <div>
<p class="fontred">aucune décision enregistrée</p> <p class="fontred">aucune décision enregistrée</p>
@ -123,7 +123,7 @@ pages de saisie de jury habituelles).
<script> <script>
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const buttons = document.querySelectorAll('.jury_decisions_list button'); const buttons = document.querySelectorAll('.jury_decisions_list button');
buttons.forEach(button => { buttons.forEach(button => {
button.addEventListener('click', (event) => { button.addEventListener('click', (event) => {
// Handle button click event here // Handle button click event here
@ -132,10 +132,10 @@ document.addEventListener('DOMContentLoaded', () => {
const v_id = event.target.dataset.v_id; const v_id = event.target.dataset.v_id;
const validation_type = event.target.dataset.type; const validation_type = event.target.dataset.type;
if (confirm("Supprimer cette validation ?")) { 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", method: "POST",
}).then(response => { }).then(response => {
// Handle the response // Handle the response
if (response.ok) { if (response.ok) {
location.reload(); location.reload();

View File

@ -51,7 +51,7 @@
<script> <script>
window.onload = function () { enableTooltips("gtrcontent") }; 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> </script>
{% endblock %} {% endblock %}