{m.title}
+ {m.updated && ( ++ {t.legal.updated} +
+ )} + + {m.tbc ? ( +{p}
+ ))} +From 334e1797625b9d34dd4151a80536abf9ddd07ca6 Mon Sep 17 00:00:00 2001
From: Peppa
+ {t.legal.updated} +
+ )} + + {m.tbc ? ( +{p}
+ ))} ++ {t.legal.consentBefore} + {t.legal.consentLink} + {t.legal.consentAfter} +
+ ) +} diff --git a/src/globals/Legal.ts b/src/globals/Legal.ts new file mode 100644 index 0000000..2f9c9f3 --- /dev/null +++ b/src/globals/Legal.ts @@ -0,0 +1,25 @@ +import type { Field, GlobalConfig } from 'payload' + +const doc = (name: string, label: string): Field => ({ + name, + label, + type: 'group', + fields: [ + { + name: 'body', + label: 'Текст документа', + type: 'textarea', + localized: true, + admin: { rows: 24, description: 'Только текст из документа фонда. Абзацы разделяйте пустой строкой. Пусто — сайт покажет «Нужно уточнить».' }, + }, + { name: 'updated', label: 'Дата редакции', type: 'date', admin: { date: { pickerAppearance: 'dayOnly' } } }, + ], +}) + +/** Юридические документы фонда. Тексты вносит фонд; сайт ничего не дописывает. */ +export const Legal: GlobalConfig = { + slug: 'legal', + label: 'Юридические страницы', + access: { read: () => true }, + fields: [doc('privacy', 'Политика конфиденциальности'), doc('terms', 'Условия использования сайта')], +} diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 793e13b..843dee9 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -31,5 +31,16 @@ export const en: Dict = { contactMissing: 'Contact details', }, footer: 'All rights reserved.', + legal: { + privacy: { title: 'Privacy Policy', description: 'How Qazaq Legacy Foundation handles the data of website visitors.' }, + terms: { title: 'Website Terms of Use', description: 'Terms of use of the Qazaq Legacy Foundation website.' }, + missing: 'the text will be provided by the foundation', + updated: 'Version of', + termsShort: 'Terms of Use', + back: 'Back to home', + consentBefore: 'By sending a message, you agree to our ', + consentLink: 'Privacy Policy', + consentAfter: '.', + }, language: 'Language', } diff --git a/src/i18n/kk.ts b/src/i18n/kk.ts index e1f8a89..18f1f62 100644 --- a/src/i18n/kk.ts +++ b/src/i18n/kk.ts @@ -31,5 +31,16 @@ export const kk: Dict = { contactMissing: 'Байланыс деректері', }, footer: 'Барлық құқықтар қорғалған.', + legal: { + privacy: { title: 'Құпиялылық саясаты', description: 'Qazaq Legacy Foundation сайтқа келушілердің деректерін қалай өңдейді.' }, + terms: { title: 'Сайтты пайдалану шарттары', description: 'Qazaq Legacy Foundation сайтын пайдалану шарттары.' }, + missing: 'мәтінді қор ұсынады', + updated: 'Редакция күні:', + termsShort: 'Пайдалану шарттары', + back: 'Басты бетке', + consentBefore: 'Өтінішті жіберу арқылы сіз ', + consentLink: 'құпиялылық саясатымен', + consentAfter: ' келісесіз.', + }, language: 'Тіл', } diff --git a/src/i18n/ru.ts b/src/i18n/ru.ts index 80a3610..1fd79d9 100644 --- a/src/i18n/ru.ts +++ b/src/i18n/ru.ts @@ -31,5 +31,16 @@ export const ru: Dict = { contactMissing: 'Контакты для связи', }, footer: 'Все права защищены.', + legal: { + privacy: { title: 'Политика конфиденциальности', description: 'Как Qazaq Legacy Foundation обрабатывает данные посетителей сайта.' }, + terms: { title: 'Условия использования сайта', description: 'Условия использования сайта Qazaq Legacy Foundation.' }, + missing: 'текст предоставит фонд', + updated: 'Редакция от', + termsShort: 'Условия использования', + back: 'На главную', + consentBefore: 'Отправляя обращение, вы соглашаетесь с ', + consentLink: 'политикой конфиденциальности', + consentAfter: '.', + }, language: 'Язык', } diff --git a/src/i18n/types.ts b/src/i18n/types.ts index f57f64e..cf56926 100644 --- a/src/i18n/types.ts +++ b/src/i18n/types.ts @@ -15,6 +15,17 @@ export type Dict = { news: { title: string; news: string; event: string } collaboration: { title: string; text: string; write: string; contactMissing: string } footer: string + legal: { + privacy: { title: string; description: string } + terms: { title: string; description: string } + missing: string + updated: string + termsShort: string + back: string + consentBefore: string + consentLink: string + consentAfter: string + } language: string } diff --git a/src/lib/content.ts b/src/lib/content.ts index b9518cd..dce8a8c 100644 --- a/src/lib/content.ts +++ b/src/lib/content.ts @@ -2,6 +2,7 @@ import config from '@payload-config' import { getPayload } from 'payload' import type { Locale } from '@/i18n' import type { CmsHome, CmsNews } from './home-model' +import type { CmsLegal } from './legal-model' /** Читает контент из Payload. Любая ошибка (нет базы, не создана таблица) — пустой контент, страница остаётся рабочей. */ export async function loadContent(locale: Locale): Promise<{ home: CmsHome | null; news: CmsNews[] }> { @@ -17,3 +18,14 @@ export async function loadContent(locale: Locale): Promise<{ home: CmsHome | nul return { home: null, news: [] } } } + +/** Юридические документы. Без подстановки другого языка: пустой текст на языке страницы → «нужно уточнить». */ +export async function loadLegal(locale: Locale): Promise{t.heroLead}
- + + diff --git a/src/app/(site)/globals.css b/src/app/(site)/globals.css index 09d2201..12d0372 100644 --- a/src/app/(site)/globals.css +++ b/src/app/(site)/globals.css @@ -13,7 +13,7 @@ html { scroll-behavior: smooth; } body { background: var(--color-paper); color: var(--color-graphite); font-family: var(--font-sans); } -@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } } +@keyframes rise { from { opacity: 0.35; transform: translateY(18px); } to { opacity: 1; transform: none; } } .reveal { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; } .reveal-2 { animation-delay: 0.15s; } .reveal-3 { animation-delay: 0.3s; } From f3c0527bb186ebc10da4282a0a4c13b46855f71c Mon Sep 17 00:00:00 2001 From: Peppa{p}
- ))} +{block.lines[0]}
)}{m.collaboration.text}
{m.collaboration.email ? (
-
- {t.collaboration.write}
+
+ {m.collaboration.email}
) : (
diff --git a/src/i18n/en.ts b/src/i18n/en.ts
index 843dee9..6c711fb 100644
--- a/src/i18n/en.ts
+++ b/src/i18n/en.ts
@@ -11,16 +11,41 @@ export const en: Dict = {
tbc: 'To be confirmed',
mission: {
title: 'Mission',
- text: 'We preserve the cultural, musical and historical heritage of Kazakhstan and make it a living part of the future.',
+ text: "Qazaq Legacy Foundation is a private nonprofit foundation established to preserve, study and promote the cultural, musical and historical heritage of Kazakhstan. We strive to preserve the legacy of outstanding figures in culture and the arts, pass it on to new generations and support contemporary cultural and educational initiatives.",
missing: 'Full mission statement',
},
directions: {
title: 'Focus areas',
items: [
- { title: 'Cultural heritage', text: 'Description of the focus area' },
- { title: 'Musical heritage', text: 'Description of the focus area' },
- { title: 'Historical heritage', text: 'Description of the focus area' },
- ],
+ {
+ "title": "Preserving cultural heritage",
+ "text": "studying, preserving and promoting the legacy of outstanding figures in the culture and arts of Kazakhstan."
+ },
+ {
+ "title": "Publishing",
+ "text": "publishing books, biographies, monographs and music collections."
+ },
+ {
+ "title": "Digital cultural projects",
+ "text": "creating electronic archives, digital platforms, audio and video materials."
+ },
+ {
+ "title": "Music and the arts",
+ "text": "organising concerts, exhibitions, festivals and creative events."
+ },
+ {
+ "title": "Supporting talent",
+ "text": "grants, scholarships and awards for young musicians, researchers and cultural figures."
+ },
+ {
+ "title": "Educational and social projects",
+ "text": "developing cultural education and community initiatives."
+ },
+ {
+ "title": "International cooperation",
+ "text": "working with cultural organisations, archives and foundations abroad."
+ }
+],
},
projects: { title: 'Our projects', more: 'Learn more' },
news: { title: 'News and events', news: 'News', event: 'Event' },
@@ -30,6 +55,20 @@ export const en: Dict = {
write: 'Write to us',
contactMissing: 'Contact details',
},
+ book: {
+ "title": "Yermek Serkebayev. Life, Youth and Happiness… New Pages",
+ "author": "A book by Irina Serkebayeva",
+ "paragraphs": [
+ "RUAN Publishing Company, Almaty, 2026.",
+ "The second, expanded edition was published in the year of Yermek Serkebayev’s centenary; the first edition was published in 2009.",
+ "New in this edition: chapters on Soviet art and its era, chamber music and Kazakh folk song, research on teachers, and new documents and photographs.",
+ "The book draws on the recollections of Yermek Serkebayev and Irina Serkebayeva and the author’s many years of research."
+ ],
+ "get": "Where to get the book",
+ "cover": "Cover",
+ "photo": "Photo",
+ "role": "The foundation’s role"
+},
footer: 'All rights reserved.',
legal: {
privacy: { title: 'Privacy Policy', description: 'How Qazaq Legacy Foundation handles the data of website visitors.' },
diff --git a/src/i18n/kk.ts b/src/i18n/kk.ts
index 18f1f62..c45381b 100644
--- a/src/i18n/kk.ts
+++ b/src/i18n/kk.ts
@@ -11,16 +11,41 @@ export const kk: Dict = {
tbc: 'Нақтылау керек',
mission: {
title: 'Миссия',
- text: 'Біз Қазақстанның мәдени, музыкалық және тарихи мұрасын сақтап, оны болашақтың тірі бөлігіне айналдырамыз.',
+ text: "Qazaq Legacy Foundation — Қазақстанның мәдени, музыкалық және тарихи мұрасын сақтау, зерттеу және дәріптеу үшін құрылған жеке коммерциялық емес қор. Біз мәдениет пен өнердің көрнекті қайраткерлерінің мұрасын сақтауға, оны жаңа ұрпаққа жеткізуге және заманауи мәдени-ағартушылық бастамаларды қолдауға ұмтыламыз.",
missing: 'Миссияның толық мәтіні',
},
directions: {
title: 'Бағыттар',
items: [
- { title: 'Мәдени мұра', text: 'Бағыттың сипаттамасы' },
- { title: 'Музыкалық мұра', text: 'Бағыттың сипаттамасы' },
- { title: 'Тарихи мұра', text: 'Бағыттың сипаттамасы' },
- ],
+ {
+ "title": "Мәдени мұраны сақтау",
+ "text": "Қазақстанның мәдениет пен өнер саласындағы көрнекті қайраткерлерінің мұрасын зерттеу, сақтау және дәріптеу."
+ },
+ {
+ "title": "Баспа қызметі",
+ "text": "кітаптар, өмірбаяндар, монографиялар және музыкалық жинақтар шығару."
+ },
+ {
+ "title": "Цифрлық мәдени жобалар",
+ "text": "электрондық архивтер, цифрлық платформалар, аудио және бейнематериалдар жасау."
+ },
+ {
+ "title": "Музыка және өнер",
+ "text": "концерттер, көрмелер, фестивальдер және шығармашылық іс-шаралар ұйымдастыру."
+ },
+ {
+ "title": "Таланттарды қолдау",
+ "text": "жас музыканттарға, зерттеушілерге және мәдениет қайраткерлеріне гранттар, стипендиялар және сыйлықтар беру."
+ },
+ {
+ "title": "Ағартушылық және әлеуметтік жобалар",
+ "text": "мәдени білім беру мен қоғамдық бастамаларды дамыту."
+ },
+ {
+ "title": "Халықаралық ынтымақтастық",
+ "text": "шетелдік мәдени ұйымдармен, архивтермен және қорлармен өзара әрекеттесу."
+ }
+],
},
projects: { title: 'Біздің жобалар', more: 'Толығырақ' },
news: { title: 'Жаңалықтар мен іс-шаралар', news: 'Жаңалық', event: 'Іс-шара' },
@@ -30,6 +55,20 @@ export const kk: Dict = {
write: 'Бізге жазыңыз',
contactMissing: 'Байланыс деректері',
},
+ book: {
+ "title": "Ермек Серкебаев. Өмір де, жастық та, бақыт та… Жаңа беттер",
+ "author": "Ирина Серкебаеваның кітабы",
+ "paragraphs": [
+ "«RUAN» баспа компаниясы, Алматы, 2026.",
+ "Екінші, толықтырылған басылым Ермек Серкебаевтың 100 жылдығы аталып өткен жылы жарық көрді; алғашқы басылымы — 2009 жыл.",
+ "Жаңа басылымда: кеңестік өнер мен дәуір, камералық музыка, қазақтың халық әні туралы тараулар, ұстаздар туралы зерттеу, жаңа құжаттар мен фотосуреттер бар.",
+ "Кітаптың негізі — Ермек Серкебаев пен Ирина Серкебаеваның естеліктері және автордың көпжылдық зерттеу жұмысы."
+ ],
+ "get": "Қайдан алуға болады",
+ "cover": "Мұқаба",
+ "photo": "Фото",
+ "role": "Қордың рөлі"
+},
footer: 'Барлық құқықтар қорғалған.',
legal: {
privacy: { title: 'Құпиялылық саясаты', description: 'Qazaq Legacy Foundation сайтқа келушілердің деректерін қалай өңдейді.' },
diff --git a/src/i18n/ru.ts b/src/i18n/ru.ts
index 1fd79d9..7d5fb41 100644
--- a/src/i18n/ru.ts
+++ b/src/i18n/ru.ts
@@ -11,16 +11,41 @@ export const ru: Dict = {
tbc: 'Нужно уточнить',
mission: {
title: 'Миссия',
- text: 'Мы сохраняем культурное, музыкальное и историческое наследие Казахстана и делаем его живой частью будущего.',
+ text: "Qazaq Legacy Foundation — частный некоммерческий фонд, созданный для сохранения, изучения и популяризации культурного, музыкального и исторического наследия Казахстана. Мы стремимся сохранять наследие выдающихся деятелей культуры и искусства, передавать его новым поколениям и поддерживать современные культурные и просветительские инициативы.",
missing: 'Полная формулировка миссии',
},
directions: {
title: 'Направления',
items: [
- { title: 'Культурное наследие', text: 'Описание направления' },
- { title: 'Музыкальное наследие', text: 'Описание направления' },
- { title: 'Историческое наследие', text: 'Описание направления' },
- ],
+ {
+ "title": "Сохранение культурного наследия",
+ "text": "изучение, сохранение и популяризация наследия выдающихся деятелей культуры и искусства Казахстана."
+ },
+ {
+ "title": "Издательская деятельность",
+ "text": "выпуск книг, биографий, монографий и музыкальных сборников."
+ },
+ {
+ "title": "Цифровые культурные проекты",
+ "text": "создание электронных архивов, цифровых платформ, аудио- и видеоматериалов."
+ },
+ {
+ "title": "Музыка и искусство",
+ "text": "организация концертов, выставок, фестивалей и творческих мероприятий."
+ },
+ {
+ "title": "Поддержка талантов",
+ "text": "гранты, стипендии и премии для молодых музыкантов, исследователей и деятелей культуры."
+ },
+ {
+ "title": "Просветительские и социальные проекты",
+ "text": "развитие культурного образования и общественных инициатив."
+ },
+ {
+ "title": "Международное сотрудничество",
+ "text": "взаимодействие с зарубежными культурными организациями, архивами и фондами."
+ }
+],
},
projects: { title: 'Наши проекты', more: 'Подробнее' },
news: { title: 'Новости и события', news: 'Новость', event: 'Событие' },
@@ -30,6 +55,20 @@ export const ru: Dict = {
write: 'Написать нам',
contactMissing: 'Контакты для связи',
},
+ book: {
+ "title": "Ермек Серкебаев. И жизнь, и молодость, и счастье… Новые страницы",
+ "author": "Книга Ирины Серкебаевой",
+ "paragraphs": [
+ "Издательская компания «RUAN», Алматы, 2026.",
+ "Второе, расширенное издание вышло в год 100-летия Ермека Серкебаева; первое издание — 2009 год.",
+ "Новое в издании: главы о советском искусстве и эпохе, о камерной музыке, казахской народной песне, исследование о педагогах, новые документы и фотографии.",
+ "Основа книги — воспоминания Ермека Серкебаева и Ирины Серкебаевой и многолетняя исследовательская работа автора."
+ ],
+ "get": "Где получить",
+ "cover": "Обложка",
+ "photo": "Фото",
+ "role": "Роль фонда"
+},
footer: 'Все права защищены.',
legal: {
privacy: { title: 'Политика конфиденциальности', description: 'Как Qazaq Legacy Foundation обрабатывает данные посетителей сайта.' },
diff --git a/src/i18n/types.ts b/src/i18n/types.ts
index cf56926..c2f1510 100644
--- a/src/i18n/types.ts
+++ b/src/i18n/types.ts
@@ -12,6 +12,7 @@ export type Dict = {
mission: { title: string; text: string; missing: string }
directions: { title: string; items: { title: string; text: string }[] }
projects: { title: string; more: string }
+ book: { title: string; author: string; paragraphs: string[]; get: string; cover: string; photo: string; role: string }
news: { title: string; news: string; event: string }
collaboration: { title: string; text: string; write: string; contactMissing: string }
footer: string
diff --git a/src/lib/content.ts b/src/lib/content.ts
index dce8a8c..5add362 100644
--- a/src/lib/content.ts
+++ b/src/lib/content.ts
@@ -9,7 +9,7 @@ export async function loadContent(locale: Locale): Promise<{ home: CmsHome | nul
try {
const payload = await getPayload({ config })
const [home, news] = await Promise.all([
- payload.findGlobal({ slug: 'home', locale }),
+ payload.findGlobal({ slug: 'home', locale, fallbackLocale: false }),
payload.find({ collection: 'news', locale, sort: '-date', limit: 3 }),
])
return { home: home as unknown as CmsHome, news: news.docs as unknown as CmsNews[] }
diff --git a/src/lib/home-model.test.ts b/src/lib/home-model.test.ts
index 908305e..e111898 100644
--- a/src/lib/home-model.test.ts
+++ b/src/lib/home-model.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'
import { getDict } from '@/i18n'
-import { buildHomeModel } from './home-model'
+import { buildHomeModel, bookUrl } from './home-model'
const t = getDict('ru')
@@ -9,15 +9,15 @@ describe('Сценарий: блоки без данных скрыты', () =>
const m = buildHomeModel(null, [], t)
expect(m.projects).toEqual([])
expect(m.news).toEqual([])
- expect(m.collaboration.email).toBeNull()
+ expect(m.collaboration.email).toBe('qazaqlegacy@gmail.com')
})
- it('нет миссии — показан базовый текст и пометка «нужно уточнить»', () => {
- expect(buildHomeModel(null, [], t).mission.tbc).toBe(true)
+ it('нет миссии в базе — показан подтверждённый текст', () => {
+ expect(buildHomeModel(null, [], t).mission.tbc).toBe(false)
})
- it('три направления из ТЗ показаны с пометкой «нужно уточнить»', () => {
+ it('семь направлений фонда показаны без пометок', () => {
const m = buildHomeModel(null, [], t)
- expect(m.directions.map((d) => d.title)).toEqual(['Культурное наследие', 'Музыкальное наследие', 'Историческое наследие'])
- expect(m.directions.every((d) => d.tbc)).toBe(true)
+ expect(m.directions).toHaveLength(7)
+ expect(m.directions.every((d) => !d.tbc)).toBe(true)
})
})
@@ -37,3 +37,23 @@ describe('Сценарий: нет пожертвований', () => {
}
})
})
+
+ describe('Подтверждённые сведения без заполненной базы и другой язык', () => {
+ it.each(['ru', 'kk', 'en'] as const)('%s содержит полные тексты без подстановки другого языка', (locale) => {
+ const dict = getDict(locale)
+ const m = buildHomeModel(null, [], dict)
+ expect(m.mission.text.length).toBeGreaterThan(250)
+ expect(m.directions).toHaveLength(7)
+ expect(m.directions.every((d) => d.text && d.text.length > 30 && !d.tbc)).toBe(true)
+ expect(dict.book.paragraphs).toHaveLength(4)
+ expect(dict.book.paragraphs.join(' ')).toContain('2009')
+ expect(dict.book.paragraphs.join(' ')).toContain('2026')
+ expect(dict.book.role).toBeTruthy()
+ })
+ it('Доступные ссылки — точный адрес книги', () => {
+ expect(bookUrl).toBe('https://www.flip.kz/catalog?prod=6364653&utm_source=ig&utm_medium=social&utm_content=link_in_bio')
+ })
+ it('Заполненная почта редактора сохраняется', () => {
+ expect(buildHomeModel({ contactEmail: 'editor@example.org' }, [], t).collaboration.email).toBe('editor@example.org')
+ })
+})
diff --git a/src/lib/home-model.ts b/src/lib/home-model.ts
index 7fec5e2..00ceffe 100644
--- a/src/lib/home-model.ts
+++ b/src/lib/home-model.ts
@@ -19,23 +19,26 @@ export type HomeModel = {
collaboration: { text: string; email: string | null }
}
+export const foundationEmail = 'qazaqlegacy@gmail.com'
+export const bookUrl = 'https://www.flip.kz/catalog?prod=6364653&utm_source=ig&utm_medium=social&utm_content=link_in_bio'
+
const clean = (v?: string | null) => (v && v.trim() ? v.trim() : null)
-/** Собирает данные главной: пустое подтверждённое поле → «нужно уточнить», блоки без данных — пустые списки. */
+/** Собирает данные главной: редакторские значения дополняются подтверждёнными текстами словаря. */
export function buildHomeModel(cms: CmsHome | null, news: CmsNews[], t: Dict): HomeModel {
const cmsDirs = (cms?.directions ?? []).filter((d) => clean(d.title))
const directions: Card[] = cmsDirs.length
? cmsDirs.map((d) => ({ title: d.title!.trim(), text: clean(d.text), tbc: !clean(d.text) }))
- : t.directions.items.map((d) => ({ title: d.title, text: d.text, tbc: true }))
+ : t.directions.items.map((d) => ({ title: d.title, text: d.text, tbc: false }))
const projects: Card[] = (cms?.projects ?? [])
.filter((p) => clean(p.title))
.map((p) => ({ title: p.title!.trim(), text: clean(p.text), tbc: !clean(p.text) }))
const mission = clean(cms?.mission)
return {
- mission: { text: mission ?? t.mission.text, tbc: !mission },
+ mission: { text: mission ?? t.mission.text, tbc: false },
directions,
projects,
news,
- collaboration: { text: clean(cms?.collaboration) ?? t.collaboration.text, email: clean(cms?.contactEmail) },
+ collaboration: { text: clean(cms?.collaboration) ?? t.collaboration.text, email: clean(cms?.contactEmail) ?? foundationEmail },
}
}
From 600e5fc400db9a8b826d3eb6ab265753fb5c7c1c Mon Sep 17 00:00:00 2001
From: Peppa
+ {t.legal.privacy.title} +