From ee1f75fbfd33ecc7649f1e08b8dafb9de915b111 Mon Sep 17 00:00:00 2001 From: Peppa Date: Tue, 17 Nov 2026 18:37:38 +0500 Subject: [PATCH 1/2] =?UTF-8?q?QLFW-52:=20=C2=AB=D0=9E=20=D1=84=D0=BE?= =?UTF-8?q?=D0=BD=D0=B4=D0=B5=C2=BB=20=D0=B1=D0=B5=D0=B7=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=BA=20=D0=B8=20=D0=BF=D0=BE=D0=B2?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- openspec/changes/qlfw-52-about-cleanup/design.md | 1 + .../changes/qlfw-52-about-cleanup/proposal.md | 6 ++++++ .../qlfw-52-about-cleanup/specs/about/spec.md | 13 +++++++++++++ openspec/changes/qlfw-52-about-cleanup/tasks.md | 3 +++ src/app/(site)/[locale]/about/page.tsx | 13 ++++++++++--- src/i18n/en.ts | 2 +- src/i18n/kk.ts | 2 +- src/i18n/ru.ts | 2 +- src/i18n/types.ts | 2 +- src/lib/about-model.ts | 15 +++++++++++++++ src/lib/foundation-sections.test.ts | 13 ++++++++----- 11 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 openspec/changes/qlfw-52-about-cleanup/design.md create mode 100644 openspec/changes/qlfw-52-about-cleanup/proposal.md create mode 100644 openspec/changes/qlfw-52-about-cleanup/specs/about/spec.md create mode 100644 openspec/changes/qlfw-52-about-cleanup/tasks.md create mode 100644 src/lib/about-model.ts diff --git a/openspec/changes/qlfw-52-about-cleanup/design.md b/openspec/changes/qlfw-52-about-cleanup/design.md new file mode 100644 index 0000000..50aef41 --- /dev/null +++ b/openspec/changes/qlfw-52-about-cleanup/design.md @@ -0,0 +1 @@ +Данные людей и партнёров — типизированный файл src/lib/about-model.ts по языкам (пока пустой): без миграций БД; блок появляется, когда добавлена запись. Решение агента. diff --git a/openspec/changes/qlfw-52-about-cleanup/proposal.md b/openspec/changes/qlfw-52-about-cleanup/proposal.md new file mode 100644 index 0000000..e17a714 --- /dev/null +++ b/openspec/changes/qlfw-52-about-cleanup/proposal.md @@ -0,0 +1,6 @@ +## Why +На странице «О фонде» видны пометки «Нужно уточнить», а «Цели» пересказывают «Миссию». + +## What Changes +- Блоки «Учредитель», «Руководство», «Попечительский совет», «Партнёры» показываются только при наличии данных (src/lib/about-model.ts). +- Новый текст «Целей» на ru/kk/en. diff --git a/openspec/changes/qlfw-52-about-cleanup/specs/about/spec.md b/openspec/changes/qlfw-52-about-cleanup/specs/about/spec.md new file mode 100644 index 0000000..0138115 --- /dev/null +++ b/openspec/changes/qlfw-52-about-cleanup/specs/about/spec.md @@ -0,0 +1,13 @@ +## ADDED Requirements +### Requirement: Страница «О фонде» без служебных пометок +Блоки с людьми и партнёрами SHALL показываться только при наличии данных. + +#### Scenario: Данных нет +- **GIVEN** фонд не передал сведения о руководстве и партнёрах +- **WHEN** посетитель открывает «О фонде» +- **THEN** блоков «Учредитель», «Руководство», «Попечительский совет», «Партнёры» и пометки «Нужно уточнить» нет + +#### Scenario: Данные появились +- **GIVEN** в списке учредителя есть запись +- **WHEN** посетитель открывает «О фонде» +- **THEN** виден блок «Учредитель» с этим именем diff --git a/openspec/changes/qlfw-52-about-cleanup/tasks.md b/openspec/changes/qlfw-52-about-cleanup/tasks.md new file mode 100644 index 0000000..0878218 --- /dev/null +++ b/openspec/changes/qlfw-52-about-cleanup/tasks.md @@ -0,0 +1,3 @@ +- [x] Скрыть пустые блоки, добавить «Партнёры» +- [x] Переписать «Цели» на ru/kk/en +- [x] Тесты diff --git a/src/app/(site)/[locale]/about/page.tsx b/src/app/(site)/[locale]/about/page.tsx index 33e57a7..0ad50d4 100644 --- a/src/app/(site)/[locale]/about/page.tsx +++ b/src/app/(site)/[locale]/about/page.tsx @@ -3,7 +3,7 @@ import { getDict, isLocale, locales } from '@/i18n' import { loadContent, loadLegal } from '@/lib/content' import { buildHomeModel } from '@/lib/home-model' import { SectionPage } from '@/components/SectionPage' -import { Tbc } from '@/components/Tbc' +import { aboutPeople } from '@/lib/about-model' export const dynamic = 'force-dynamic' export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) { @@ -18,12 +18,19 @@ export default async function Page({ params }: { params: Promise<{ locale: strin const t = getDict(locale) const { home, news } = await loadContent(locale) const m = buildHomeModel(home, news, t) + const data = aboutPeople[locale] + const people = [ + { label: t.sections.founder, items: data.founder }, + { label: t.sections.leadership, items: data.leadership }, + { label: t.sections.board, items: data.board }, + ].filter(b => b.items.length > 0) return 0}>

