feat: add exact shifts display in worker details and update HTML export functionality
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -1783,9 +1783,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>
|
||||
|
||||
Reference in New Issue
Block a user