feat(sidebar): настройка пунктов меню, порядок и доступность для тьюторов; подсветка admin-only

This commit is contained in:
dev
2026-11-02 22:34:14 +03:00
parent 0de5fd8774
commit b360ca8303
9 changed files with 555 additions and 10 deletions
+14
View File
@@ -728,3 +728,17 @@ CREATE TABLE IF NOT EXISTS student_achievements (
updated_at TIMESTAMPTZ DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_student_achievements_student ON student_achievements(student_id);
CREATE TABLE IF NOT EXISTS sidebar_items (
id SERIAL PRIMARY KEY,
page TEXT NOT NULL UNIQUE,
label TEXT NOT NULL,
icon TEXT NOT NULL DEFAULT 'circle',
section TEXT NOT NULL DEFAULT 'base',
sort_order INT NOT NULL DEFAULT 0,
tutor_visible BOOLEAN NOT NULL DEFAULT true,
enabled BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_sidebar_items_section_order ON sidebar_items(section, sort_order, id);
+14
View File
@@ -987,3 +987,17 @@ CREATE INDEX IF NOT EXISTS idx_student_achievements_student ON student_achieveme
INSERT INTO settings (key, value) VALUES ('feedback_imgbb_url','') ON CONFLICT (key) DO NOTHING;
INSERT INTO settings (key, value) VALUES ('feedback_imgbb_key','') ON CONFLICT (key) DO NOTHING;
CREATE TABLE IF NOT EXISTS sidebar_items (
id SERIAL PRIMARY KEY,
page TEXT NOT NULL UNIQUE,
label TEXT NOT NULL,
icon TEXT NOT NULL DEFAULT 'circle',
section TEXT NOT NULL DEFAULT 'base',
sort_order INT NOT NULL DEFAULT 0,
tutor_visible BOOLEAN NOT NULL DEFAULT true,
enabled BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_sidebar_items_section_order ON sidebar_items(section, sort_order, id);