feat: information pages — admin editor with TipTap, public viewer

Admin panel:
- New section "Информационные страницы" in admin nav
- Admin list: slug, title, active toggle, edit/delete, sort order
- Admin editor: full TipTap (bold, italic, headings, lists, links,
  image/video upload, alignment, highlight, code blocks)
  with locale tabs (RU/EN/ZH/FA) for title and content
- Create/edit via URL params, slug auto-generation

Public:
- /info/:slug route with DOMPurify sanitized content
- Locale fallback, Telegram safe area, loading skeleton, 404

i18n: all 4 locales
This commit is contained in:
Fringg
2026-04-24 08:11:20 +03:00
parent d43638b34e
commit 7d6d0ba344
10 changed files with 1748 additions and 4 deletions

View File

@@ -148,6 +148,11 @@ const NewsArticlePage = lazyWithRetry(() => import('./pages/NewsArticle'));
const AdminNews = lazyWithRetry(() => import('./pages/AdminNews'));
const AdminNewsCreate = lazyWithRetry(() => import('./pages/AdminNewsCreate'));
// Info pages
const InfoPageView = lazyWithRetry(() => import('./pages/InfoPageView'));
const AdminInfoPages = lazyWithRetry(() => import('./pages/AdminInfoPages'));
const AdminInfoPageEditor = lazyWithRetry(() => import('./pages/AdminInfoPageEditor'));
function ProtectedRoute({
children,
withLayout = true,
@@ -555,6 +560,16 @@ function App() {
</ProtectedRoute>
}
/>
<Route
path="/info/:slug"
element={
<ProtectedRoute>
<LazyPage>
<InfoPageView />
</LazyPage>
</ProtectedRoute>
}
/>
{/* Admin routes */}
<Route
@@ -1281,6 +1296,38 @@ function App() {
}
/>
{/* Info pages admin routes */}
<Route
path="/admin/info-pages"
element={
<PermissionRoute permission="settings:read">
<LazyPage>
<AdminInfoPages />
</LazyPage>
</PermissionRoute>
}
/>
<Route
path="/admin/info-pages/create"
element={
<PermissionRoute permission="settings:edit">
<LazyPage>
<AdminInfoPageEditor />
</LazyPage>
</PermissionRoute>
}
/>
<Route
path="/admin/info-pages/:id/edit"
element={
<PermissionRoute permission="settings:edit">
<LazyPage>
<AdminInfoPageEditor />
</LazyPage>
</PermissionRoute>
}
/>
<Route
path="/admin/audit-log"
element={