From 4f07da0b41bbb02db66365bdb01df876d6765dba Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 6 Jan 2024 14:32:06 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20=C3=A9dition=20config.=20via=20l'API=20(?= =?UTF-8?q?routes)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/assiduites/pages/config_assiduites.j2 | 2 +- app/templates/scodoc/{role_editor.j2 => config_roles.j2} | 2 +- app/views/scodoc.py | 2 +- sco_version.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename app/templates/scodoc/{role_editor.j2 => config_roles.j2} (97%) diff --git a/app/templates/assiduites/pages/config_assiduites.j2 b/app/templates/assiduites/pages/config_assiduites.j2 index a0203d70d..1b71738ed 100644 --- a/app/templates/assiduites/pages/config_assiduites.j2 +++ b/app/templates/assiduites/pages/config_assiduites.j2 @@ -41,7 +41,7 @@ function update_test_button_state() { async function load_ics_sample() { var edt_id = document.getElementById('test_edt_id').value; try { - const response = await fetch(`${SCO_URL}/../ics_raw_sample/${edt_id}`); + const response = await fetch(`/ScoDoc/ics_raw_sample/${edt_id}`); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } diff --git a/app/templates/scodoc/role_editor.j2 b/app/templates/scodoc/config_roles.j2 similarity index 97% rename from app/templates/scodoc/role_editor.j2 rename to app/templates/scodoc/config_roles.j2 index 9439887b8..a0681b12d 100644 --- a/app/templates/scodoc/role_editor.j2 +++ b/app/templates/scodoc/config_roles.j2 @@ -79,7 +79,7 @@ Les rôles en gras sont les rôles standards de ScoDoc. async function associe_role_permission(event) { // /role//add_permission/" const method = event.target.checked ? "/add_permission/" : "/remove_permission/"; - const url = `${SCO_URL}/../api/role/${event.target.dataset.role}${method}${event.target.dataset.permission}`; + const url = `/ScoDoc/api/role/${event.target.dataset.role}${method}${event.target.dataset.permission}`; try { const response = await fetch( url, diff --git a/app/views/scodoc.py b/app/views/scodoc.py index 720007eb1..bfd49c1fc 100644 --- a/app/views/scodoc.py +++ b/app/views/scodoc.py @@ -155,7 +155,7 @@ def config_roles(): permissions_names = sorted(Permission.permission_by_value.values()) roles = Role.query.order_by(Role.name).all() return render_template( - "scodoc/role_editor.j2", + "scodoc/config_roles.j2", Permission=Permission, permissions_names=permissions_names, roles=roles, diff --git a/sco_version.py b/sco_version.py index 526737817..8d330985d 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.6.74" +SCOVERSION = "9.6.75" SCONAME = "ScoDoc"