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

@@ -3372,6 +3372,7 @@
"title": "صفحات اطلاعات",
"subtitle": "مدیریت صفحات اطلاعات ثابت",
"create": "ایجاد صفحه",
"createFaq": "ایجاد FAQ",
"edit": "ویرایش",
"save": "ذخیره",
"saving": "در حال ذخیره...",
@@ -3383,6 +3384,7 @@
"notFound": "صفحه پیدا نشد",
"active": "فعال",
"inactive": "غیرفعال",
"typePage": "صفحه",
"localeLabel": "زبان محتوا",
"fields": {
"slug": "شناسه URL",
@@ -3390,7 +3392,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": "روسی",