This commit is contained in:
naielv
2025-08-23 17:05:17 +02:00
parent 357166b159
commit 63546605f2
6 changed files with 85 additions and 44 deletions

View File

@@ -4,6 +4,7 @@ PAGES.materiales = {
AccessControl: true,
Title: "Materiales",
edit: function (mid) {
if (!checkRole("materiales:edit")) {setUrlHash("index");return}
var nameh1 = safeuuid();
var field_nombre = safeuuid();
var field_cantidad = safeuuid();
@@ -109,6 +110,7 @@ PAGES.materiales = {
};
},
index: function () {
if (!checkRole("materiales")) {setUrlHash("index");return}
var btn_new = safeuuid();
container.innerHTML = `
<h1>Materiales</h1>
@@ -145,9 +147,12 @@ PAGES.materiales = {
undefined,
true // Enable global search bar
);
document.getElementById(btn_new).onclick = () => {
setUrlHash("materiales," + safeuuid(""));
};
if (!checkRole("materiales:edit")) {
document.getElementById(btn_new).style.display = "none"
} else {
document.getElementById(btn_new).onclick = () => {
setUrlHash("materiales," + safeuuid(""));
};
}
},
};