${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 = '
⚠ Короткие сообщения найдены (${t.shorts_related.length}), но не засчитаны: ${t.shorts_related.map(r => esc(r.resident) + ' — ' + esc(r.lesson_date) + (r.reason === 'date' ? ' (другая дата)' : ' (другой автор)')).join(', ')}. Проверьте дату и автора.
` : ''}
${t.closed
? ``
: ``}
`;
}).join('');
renderIcons();
}
function renderLessons(rows) {
const el = document.getElementById('lessonList');
if (!el) return;
if (!rows.length) { el.innerHTML = '