${diskHtml}
`;
}
function last14days() {
const out = [];
const base = todayIso();
for (let i = 13; i >= 0; i--) out.push(isoAddDays(base, -i));
return out;
}
function renderActivity(activity) {
const map = {};
activity.forEach(a => { map[a.d] = a.n; });
const days = last14days().map(iso => {
return { iso, label: fmtDayMonthIso(iso), n: map[iso] || 0 };
});
const max = Math.max(1, ...days.map(x => x.n));
const todayKey = todayIso();
document.getElementById('activityChart').innerHTML = days.map(x => `
${x.label}
`).join('');
}
function dashThumb(p) {
if (typeof p === 'string' && p.startsWith('/uploads/')) return `${API}/uploads/thumb/${p.slice('/uploads/'.length)}`;
return thumbSrc(p);
}
function renderRecent(rows) {
const el = document.getElementById('recentList');
if (!rows.length) { el.innerHTML = '
${steps.map((s, i) => {
const related = (s.key === 'shorts' && Array.isArray(s.related) && s.related.length) ? s.related : [];
const title = related.length
? 'Короткие сообщения найдены, но не засчитаны: ' + related.map(r => r.resident + ' (' + r.lesson_date + (r.reason === 'date' ? ', другая дата' : ', другой автор') + ')').join('; ')
: 'Нажмите, чтобы переключить статус';
return `${s.done ? '✓' : (related.length ? '⚠' : '○')} ${esc(s.label)}${related.length ? ' (' + related.length + ')' : ''}`;
}).join('')}
${t.shorts_related && t.shorts_related.length ? `
⚠ Короткие сообщения найдены (${t.shorts_related.length}), но не засчитаны: ${t.shorts_related.map(r => esc(r.resident) + ' — ' + esc(r.lesson_date) + (r.reason === 'date' ? ' (другая дата)' : ' (другой автор)')).join(', ')}. Проверьте дату и автора.
` : ''}
`;
}).join('');
renderIcons();
}
function renderLessons(rows) {
const el = document.getElementById('lessonList');
if (!el) return;
if (!rows.length) { el.innerHTML = '
`;
}).join('');
}
function renderDigest(rows) {
const el = document.getElementById('dashDigest');
if (!el) return;
if (!rows.length) { el.innerHTML = '