fix: Improve form submission redirection logic for iOS and update navigation link formatting
This commit is contained in:
@@ -156,11 +156,14 @@ function fixIOSFormSubmission() {
|
|||||||
// Show success and redirect
|
// Show success and redirect
|
||||||
alert(data.message || 'Element erfolgreich hinzugefügt');
|
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) {
|
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 {
|
} else {
|
||||||
window.location.href = '/home_admin';
|
window.location.href = redirectTarget;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Show error
|
// Show error
|
||||||
|
|||||||
@@ -536,7 +536,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<a class="nav-mobile-action nav-btn primary" href="{{ url_for('login') }}">Login</a>
|
<a class="nav-mobile-action nav-btn primary" href="{{ url_for('login') }}">Login</a>
|
||||||
<a class="nav-mobile-action nav-btn" href="{{ url_for('register') }}">Registrieren</a>
|
<a class="nav-mobile-action nav-btn" href="{{ url_for('register') }}">Registrieren</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-actions">
|
<div class="nav-actions">
|
||||||
<a class="nav-btn primary" href="{{ url_for('team') }}">Team</a>
|
<a class="nav-btn primary" href="{{ url_for('team') }}">Team</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user