Content: publish/hide chapters, sections and articles

- migration V5 adds published flag (default true) to chapters/sections/articles
- ContentService: tree(includeHidden) filters, treeAll(), findArticle(includeHidden),
  set*Published; public tree/article expose only published items
- admin API: GET /tree/all, GET /all/{chapter}/{section}/{article}, PUT
  /{chapters|sections|articles}/{id}/published
- web: learn pages for admins load the full tree, show "скрыто" badges and
  publish/hide buttons for every chapter, section and article; hidden articles
  open in preview for admins, guests get "not found"; article view carries
  published flag
This commit is contained in:
2026-09-16 18:29:44 +03:00
parent aa1fb5c791
commit 30b8064718
13 changed files with 225 additions and 26 deletions

View File

@@ -0,0 +1,4 @@
-- Публикация учебных материалов: главы, разделы и статьи можно скрывать от студентов.
ALTER TABLE chapters ADD COLUMN published boolean NOT NULL DEFAULT true;
ALTER TABLE sections ADD COLUMN published boolean NOT NULL DEFAULT true;
ALTER TABLE articles ADD COLUMN published boolean NOT NULL DEFAULT true;