feat: FAQ pages — Q&A builder in admin, accordion view for users

Admin editor:
- page_type selector: "Страница" / "FAQ" radio buttons
- When FAQ: FaqBuilder component replaces TipTap editor
  - Question input + answer textarea per Q&A item
  - Add/remove items, up/down reorder buttons
  - Per-locale Q&A (stored as JSON array in content JSONB)
- "Создать FAQ" button in list alongside "Создать страницу"
- Filter tabs: Все / Страницы / FAQ
- Page type badge on each row (accent for pages, amber for FAQ)

Public view (InfoPageView):
- Auto-detects page_type='faq' and renders FaqView component
- Accordion with smooth height animation (300ms ease-in-out)
- Search filter appears when >3 questions
- DOMPurify sanitization on FAQ answers
- Single-item expand (click to open/close)

i18n: full FAQ keys for all 4 locales (questions, answers,
search, counts, empty states, builder labels)
This commit is contained in:
Fringg
2026-04-24 14:02:03 +03:00
parent 596f638cdd
commit 1ee0f18343
8 changed files with 781 additions and 192 deletions

View File

@@ -3804,6 +3804,7 @@
"title": "Information Pages",
"subtitle": "Manage static information pages",
"create": "Create Page",
"createFaq": "Create FAQ",
"edit": "Edit",
"save": "Save",
"saving": "Saving...",
@@ -3815,6 +3816,7 @@
"notFound": "Page not found",
"active": "Active",
"inactive": "Inactive",
"typePage": "Page",
"localeLabel": "Content Language",
"fields": {
"slug": "URL Slug",
@@ -3822,7 +3824,34 @@
"content": "Content",
"isActive": "Active",
"sortOrder": "Sort Order",
"icon": "Icon (emoji)"
"icon": "Icon (emoji)",
"pageType": "Page Type"
},
"filter": {
"all": "All",
"page": "Pages",
"faq": "FAQ"
},
"pageTypes": {
"page": "Page",
"faq": "FAQ"
},
"faq": {
"questions": "Questions & Answers",
"questionsCount": "questions",
"noQuestions": "No questions yet. Click the button below to add one.",
"questionNumber": "Question #{{n}}",
"question": "Question",
"answer": "Answer",
"questionPlaceholder": "Enter question...",
"answerPlaceholder": "Enter answer (HTML supported)...",
"htmlHint": "HTML markup is supported",
"addQuestion": "Add Question",
"removeQuestion": "Remove question",
"moveUp": "Move up",
"moveDown": "Move down",
"searchPlaceholder": "Search questions...",
"noResults": "No results found"
},
"locales": {
"ru": "Russian",