Firstcommunnion

This commit is contained in:
Benno Tielen 2025-06-08 13:41:44 +02:00
parent 20d6ccce85
commit 79de62dc9a
10 changed files with 6305 additions and 3 deletions

View file

@ -204,6 +204,11 @@ export default function RootLayout({
{
title: "Glaubenswachstum",
items: [
{
title: "Erstkommunion",
description: "Ein Fest der Gemeinschaft mit Jesus",
href: "/gruppe/erstkommunion"
},
{
title: "Alphakurs",
description: "Freude am Glauben entdecken",

View file

@ -4,6 +4,7 @@ import { ContentWithSlider } from '@/compositions/ContentWithSlider/ContentWithS
import { P } from '@/components/Text/Paragraph'
import { Section } from '@/components/Section/Section'
import { NextPrevButtons } from '@/components/NextPrevButtons/NextPrevButtons'
import Link from 'next/link'
const SliderContent = () => {
return (
@ -57,6 +58,10 @@ export default function EucharistPage() {
Die Eucharistie ist mehr als nur ein Gottesdienst. Sie ist ein Fest des Glaubens, eine Quelle der Kraft und
Hoffnung. Sie hilft uns, im Alltag standzuhalten und uns auf das Leben nach dem Tod vorzubereiten.
</P>
<P width={'1/2'}>
<strong>Ab September 2025 fangen mehere Erstkommmunionkurse an!</strong> Mehr Informationen finden Sie <Link href={"/gruppe/erstkommunion"}>hier</Link>.
</P>
<Section />
</ContentWithSlider>

View file

@ -5,6 +5,7 @@ import { DocumentBlock } from '@/collections/blocks/Document'
import { ContactformBlock } from '@/collections/blocks/Contactform'
import { GalleryBlock } from '@/collections/blocks/Gallery'
import { DonationBlock } from '@/collections/blocks/Donation'
import { ButtonBlock } from '@/collections/blocks/Button'
export const Blog: CollectionConfig = {
@ -58,7 +59,8 @@ export const Blog: CollectionConfig = {
DocumentBlock,
DonationBlock,
ContactformBlock,
GalleryBlock
GalleryBlock,
ButtonBlock
],
required: true
},

View file

@ -6,6 +6,7 @@ import { ContactformBlock } from '@/collections/blocks/Contactform'
import { DocumentBlock } from '@/collections/blocks/Document'
import { lexicalHTML } from '@payloadcms/richtext-lexical'
import { DonationBlock } from '@/collections/blocks/Donation'
import { ButtonBlock } from '@/collections/blocks/Button'
export const Groups: CollectionConfig = {
slug: 'group',
@ -68,7 +69,8 @@ export const Groups: CollectionConfig = {
GalleryBlock,
DocumentBlock,
DonationBlock,
ContactformBlock
ContactformBlock,
ButtonBlock
]
}
],

View file

@ -0,0 +1,21 @@
import { Block } from 'payload'
export const ButtonBlock: Block = {
slug: 'button',
labels: {
singular: "Button",
plural: "Button"
},
fields: [
{
name: 'text',
type: 'text',
required: true,
},
{
name: 'url',
type: 'text',
required: true,
}
]
}

View file

@ -64,6 +64,21 @@ export function Blocks({ content }: BlocksProps) {
<DonationForm />
</Section>
}
if (item.blockType === "button") {
return <Section key={item.id} padding={"small"}>
<Container>
<Button
size={"lg"}
type={"button"}
href={item.url}
target={"_blank"}
>
{item.text}
</Button>
</Container>
</Section>
}
})}
</div>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,57 @@
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
await db.execute(sql`
CREATE TABLE IF NOT EXISTS "blog_blocks_button" (
"_order" integer NOT NULL,
"_parent_id" uuid NOT NULL,
"_path" text NOT NULL,
"id" varchar PRIMARY KEY NOT NULL,
"text" varchar NOT NULL,
"url" varchar NOT NULL,
"block_name" varchar
);
CREATE TABLE IF NOT EXISTS "group_blocks_button" (
"_order" integer NOT NULL,
"_parent_id" uuid NOT NULL,
"_path" text NOT NULL,
"id" varchar PRIMARY KEY NOT NULL,
"text" varchar NOT NULL,
"url" varchar NOT NULL,
"block_name" varchar
);
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2025-06-15T10:51:24.116Z';
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2025-06-15T10:51:24.203Z';
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2025-07-08T10:51:24.219Z';
DO $$ BEGIN
ALTER TABLE "blog_blocks_button" ADD CONSTRAINT "blog_blocks_button_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."blog"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
DO $$ BEGIN
ALTER TABLE "group_blocks_button" ADD CONSTRAINT "group_blocks_button_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."group"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
CREATE INDEX IF NOT EXISTS "blog_blocks_button_order_idx" ON "blog_blocks_button" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "blog_blocks_button_parent_id_idx" ON "blog_blocks_button" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "blog_blocks_button_path_idx" ON "blog_blocks_button" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "group_blocks_button_order_idx" ON "group_blocks_button" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "group_blocks_button_parent_id_idx" ON "group_blocks_button" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "group_blocks_button_path_idx" ON "group_blocks_button" USING btree ("_path");`)
}
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
await db.execute(sql`
ALTER TABLE "blog_blocks_button" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "group_blocks_button" DISABLE ROW LEVEL SECURITY;
DROP TABLE "blog_blocks_button" CASCADE;
DROP TABLE "group_blocks_button" CASCADE;
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2025-03-23T13:49:18.078Z';
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2025-03-23T13:49:18.163Z';
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2025-04-21T12:49:18.187Z';`)
}

View file

@ -6,6 +6,7 @@ import * as migration_20250202_104742 from './20250202_104742';
import * as migration_20250224_083653_cleanup from './20250224_083653_cleanup';
import * as migration_20250319_101337_donationbox from './20250319_101337_donationbox';
import * as migration_20250322_134918_classifieds from './20250322_134918_classifieds';
import * as migration_20250608_105124_new_blocks from './20250608_105124_new_blocks';
export const migrations = [
{
@ -46,6 +47,11 @@ export const migrations = [
{
up: migration_20250322_134918_classifieds.up,
down: migration_20250322_134918_classifieds.down,
name: '20250322_134918_classifieds'
name: '20250322_134918_classifieds',
},
{
up: migration_20250608_105124_new_blocks.up,
down: migration_20250608_105124_new_blocks.down,
name: '20250608_105124_new_blocks'
},
];

View file

@ -319,6 +319,13 @@ export interface Blog {
blockName?: string | null;
blockType: 'gallery';
}
| {
text: string;
url: string;
id?: string | null;
blockName?: string | null;
blockType: 'button';
}
)[];
updatedAt: string;
createdAt: string;
@ -468,6 +475,13 @@ export interface Group {
blockName?: string | null;
blockType: 'contactform';
}
| {
text: string;
url: string;
id?: string | null;
blockName?: string | null;
blockType: 'button';
}
)[]
| null;
updatedAt: string;
@ -791,6 +805,14 @@ export interface BlogSelect<T extends boolean = true> {
id?: T;
blockName?: T;
};
button?:
| T
| {
text?: T;
url?: T;
id?: T;
blockName?: T;
};
};
updatedAt?: T;
createdAt?: T;
@ -923,6 +945,14 @@ export interface GroupSelect<T extends boolean = true> {
id?: T;
blockName?: T;
};
button?:
| T
| {
text?: T;
url?: T;
id?: T;
blockName?: T;
};
};
updatedAt?: T;
createdAt?: T;