This commit is contained in:
2026-09-28 22:12:38 +02:00
parent b96f188a59
commit 2cc768f1fd
24 changed files with 962 additions and 78 deletions
+17 -1
View File
@@ -7,6 +7,16 @@ window.escapeHtmlUpload = window.escapeHtmlUpload || ((unsafe) => {
.replace(/'/g, "'");
});
// Manual approval: after an upload, send the uploader to their status page focused on the new item
window.f0ckGoToPending = window.f0ckGoToPending || ((id) => {
const target = '/pending' + (id ? '#i' + id : '');
if (typeof window.loadPageAjax === 'function') {
window.loadPageAjax(target, false, { bypassCache: true, skipCache: true, skipInherit: true });
} else {
window.location.href = target;
}
});
// ============================================================
// URL Upload Tracker — single panel, active jobs only
// ============================================================
@@ -3002,6 +3012,8 @@ window.initUploadForm = (selector) => {
}
}
if (lastData?.manual_approval && lastData?.itemid) window.f0ckGoToPending(lastData.itemid);
// URL uploads: redirect or stay based on user preference (pending/async jobs skip redirect)
if (!lastData?.pending && !lastData?.manual_approval) {
if (lastData?.itemid && window.NotificationSystemInstance && typeof window.NotificationSystemInstance.handleNewItem === 'function') {
@@ -3416,7 +3428,11 @@ window.initUploadForm = (selector) => {
window.location.href = targetUrl;
}
}
// else: stay on current page (including manual_approval pending)
if (lastData?.manual_approval) {
const pendingItem = lastData || (uploadedResults && uploadedResults[0]);
window.f0ckGoToPending(pendingItem && pendingItem.itemid);
}
// else (redirect disabled): stay on current page
}
} else {
restoreBtn();