disable adding/updating prokers after approval

This commit is contained in:
nugroho 2025-06-26 16:00:32 +07:00
parent b892cfea28
commit b02ea14b7b
2 changed files with 2 additions and 0 deletions

View File

@ -55,6 +55,7 @@
if (selector) return $(thisDialog.box).find(selector); if (selector) return $(thisDialog.box).find(selector);
return $(thisDialog.box); return $(thisDialog.box);
} }
console.log(prokers);
µ('#targetUnit').change(()=>{ µ('#targetUnit').change(()=>{
µ('.forDay').prop("hidden", µ('#targetUnit').val() != "0"); µ('.forDay').prop("hidden", µ('#targetUnit').val() != "0");
µ('.forMonth').prop("hidden", µ('#targetUnit').val() != "1"); µ('.forMonth').prop("hidden", µ('#targetUnit').val() != "1");

View File

@ -135,6 +135,7 @@
$('#proker #pkContent').prop("hidden", prokers.length < 1); $('#proker #pkContent').prop("hidden", prokers.length < 1);
$('#proker #pkContent').empty(); $('#proker #pkContent').empty();
const listedProkers = prokers.filter(e=>e.year == Number($('#pkYear').val())); const listedProkers = prokers.filter(e=>e.year == Number($('#pkYear').val()));
$('#newProker').prop("disabled",((listedProkers.length > 0 && listedProkers[0].year < (new Date()).getFullYear())) ||(listedProkers.length > 0 && listedProkers[0].year <= (new Date()).getFullYear() && listedProkers[0].journal.at(-1).status > 1));
$('#submitProker').prop("disabled",!(listedProkers.length > 0 && listedProkers[0].journal.at(-1).status < 2)); $('#submitProker').prop("disabled",!(listedProkers.length > 0 && listedProkers[0].journal.at(-1).status < 2));
const statusStyles =[ const statusStyles =[
"text-align: center; background-color: var(--secondary-foreground); color: var(--primary-background)", "text-align: center; background-color: var(--secondary-foreground); color: var(--primary-background)",