From e1c56a18caf6e7f1b6e4f59bc747582afa6e94a2 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 3 Dec 2026 10:01:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BF=D1=80=D0=BE=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=83=D1=89=D0=B5=D0=B3=D0=BE=20=D1=82=D0=B5=D0=BC=D1=8B?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BD=D1=8F=D1=82=D0=B8=D1=8F=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D1=81=D1=82?= =?UTF-8?q?=D0=B8=D0=BB=D1=8C=20nav-dot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Убрать окно совпадения по времени (LESSON_TOPIC_MATCH_WINDOW_SEC) из findCurrentLessonTopic: сортировка только по lesson_time NULLS LAST, id DESC - Убрать background:#d4d4d8 у .nav-dot в admin.css --- lib/lesson-reports.js | 10 +++------- public/admin.css | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/lesson-reports.js b/lib/lesson-reports.js index d355c8a..814c71f 100644 --- a/lib/lesson-reports.js +++ b/lib/lesson-reports.js @@ -1,5 +1,4 @@ const LESSON_REPORT_EDIT_DENIED = 'Изменять отчёт о занятии может только его автор или администратор'; -const LESSON_TOPIC_MATCH_WINDOW_SEC = 3600; function lessonReportEditable(report, user) { if (!report || !user) return false; @@ -18,23 +17,20 @@ function stripLessonTopicNumber(topic) { return String(topic || '').trim().replace(/\s*\d+\s*\/\s*\d+\s*$/, '').trim(); } -async function findCurrentLessonTopic(pool, { groupId, timezone, windowSec = LESSON_TOPIC_MATCH_WINDOW_SEC }) { +async function findCurrentLessonTopic(pool, { groupId, timezone }) { const { rows } = await pool.query(` SELECT lr.topic FROM lesson_reports lr WHERE lr.group_id = $2 AND lr.lesson_date = (now() AT TIME ZONE $1)::date - AND lr.lesson_time IS NOT NULL - AND ABS(EXTRACT(EPOCH FROM (lr.lesson_time - (now() AT TIME ZONE $1)::time))) <= $3 - ORDER BY ABS(EXTRACT(EPOCH FROM (lr.lesson_time - (now() AT TIME ZONE $1)::time))) ASC, lr.id DESC + ORDER BY lr.lesson_time NULLS LAST, lr.id DESC LIMIT 1 - `, [timezone, groupId, windowSec]); + `, [timezone, groupId]); return rows.length ? stripLessonTopicNumber(rows[0].topic) || null : null; } module.exports = { LESSON_REPORT_EDIT_DENIED, - LESSON_TOPIC_MATCH_WINDOW_SEC, lessonReportEditable, lessonReportWriteBlocked, stripLessonTopicNumber, diff --git a/public/admin.css b/public/admin.css index 6c79a6d..42768ba 100644 --- a/public/admin.css +++ b/public/admin.css @@ -74,7 +74,7 @@ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;b .sidebar nav a[data-nav=sidebar]{--nav-ink:#7e22ce} .sidebar nav a svg{color:var(--nav-ink,var(--muted))} .sidebar nav a.active svg{color:var(--accent)} -.sidebar nav a .nav-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;border:0;padding:0;background:#d4d4d8;color:var(--nav-ink,var(--accent));cursor:pointer;position:relative;transition:background .14s ease,transform .14s ease} +.sidebar nav a .nav-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;border:0;padding:0;color:var(--nav-ink,var(--accent));cursor:pointer;position:relative;transition:background .14s ease,transform .14s ease} .sidebar nav a .nav-dot::after{content:'';position:absolute;inset:-6px;border-radius:50%} .sidebar nav a:hover .nav-dot{background:#a1a1aa;transform:scale(1.1)} .sidebar nav a .nav-dot.on{background:currentColor;box-shadow:0 0 0 3px rgba(0,0,0,.06);transform:none}