feat(cms): partner categories, publication permission and CMS-managed references copy (MITHOME-131)

Per the managed web operations research (PLATFM-13), a client must not be
shown as a "partner" and names/logos need written permission. Partners
now carry a required relationship category and a publication permission
(default: none) with the permission's location and review date; only
entries with written permission, a category and a logo are public.

The homepage shows clients ("Akik már minket választottak") and other
relationships in separate blocks via ReferencesSection; every partner
shows its relationship type. The section copy moved from a hard-coded
constant into the Home global (localized). The 20260929_partner_references
migration marks Angele Pihenőház as a client reference with written
permission (owner-confirmed), hides any other uncategorised entry, and
seeds the copy in hu + en. The JSON seed uses the same source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Do Siki
2026-09-29 17:17:05 +02:00
co-authored by Claude Opus 5.5
parent 526f413bfd
commit 5f9a53ed18
14 changed files with 475 additions and 71 deletions
+23 -55
View File
@@ -1,6 +1,7 @@
import Image from 'next/image'
import { localePath, type Locale } from '@/lib/i18n'
import type { getHomeContent, PartnerView } from '@/lib/payload-content'
import type { getHomeContent } from '@/lib/payload-content'
import { groupReferences, type PartnerView, type Relationship } from '@/lib/partner-references'
import ReferencesSection from './ReferencesSection'
import { externalLinkProps } from '@/lib/external-link'
type HomeViewProps = {
@@ -9,18 +10,20 @@ type HomeViewProps = {
locale: Locale
}
// WHY hardcoded itt: a Partners collection (MITHOME-89) csak name/url/logo-t
// tárol, a szekció saját címe/alcíme sosem volt Payload-tartalom (a Home
// Globalból is szándékosan kimaradt, lásd src/globals/Home.ts) — ugyanaz a
// minta, mint a config/site.ts navigáció-feliratoknál.
const PARTNERS_COPY: Record<Locale, { title: string; subtitle: string }> = {
hu: { title: 'Partnereink', subtitle: 'Akikkel együtt dolgozunk' },
en: { title: 'Our Partners', subtitle: 'Who we work with' },
}
export default function HomeView({ content: pageContent, partners, locale }: HomeViewProps) {
const contactHref = localePath(locale, 'contact')
const partnersCopy = PARTNERS_COPY[locale]
const references = groupReferences(partners)
const refCopy = pageContent.referencesSection
const labels = refCopy.relationshipLabels
const relationshipLabel = (relationship: Relationship) =>
({
'client-reference': refCopy.clientsTitle,
'technology-partner': labels.technologyPartner,
infrastructure: labels.infrastructure,
supplier: labels.supplier,
'technology-used': labels.technologyUsed,
'professional-partner': labels.professionalPartner,
})[relationship]
return (
<div className="space-y-0">
{/* Hero Section */}
@@ -228,49 +231,14 @@ export default function HomeView({ content: pageContent, partners, locale }: Hom
</div>
</section>
{/* Partners Section */}
{partners.length > 0 && (
<section className="py-16">
<div className="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 className="text-3xl font-bold text-center mb-3" style={{ color: 'var(--color-foreground)' }}>
{partnersCopy.title}
</h2>
<p className="text-center mb-10" style={{ color: 'var(--color-foreground-muted)' }}>
{partnersCopy.subtitle}
</p>
{/* WHY grid + w-fit + mx-auto: a felhasználó kérésére valódi
mátrix (max 3 oszlop), nem folyó flex-wrap. `w-fit` zsugorítja
a rácsot a tényleges (legfeljebb 3 oszlopnyi) tartalom
szélességére, a `mx-auto` pedig ettől tudja középre venni —
sima `inline-grid`-en az auto margó nem középre igazítana,
mert az egy inline-szintű doboz. */}
<div className="grid w-fit grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-10 justify-items-center mx-auto">
{partners.map((partner) => (
<a
key={partner.name}
href={partner.url}
{...externalLinkProps(partner.url)}
className="group flex flex-col items-center gap-3 opacity-80 hover:opacity-100 transition-opacity duration-200"
title={partner.name}
>
<span className="relative h-12 w-40">
<Image
src={partner.logo.url}
alt={partner.logo.alt}
fill
sizes="160px"
className="object-contain"
/>
</span>
<span className="text-sm" style={{ color: 'var(--color-foreground-muted)' }}>
{partner.name}
</span>
</a>
))}
</div>
</div>
</section>
)}
{/* References (MITHOME-131): clients and partners are separate blocks. */}
<ReferencesSection title={refCopy.clientsTitle} subtitle={refCopy.clientsSubtitle} entries={references.clients} />
<ReferencesSection
title={refCopy.partnersTitle}
subtitle={refCopy.partnersSubtitle}
entries={references.partners}
relationshipLabel={relationshipLabel}
/>
{/* CTA Section */}
<section