feat(notes): личные заметки с drag-and-drop сортировкой

- Новая страница notes.html и контроллер public/js/notes.js
- Таблица user_notes (id, user_id, title, note, tags, color, sort_order)
- Сохранение порядка карточек через PUT /api/notes/reorder
- Личные заметки администратора видны всем, тьюторы — только своим
- Поддержка user_notes в бэкапе и восстановлении (backup-restore.js)
- Обновлена документация AGENTS.md
This commit is contained in:
dev
2026-10-08 15:04:06 +03:00
parent 2a8d8e9902
commit ecfa15e35b
10 changed files with 662 additions and 23 deletions
+13 -12
View File
@@ -51,26 +51,27 @@ function buildSidebar(active) {
{ page: 'dashboard', label: 'Дашборд', icon: 'layout-dashboard' },
{ page: 'journal', label: 'Журнал', icon: 'book-open' },
{ page: 'lessons', label: 'Отчёты о занятиях', icon: 'notebook-pen' },
{ page: 'feedback', label: 'Обратная связь', icon: 'message-square-heart' },
{ page: 'notifications', label: 'Уведомления', icon: 'bell', badge: true },
{ page: 'chat', label: 'Чаты', icon: 'messages-square', chatBadge: true },
{ page: 'students', label: 'Ученики', icon: 'graduation-cap' },
{ page: 'groups', label: 'Группы', icon: 'users' },
{ page: 'feedback', label: 'Обратная связь', icon: 'message-square-heart' },
{ page: 'shorts', label: 'Короткие сообщения', icon: 'zap' },
{ page: 'chat', label: 'Чаты', icon: 'messages-square', chatBadge: true },
{ page: 'notifications', label: 'Уведомления', icon: 'bell', badge: true },
{ page: 'photos', label: 'Фото', icon: 'Image' },
{ page: 'files', label: 'Файлы', icon: 'folder' },
{ page: 'links', label: 'Ссылки', icon: 'link' },
{ page: 'shorts', label: 'Короткие сообщения', icon: 'zap' },
{ page: 'trash', label: 'Корзина', icon: 'trash-2' },
{ page: 'notes', label: 'Заметки', icon: 'sticky-note' },
];
const adminNav = [
{ page: 'modules', label: 'Темы модулей', icon: 'layers' },
{ page: 'branches', label: 'Филиалы', icon: 'building-2' },
{ page: 'users', label: 'Пользователи', icon: 'user-cog' },
{ page: 'apikeys', label: 'API-ключи', icon: 'key-round' },
{ page: 'worker', label: 'Воркер ИИ', icon: 'bot' },
{ page: 'audit', label: 'Аудит', icon: 'scroll-text' },
{ page: 'bans', label: 'Блокировки', icon: 'shield-off' },
{ page: 'settings', label: 'Настройки', icon: 'settings' },
{ page: 'modules', label: 'Темы модулей', icon: 'layers' },
{ page: 'users', label: 'Пользователи', icon: 'user-cog' },
{ page: 'branches', label: 'Филиалы', icon: 'building-2' },
{ page: 'audit', label: 'Аудит', icon: 'scroll-text' },
{ page: 'worker', label: 'Воркер ИИ', icon: 'bot' },
{ page: 'apikeys', label: 'API-ключи', icon: 'key-round' },
{ page: 'bans', label: 'Блокировки', icon: 'shield-off' },
];
const userName = currentUser?.name || currentUser?.username || '';
const roleLabel = isAdmin() ? 'Администратор' : 'Тутор';
@@ -1055,4 +1056,4 @@ document.addEventListener('click', e => {
if (imgEl) { e.preventDefault(); showImg(imgEl.dataset.img); return; }
const out = e.target.closest('[data-action="logout"]');
if (out) { e.preventDefault(); doLogout(); }
});
});