tidy up some cimar stuff

This commit is contained in:
Ross
2025-03-24 10:19:43 +00:00
parent e27d45f3c5
commit bcc449eb34
4 changed files with 40 additions and 11 deletions
+10 -1
View File
@@ -13,8 +13,17 @@ window.control_pressed = false;
$(document).ready(function () {
document.body.addEventListener("htmx:responseError", function(e) {
let error = e.detail.xhr.response;
let el = document.getElementById("htmx-error");
var error;
if (e.detail.pathInfo.requestPath.includes("cimar") && e.detail.xhr.status == 403) {
error = "Cimar permission error, please login and refresh the page.";
//document.getElementById("cimar-login-form").focus();
htmx.trigger("#cimar-login-needed", "cimar-login-needed");
} else {
error = e.detail.xhr.response;
}
el.innerHTML = error;
el.classList.remove("hidden");
});