qazaq-legacy-foundation-web/src/globals/SiteSettings.ts
peppa-bot 84c0358707 QLFW-68: русские подписи у списков в панели
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:04:16 +00:00

31 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { GlobalConfig } from 'payload'
export const SiteSettings: GlobalConfig = {
slug: 'site-settings',
label: 'Контакты и соцсети',
access: { read: () => true },
fields: [
{ name: 'email', label: 'Почта для связи', type: 'email' },
{ name: 'phone', label: 'Телефон', type: 'text' },
{ name: 'address', label: 'Адрес', type: 'text', localized: true },
{
name: 'bookPhotos',
label: 'Фотографии книги (после четырёх основных)',
type: 'array',
labels: { singular: 'фото книги', plural: 'Фотографии книги' },
admin: { description: 'Новое фото появится в ряду фотографий книги тем же размером. Порядок — как в списке.' },
fields: [{ name: 'photo', label: 'Фото', type: 'upload', relationTo: 'media', required: true }],
},
{
name: 'socials',
label: 'Социальные сети',
type: 'array',
labels: { singular: 'соцсеть', plural: 'Социальные сети' },
fields: [
{ name: 'label', label: 'Название (например, Instagram)', type: 'text', required: true },
{ name: 'url', label: 'Ссылка', type: 'text', required: true, validate: (v: string | null | undefined) => (v && /^https?:\/\//.test(v) ? true : 'Ссылка должна начинаться с https://') },
],
},
],
}