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

@@ -4348,6 +4348,7 @@
"title": "Информационные страницы",
"subtitle": "Управление статическими информационными страницами",
"create": "Создать страницу",
"createFaq": "Создать FAQ",
"edit": "Редактировать",
"save": "Сохранить",
"saving": "Сохранение...",
@@ -4359,6 +4360,7 @@
"notFound": "Страница не найдена",
"active": "Активна",
"inactive": "Неактивна",
"typePage": "Страница",
"localeLabel": "Язык контента",
"fields": {
"slug": "URL-адрес",
@@ -4366,7 +4368,34 @@
"content": "Содержание",
"isActive": "Активна",
"sortOrder": "Порядок сортировки",
"icon": "Иконка (эмодзи)"
"icon": "Иконка (эмодзи)",
"pageType": "Тип страницы"
},
"filter": {
"all": "Все",
"page": "Страницы",
"faq": "FAQ"
},
"pageTypes": {
"page": "Страница",
"faq": "FAQ"
},
"faq": {
"questions": "Вопросы и ответы",
"questionsCount": "вопросов",
"noQuestions": "Вопросов пока нет. Нажмите кнопку ниже, чтобы добавить.",
"questionNumber": "Вопрос #{{n}}",
"question": "Вопрос",
"answer": "Ответ",
"questionPlaceholder": "Введите вопрос...",
"answerPlaceholder": "Введите ответ (поддерживается HTML)...",
"htmlHint": "Поддерживается HTML-разметка",
"addQuestion": "Добавить вопрос",
"removeQuestion": "Удалить вопрос",
"moveUp": "Переместить вверх",
"moveDown": "Переместить вниз",
"searchPlaceholder": "Поиск по вопросам...",
"noResults": "Ничего не найдено"
},
"locales": {
"ru": "Русский",