diff --git a/Website/static/js/ios_fixes.js b/Website/static/js/ios_fixes.js index 906992c..221a2bb 100644 --- a/Website/static/js/ios_fixes.js +++ b/Website/static/js/ios_fixes.js @@ -156,11 +156,14 @@ function fixIOSFormSubmission() { // Show success and redirect alert(data.message || 'Element erfolgreich hinzugefügt'); - // Redirect to the appropriate page + // Redirect back to the configured target or the current page + const redirectTarget = form.dataset.successRedirect || form.dataset.redirectUrl || window.location.pathname; if (data.itemId) { - window.location.href = `/home_admin?highlight_item=${data.itemId}`; + const redirectUrl = new URL(redirectTarget, window.location.origin); + redirectUrl.searchParams.set('highlight_item', data.itemId); + window.location.href = redirectUrl.toString(); } else { - window.location.href = '/home_admin'; + window.location.href = redirectTarget; } } else { // Show error diff --git a/Website/templates/base.html b/Website/templates/base.html index 328fbc5..b67e9d4 100644 --- a/Website/templates/base.html +++ b/Website/templates/base.html @@ -536,7 +536,7 @@ {% else %} Login Registrieren - {% endif %} + {% endif %}