fix: schoolbeheerder zichtbaar als groepsleiding + A+-knop verspringt niet meer (v0.4.22-beta)
All checks were successful
dev - build & deploy naar test / build-and-deploy (push) Successful in 36s
All checks were successful
dev - build & deploy naar test / build-and-deploy (push) Successful in 36s
- Een schoolbeheerder (of systeemmanager) die aan een klas gekoppeld werd, kwam daar niet zichtbaar te staan: de klas-detailweergave en de staf-telling op de klastegel filterden op role==="teacher", terwijl de server al sinds v0.3.38 elke stafrol (teacher/admin/super) toestaat in class_teachers. Puur een weergavebug op de client - de koppeling zelf werkte al goed. Nieuwe isClassStaff()-helper matcht nu exact de serverkant se toegestane rollenset. - De "+" in de A+-zoomknop (toolbar én het per-widget contentzoom-knopje) gebruikte de CJK-volle-breedte "+" (U+FF0B) naast de gewone letter "A" - dat teken valt vermoedelijk terug op een ander lettertype dan Quicksand, waardoor de relatieve positie t.o.v. de "A" verspringt zodra document.body.style.zoom verandert. Vervangen door de gewone ASCII "+" (net als de A−-knop al een normaal minteken gebruikt, niet de volle- breedte variant).
This commit is contained in:
parent
9920fd3855
commit
8b57922307
5 changed files with 13 additions and 7 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
0.4.21-beta
|
||||
0.4.22-beta
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
<button class="tbtn ghost" id="btnMute">🔊</button>
|
||||
<button class="tbtn ghost" id="btnZoomOut">A−</button>
|
||||
<button class="tbtn ghost" id="zoomPct">100%</button>
|
||||
<button class="tbtn ghost" id="btnZoomIn">A+</button>
|
||||
<button class="tbtn ghost" id="btnZoomIn">A+</button>
|
||||
<div class="spacer"></div>
|
||||
<button class="tbtn ghost" id="btnImages">🖼️</button>
|
||||
<button class="tbtn ghost" id="btnFolders">📁</button>
|
||||
|
|
|
|||
|
|
@ -48,6 +48,12 @@
|
|||
const creatableRoles = () =>
|
||||
[...new Set([currentUser.role, ...(currentUser.extraRoles||[])].flatMap(r => CREATABLE_ROLES[r] || []))];
|
||||
|
||||
/* wie er als groepsleiding aan een klas gekoppeld kan staan - zelfde rollenset
|
||||
als de server accepteert in POST /admin/classes/:id/teachers (niet alleen
|
||||
"teacher": een schoolbeheerder of systeemmanager mag ook aan een klas
|
||||
gekoppeld worden, en moet dan ook als zodanig getoond worden). */
|
||||
const isClassStaff = u => ["teacher","admin","super"].includes(u.role);
|
||||
|
||||
const esc = s => String(s ?? "").replace(/&/g,"&").replace(/</g,"<");
|
||||
const h = (tag, cls, text)=>{
|
||||
const el = document.createElement(tag);
|
||||
|
|
@ -1084,7 +1090,7 @@
|
|||
onClick: ()=>{ navLevel = { type:"flat", kind:"requests" }; render(); } }));
|
||||
}
|
||||
CLASSES.forEach(c=>{
|
||||
const staff = USERS.filter(u=>u.role==="teacher" && (u.classIds||[]).some(id=>Number(id)===Number(c.id))).length;
|
||||
const staff = USERS.filter(u=>isClassStaff(u) && (u.classIds||[]).some(id=>Number(id)===Number(c.id))).length;
|
||||
const cp = pupils.filter(u=>u.classId===c.id).length;
|
||||
grid.appendChild(tile({ label:c.name, stats:[{text:`🧑🏫 ${staff}`},{text:`🧒 ${cp}`}],
|
||||
onClick: ()=>{ navLevel = { type:"class", id:c.id }; kebabOpen = false; render(); } }));
|
||||
|
|
@ -1125,7 +1131,7 @@
|
|||
panel.appendChild(titleRow);
|
||||
if(kebabOpen && canManageClasses) panel.appendChild(classActionsPanel(c, otherSchools));
|
||||
|
||||
const staff = USERS.filter(u=>u.role==="teacher" && (u.classIds||[]).some(id=>Number(id)===Number(c.id)));
|
||||
const staff = USERS.filter(u=>isClassStaff(u) && (u.classIds||[]).some(id=>Number(id)===Number(c.id)));
|
||||
panel.appendChild(h("p","am-section-label", T("roleTeacher")));
|
||||
panel.appendChild(peopleList(staff));
|
||||
if(creatableRoles().includes("teacher")) panel.appendChild(addForm("teacher", c.id));
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ function makeWidget(def, saved){
|
|||
const lockBtn = document.createElement("button"); lockBtn.className="wmin wlock"; lockBtn.textContent="🔓"; head.appendChild(lockBtn);
|
||||
const previewBtn = document.createElement("button"); previewBtn.className="wmin wpreview"; previewBtn.textContent="◉"; head.appendChild(previewBtn);
|
||||
const zBtn = document.createElement("button");
|
||||
zBtn.className = "wmin wz"; zBtn.textContent = "A+";
|
||||
zBtn.className = "wmin wz"; zBtn.textContent = "A+";
|
||||
head.appendChild(zBtn);
|
||||
const minBtn = document.createElement("button");
|
||||
minBtn.className = "wmin"; minBtn.textContent = "–";
|
||||
|
|
@ -194,7 +194,7 @@ function makeWidget(def, saved){
|
|||
function applyWZ(){
|
||||
body.style.zoom = wz;
|
||||
win.dataset.wz = wz;
|
||||
zBtn.textContent = wz===1 ? "A+" : Math.round(wz*100)+"%";
|
||||
zBtn.textContent = wz===1 ? "A+" : Math.round(wz*100)+"%";
|
||||
zBtn.classList.toggle("on", wz!==1);
|
||||
zBtn.title = T("wZoom");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.21-beta";
|
||||
const VERSION = "0.4.22-beta";
|
||||
(function(){
|
||||
const tag = document.getElementById("verTag");
|
||||
tag.textContent = "v"+VERSION;
|
||||
|
|
|
|||
Loading…
Reference in a new issue