diff --git a/public/js/postlesson.js b/public/js/postlesson.js index e42aa9f..bdc13fe 100644 --- a/public/js/postlesson.js +++ b/public/js/postlesson.js @@ -111,14 +111,24 @@ function renderPostLessonTasks() { const nextIdx = steps2.findIndex(s => !s.done); const link = steps2[nextIdx >= 0 ? nextIdx : 0].link; const isDismissed = dismissed.has(t.key); + const isOverdue = t.overdue && !allDone; + const pct = steps2.length ? Math.round((completed / steps2.length) * 100) : 0; + let badgeCls = 'pending', badgeText = 'В работе', barColor = '#f59e0b'; + if (isDismissed) { badgeCls = 'dismissed'; badgeText = 'Закрыта'; barColor = '#94a3b8'; } + else if (allDone) { badgeCls = 'done'; badgeText = 'Выполнена'; barColor = '#22c55e'; } + else if (t.overdue) { badgeCls = 'overdue'; badgeText = 'Просрочена'; barColor = '#ef4444'; } return ` -