diff --git a/VERSION b/VERSION index 10f3c0c..b2f381e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.04-beta +0.4.05-beta diff --git a/public/js/admin.js b/public/js/admin.js index faa901d..6d63607 100644 --- a/public/js/admin.js +++ b/public/js/admin.js @@ -1359,21 +1359,30 @@ const loose = USERS.filter(u=>["teacher","admin","pupil"].includes(u.role) && u.schoolId==null); if(loose.length) group("gnoschool", T("amNoSchoolGroup"), loose); }else{ - /* één school gekozen: groepeer op rol, leerlingen per klas */ + /* één school gekozen: groepeer op rol, leerlingen per klas - elke groep + krijgt direct een "snel toevoegen"-formulier eronder (net als bij + systeemmanagers), zodat een nieuwe schoolbeheerder/leerkracht/ + leerling niet via een ander tabblad hoeft. Een groep zonder leden + blijft zichtbaar zolang er wél iets aan toegevoegd kan worden - + anders is een lege klas nergens te vinden om iemand aan toe te voegen. */ [["admin", T("roleAdmin")], ["teacher", T("roleTeacher")]].forEach(([role, label])=>{ const us = USERS.filter(u=>u.role===role); - if(us.length) group("role:"+role, label, us, true); + if(us.length || creatableRoles().includes(role)) group("role:"+role, label, us, true); + if(creatableRoles().includes(role)) list.appendChild(addForm(role)); }); const pupils = USERS.filter(u=>u.role==="pupil"); if(currentUser.role==="teacher"){ - if(pupils.length) group("pupils", T("amPupils"), pupils, true); + if(pupils.length || creatableRoles().includes("pupil")) group("pupils", T("amPupils"), pupils, true); + if(creatableRoles().includes("pupil")) list.appendChild(addForm("pupil")); }else{ CLASSES.forEach(c=>{ const us = pupils.filter(u=>u.classId===c.id); - if(us.length) group("class:"+c.id, c.name, us, true); + if(us.length || creatableRoles().includes("pupil")) group("class:"+c.id, c.name, us, true); + if(creatableRoles().includes("pupil")) list.appendChild(addForm("pupil", c.id)); }); const noClass = pupils.filter(u=>!u.classId); - if(noClass.length) group("class:none", T("amNoClass"), noClass, true); + if(noClass.length || creatableRoles().includes("pupil")) group("class:none", T("amNoClass"), noClass, true); + if(creatableRoles().includes("pupil")) list.appendChild(addForm("pupil")); } const parents = USERS.filter(u=>u.role==="parent"); if(parents.length) group("parents", T("amParents"), parents); diff --git a/public/js/core.js b/public/js/core.js index 7434622..6614e6c 100644 --- a/public/js/core.js +++ b/public/js/core.js @@ -2,7 +2,7 @@ "use strict"; /* version — shown until /api/version resolves (or if the fetch fails, e.g. offline). Kept in sync by hand with the VERSION file at the repo root on every release. */ -const VERSION = "0.4.04-beta"; +const VERSION = "0.4.05-beta"; (function(){ const tag = document.getElementById("verTag"); tag.textContent = "v"+VERSION;