diff --git a/osinaweb/osinacore/templates/add-edit-main.html b/osinaweb/osinacore/templates/add-edit-main.html index 27f9481b..6c117e33 100644 --- a/osinaweb/osinacore/templates/add-edit-main.html +++ b/osinaweb/osinacore/templates/add-edit-main.html @@ -21,7 +21,7 @@

You are Currently Offline

- diff --git a/osinaweb/osinacore/templates/main.html b/osinaweb/osinacore/templates/main.html index 25e9f28f..7d1851c5 100644 --- a/osinaweb/osinacore/templates/main.html +++ b/osinaweb/osinacore/templates/main.html @@ -26,7 +26,7 @@

You are Currently Offline

- diff --git a/osinaweb/static/js/switch-status.js b/osinaweb/static/js/switch-status.js index fd05b9e2..891480bb 100644 --- a/osinaweb/static/js/switch-status.js +++ b/osinaweb/static/js/switch-status.js @@ -3,7 +3,9 @@ document.addEventListener('DOMContentLoaded', function () { document.getElementById('goOnlineButton').addEventListener('click', function () { var xhr = new XMLHttpRequest(); - xhr.open('GET', "{% url 'go_online' %}", true); + // Access the URL from the data attribute + var url = this.getAttribute('data-url'); + xhr.open('GET', url, true); xhr.onload = function () { if (xhr.status === 200) { // If the request is successful, reload the top window @@ -14,4 +16,4 @@ document.addEventListener('DOMContentLoaded', function () { }; xhr.send(); }); -}); \ No newline at end of file +});