feat: add exact shifts display in worker details and update HTML export functionality

This commit is contained in:
Ross
2026-07-08 22:38:38 +01:00
parent 0f31dfe1a9
commit 13c5ae598a
4 changed files with 66 additions and 5 deletions
+10
View File
@@ -445,9 +445,19 @@ $("#rota-table tr td:first-child").each((n, td) => {
function viewWorker(worker) {
ds = worker.dataset;
let exactShiftsText = "(none)";
if (ds.exactShifts) {
try {
let parsed = JSON.parse(ds.exactShifts);
if (Object.keys(parsed).length > 0) {
exactShiftsText = Object.entries(parsed).map(([s, c]) => `${s}: ${c}`).join(", ");
}
} catch(e) {}
}
dlg = $(`<div class='dialog' title='${ds.worker}'>
Site: ${ds.site}</br>
FTE: ${ds.fte} (${ds.fte_adj})</br>
Exact shifts: ${exactShiftsText}</br>
Start date: ${ds.start_date}</br>
End date: ${ds.end_date}</br>
Non working days: ${ds.nwds}</br>