{t.mission.title}

{m.mission.text}

{t.sections.goals}

{t.sections.goalText}

{t.directions.title}

-
    {m.directions.map(d =>
  • {d.title}

    {d.text ?? t.tbc}

  • )}
+
    {m.directions.map(d =>
  • {d.title}

    {d.text}

  • )}
-
{[t.sections.founder,t.sections.leadership,t.sections.board].map(label =>

{label}

)}
+ {people.length > 0 &&
{people.map(b =>

{b.label}

    {b.items.map(p =>
  • {p.name}{p.role ? {p.role} : null}
  • )}
)}
} + {data.partners.length > 0 &&

{t.sections.partners}

    {data.partners.map(p =>
  • {p.url ? {p.name} : p.name}
  • )}
}
} diff --git a/src/i18n/en.ts b/src/i18n/en.ts index ec30c7b..5fb2bfa 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -1,7 +1,7 @@ import type { Dict } from './types' export const en: Dict = { - sections: {"about": "About the foundation", "contacts": "Contacts", "goals": "Goals", "goalText": "Preserve the legacy of outstanding cultural figures and artists, pass it on to new generations, and support cultural and educational initiatives.", "founder": "Founder", "leadership": "Leadership", "board": "Board of trustees", "read": "Read", "source": "Source", "review": "Translation awaiting review."}, + sections: {"about": "About the foundation", "contacts": "Contacts", "partners": "Partners", "goals": "Goals", "goalText": "Collect and organise archives, manuscripts and recordings; publish books and music collections; make the legacy available to a wide audience in digital form; support young musicians and researchers; build ties with cultural organisations abroad.", "founder": "Founder", "leadership": "Leadership", "board": "Board of trustees", "read": "Read", "source": "Source", "review": "Translation awaiting review."}, siteName: 'Qazaq Legacy Foundation', metaTitle: 'Qazaq Legacy Foundation — a private foundation for Kazakhstan’s heritage', metaDescription: diff --git a/src/i18n/kk.ts b/src/i18n/kk.ts index 77abd9d..b4503c4 100644 --- a/src/i18n/kk.ts +++ b/src/i18n/kk.ts @@ -1,7 +1,7 @@ import type { Dict } from './types' export const kk: Dict = { - sections: {"about": "Қор туралы", "contacts": "Байланыс", "goals": "Мақсаттар", "goalText": "Мәдениет пен өнердің көрнекті қайраткерлерінің мұрасын сақтау, оны жаңа ұрпаққа жеткізу және мәдени-ағартушылық бастамаларды қолдау.", "founder": "Құрылтайшы", "leadership": "Басшылық", "board": "Қамқоршылық кеңес", "read": "Оқу", "source": "Дереккөз", "review": "Аударманы тексеру қажет."}, + sections: {"about": "Қор туралы", "contacts": "Байланыс", "partners": "Серіктестер", "goals": "Мақсаттар", "goalText": "Мұрағаттарды, қолжазбалар мен жазбаларды жинап, жүйелеу; кітаптар мен музыкалық жинақтар шығару; мұраны кең аудиторияға цифрлық түрде ұсыну; жас музыканттар мен зерттеушілерге қолдау көрсету; шетелдік мәдени ұйымдармен байланыс орнату.", "founder": "Құрылтайшы", "leadership": "Басшылық", "board": "Қамқоршылық кеңес", "read": "Оқу", "source": "Дереккөз", "review": "Аударманы тексеру қажет."}, siteName: 'Qazaq Legacy Foundation', metaTitle: 'Qazaq Legacy Foundation — Қазақстан мұрасының жеке қоры', metaDescription: diff --git a/src/i18n/ru.ts b/src/i18n/ru.ts index 9f9ed9e..e7dea95 100644 --- a/src/i18n/ru.ts +++ b/src/i18n/ru.ts @@ -1,7 +1,7 @@ import type { Dict } from './types' export const ru: Dict = { - sections: {"about": "О фонде", "contacts": "Контакты", "goals": "Цели", "goalText": "Сохранять наследие выдающихся деятелей культуры и искусства, передавать его новым поколениям и поддерживать культурные и просветительские инициативы.", "founder": "Учредитель", "leadership": "Руководство", "board": "Попечительский совет", "read": "Читать", "source": "Источник", "review": ""}, + sections: {"about": "О фонде", "contacts": "Контакты", "partners": "Партнёры", "goals": "Цели", "goalText": "Собирать и систематизировать архивы, рукописи и записи; издавать книги и музыкальные сборники; открывать наследие широкой аудитории в цифровом виде; помогать молодым музыкантам и исследователям; выстраивать связи с зарубежными культурными организациями.", "founder": "Учредитель", "leadership": "Руководство", "board": "Попечительский совет", "read": "Читать", "source": "Источник", "review": ""}, siteName: 'Qazaq Legacy Foundation', metaTitle: 'Qazaq Legacy Foundation — частный фонд наследия Казахстана', metaDescription: diff --git a/src/i18n/types.ts b/src/i18n/types.ts index b902faf..ac375b4 100644 --- a/src/i18n/types.ts +++ b/src/i18n/types.ts @@ -2,7 +2,7 @@ export const locales = ['ru', 'kk', 'en'] as const export type Locale = (typeof locales)[number] export type Dict = { - sections: { about: string; contacts: string; goals: string; goalText: string; founder: string; leadership: string; board: string; read: string; source: string; review: string } + sections: { about: string; contacts: string; partners: string; goals: string; goalText: string; founder: string; leadership: string; board: string; read: string; source: string; review: string } siteName: string metaTitle: string metaDescription: string diff --git a/src/lib/about-model.ts b/src/lib/about-model.ts new file mode 100644 index 0000000..788fdd5 --- /dev/null +++ b/src/lib/about-model.ts @@ -0,0 +1,15 @@ +import type { Locale } from '@/i18n' + +export type AboutPerson = { name: string; role?: string } +export type AboutPartner = { name: string; url?: string } +export type AboutPeople = { founder: AboutPerson[]; leadership: AboutPerson[]; board: AboutPerson[]; partners: AboutPartner[] } + +/** + * Данные страницы «О фонде». Пока фонд не передал сведения, списки пусты, и блоки не показываются. + * Как только в список на нужном языке добавят запись, блок появится сам. + */ +export const aboutPeople: Record = { + ru: { founder: [], leadership: [], board: [], partners: [] }, + kk: { founder: [], leadership: [], board: [], partners: [] }, + en: { founder: [], leadership: [], board: [], partners: [] }, +} diff --git a/src/lib/foundation-sections.test.ts b/src/lib/foundation-sections.test.ts index b20a14c..bbe0050 100644 --- a/src/lib/foundation-sections.test.ts +++ b/src/lib/foundation-sections.test.ts @@ -18,14 +18,17 @@ vi.mock('./content', () => ({ describe('Разделы и языки', () => { for (const locale of locales) { const params = Promise.resolve({ locale }) - it(`Нет сведений о руководстве: явные пометки, партнёры скрыты — ${locale}`, async () => { + it(`Нет сведений о руководстве: блоки и пометки скрыты, цели не повторяют миссию — ${locale}`, async () => { const html = renderToStaticMarkup(await About({ params })) const t = getDict(locale) - expect(html).toContain(t.sections.founder) - expect(html).toContain(t.sections.board) - expect(html).toContain(t.tbc) + expect(html).not.toContain(t.sections.founder) + expect(html).not.toContain(t.sections.leadership) + expect(html).not.toContain(t.sections.board) + expect(html).not.toContain(t.sections.partners) + expect(html).not.toContain(t.tbc) expect(html).toContain(t.mission.text) - expect(html).not.toContain('partners') + expect(html).toContain(t.sections.goalText) + expect(t.mission.text).not.toContain(t.sections.goalText) }) it(`Переключение языка каталога сохраняет путь — ${locale}`, async () => { const html = renderToStaticMarkup(await Projects({ params })) -- 2.45.2 From 3236475a60cb5a59c713f7c3cf40a41f9db7aa0b Mon Sep 17 00:00:00 2001 From: Peppa Date: Tue, 17 Nov 2026 18:37:42 +0500 Subject: [PATCH 2/2] =?UTF-8?q?QLFW-52:=20=D0=BF=D0=B0=D0=BC=D1=8F=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=B0=20=D0=B8=20?= =?UTF-8?q?=D0=B0=D1=80=D1=85=D0=B8=D0=B2=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- .peppa/memory.md | 1 + .../design.md | 0 .../proposal.md | 0 .../specs/about/spec.md | 0 .../tasks.md | 0 openspec/specs/about/spec.md | 19 +++++++++++++++++++ 6 files changed, 20 insertions(+) rename openspec/changes/{qlfw-52-about-cleanup => archive/2026-11-17-qlfw-52-about-cleanup}/design.md (100%) rename openspec/changes/{qlfw-52-about-cleanup => archive/2026-11-17-qlfw-52-about-cleanup}/proposal.md (100%) rename openspec/changes/{qlfw-52-about-cleanup => archive/2026-11-17-qlfw-52-about-cleanup}/specs/about/spec.md (100%) rename openspec/changes/{qlfw-52-about-cleanup => archive/2026-11-17-qlfw-52-about-cleanup}/tasks.md (100%) create mode 100644 openspec/specs/about/spec.md diff --git a/.peppa/memory.md b/.peppa/memory.md index 1d2e5bb..2cdac87 100644 --- a/.peppa/memory.md +++ b/.peppa/memory.md @@ -14,6 +14,7 @@ - QLFW-9: базовые тексты главной и книги — src/i18n/{ru,kk,en}.ts; Payload сохраняет приоритет, fallbackLocale отключён. Почта и URL Flip — src/lib/home-model.ts. - QLFW-11: по выбору PM связь — видимая почта и Instagram https://www.instagram.com/serkebayev_book/; без формы показываем обычную ссылку на политику, PrivacyNote оставляем только для форм. SMTP не требуется. - QLFW-5: отдельные разделы /[locale]/about, /projects, /contacts, /news и /news/[id]; тексты sections в ru/kk/en. News: body/sourceUrl локализованы, imageUrl общий; без перевода заголовка материал скрыт, пустой /news = 404. Контакты без формы по QLFW-11. +- QLFW-52: люди и партнёры страницы «О фонде» — src/lib/about-model.ts (по языкам, пока пусто); блок виден только при непустом списке. ## Грабли - QLFW-32: страница книги уже была готова (QLFW-8); локальный main может отставать — worktree делать от origin/main после git fetch. diff --git a/openspec/changes/qlfw-52-about-cleanup/design.md b/openspec/changes/archive/2026-11-17-qlfw-52-about-cleanup/design.md similarity index 100% rename from openspec/changes/qlfw-52-about-cleanup/design.md rename to openspec/changes/archive/2026-11-17-qlfw-52-about-cleanup/design.md diff --git a/openspec/changes/qlfw-52-about-cleanup/proposal.md b/openspec/changes/archive/2026-11-17-qlfw-52-about-cleanup/proposal.md similarity index 100% rename from openspec/changes/qlfw-52-about-cleanup/proposal.md rename to openspec/changes/archive/2026-11-17-qlfw-52-about-cleanup/proposal.md diff --git a/openspec/changes/qlfw-52-about-cleanup/specs/about/spec.md b/openspec/changes/archive/2026-11-17-qlfw-52-about-cleanup/specs/about/spec.md similarity index 100% rename from openspec/changes/qlfw-52-about-cleanup/specs/about/spec.md rename to openspec/changes/archive/2026-11-17-qlfw-52-about-cleanup/specs/about/spec.md diff --git a/openspec/changes/qlfw-52-about-cleanup/tasks.md b/openspec/changes/archive/2026-11-17-qlfw-52-about-cleanup/tasks.md similarity index 100% rename from openspec/changes/qlfw-52-about-cleanup/tasks.md rename to openspec/changes/archive/2026-11-17-qlfw-52-about-cleanup/tasks.md diff --git a/openspec/specs/about/spec.md b/openspec/specs/about/spec.md new file mode 100644 index 0000000..4302047 --- /dev/null +++ b/openspec/specs/about/spec.md @@ -0,0 +1,19 @@ +# about Specification + +## Purpose +TBD - created by archiving change qlfw-52-about-cleanup. Update Purpose after archive. + +## Requirements + +### Requirement: Страница «О фонде» без служебных пометок +Блоки с людьми и партнёрами SHALL показываться только при наличии данных. + +#### Scenario: Данных нет +- **GIVEN** фонд не передал сведения о руководстве и партнёрах +- **WHEN** посетитель открывает «О фонде» +- **THEN** блоков «Учредитель», «Руководство», «Попечительский совет», «Партнёры» и пометки «Нужно уточнить» нет + +#### Scenario: Данные появились +- **GIVEN** в списке учредителя есть запись +- **WHEN** посетитель открывает «О фонде» +- **THEN** виден блок «Учредитель» с этим именем -- 2.45.2