feat(post-lesson): подсказка при несчитанных коротких сообщениях (ошибка даты/автора)

This commit is contained in:
dev
2026-11-03 12:06:24 +03:00
parent c2ef292237
commit 6685800cf4
5 changed files with 48 additions and 3 deletions
+8 -1
View File
@@ -187,8 +187,15 @@ function renderPostLessonTasks(rows) {
<span class="top-count">${completed}/${steps.length}</span>
</div>
<div class="post-task-steps">
${steps.map((s, i) => `<span class="post-task-step ${s.done ? 'done' : ''} ${i === nextIdx ? 'next' : ''}" data-task-key="${esc(t.key)}" data-step-key="${esc(s.key)}" style="cursor:pointer" title="Нажмите, чтобы переключить статус">${s.done ? '✓' : '○'} ${esc(s.label)}</span>`).join('')}
${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 `<span class="post-task-step ${s.done ? 'done' : ''} ${i === nextIdx ? 'next' : ''} ${(!s.done && related.length) ? 'warn' : ''}" data-task-key="${esc(t.key)}" data-step-key="${esc(s.key)}" style="cursor:pointer" title="${esc(title)}">${s.done ? '✓' : (related.length ? '⚠' : '○')} ${esc(s.label)}${related.length ? ' (' + related.length + ')' : ''}</span>`;
}).join('')}
</div>
${t.shorts_related && t.shorts_related.length ? `<div class="post-task-hint">⚠ Короткие сообщения найдены (${t.shorts_related.length}), но не засчитаны: ${t.shorts_related.map(r => esc(r.resident) + ' — ' + esc(r.lesson_date) + (r.reason === 'date' ? ' (другая дата)' : ' (другой автор)')).join(', ')}. Проверьте дату и автора.</div>` : ''}
<div class="post-task-actions">
<button type="button" class="btn-xs post-task-close" data-close-task="${esc(t.key)}" title="Закрыть задачу">Закрыть</button>
</div>