diff --git a/drizzle/0001_redaktionskalender.sql b/drizzle/0001_redaktionskalender.sql new file mode 100644 index 0000000..9ba7195 --- /dev/null +++ b/drizzle/0001_redaktionskalender.sql @@ -0,0 +1,33 @@ +CREATE TABLE `editorial_comments` ( + `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, + `item_id` integer NOT NULL, + `user_id` integer, + `body` text NOT NULL, + `created_at` integer DEFAULT (unixepoch()) NOT NULL, + FOREIGN KEY (`item_id`) REFERENCES `editorial_items`(`id`) ON UPDATE no action ON DELETE cascade, + FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null +); +--> statement-breakpoint +CREATE INDEX `editorial_comments_item_idx` ON `editorial_comments` (`item_id`);--> statement-breakpoint +CREATE TABLE `editorial_items` ( + `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, + `title` text NOT NULL, + `notes` text DEFAULT '' NOT NULL, + `kind` text DEFAULT 'post' NOT NULL, + `status` text DEFAULT 'idea' NOT NULL, + `assignee_id` integer, + `date` text DEFAULT '' NOT NULL, + `due_date` text DEFAULT '' NOT NULL, + `post_id` integer, + `page_id` integer, + `created_by` integer, + `created_at` integer DEFAULT (unixepoch()) NOT NULL, + `updated_at` integer DEFAULT (unixepoch()) NOT NULL, + FOREIGN KEY (`assignee_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null, + FOREIGN KEY (`post_id`) REFERENCES `posts`(`id`) ON UPDATE no action ON DELETE set null, + FOREIGN KEY (`page_id`) REFERENCES `pages`(`id`) ON UPDATE no action ON DELETE set null, + FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null +); +--> statement-breakpoint +CREATE INDEX `editorial_date_idx` ON `editorial_items` (`date`);--> statement-breakpoint +CREATE INDEX `editorial_assignee_idx` ON `editorial_items` (`assignee_id`); \ No newline at end of file diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json new file mode 100644 index 0000000..44aa99a --- /dev/null +++ b/drizzle/meta/0001_snapshot.json @@ -0,0 +1,1203 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "7e0a0b4d-a15e-4201-987a-d7cf4d48cdcc", + "prevId": "7a4d026d-cee9-4282-bf2f-d13c3a24cb7a", + "tables": { + "contacts": { + "name": "contacts", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "phone": { + "name": "phone", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "photo_id": { + "name": "photo_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "listed": { + "name": "listed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": {}, + "foreignKeys": { + "contacts_photo_id_media_id_fk": { + "name": "contacts_photo_id_media_id_fk", + "tableFrom": "contacts", + "tableTo": "media", + "columnsFrom": [ + "photo_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "editorial_comments": { + "name": "editorial_comments", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "item_id": { + "name": "item_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": { + "editorial_comments_item_idx": { + "name": "editorial_comments_item_idx", + "columns": [ + "item_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "editorial_comments_item_id_editorial_items_id_fk": { + "name": "editorial_comments_item_id_editorial_items_id_fk", + "tableFrom": "editorial_comments", + "tableTo": "editorial_items", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "editorial_comments_user_id_users_id_fk": { + "name": "editorial_comments_user_id_users_id_fk", + "tableFrom": "editorial_comments", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "editorial_items": { + "name": "editorial_items", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'post'" + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'idea'" + }, + "assignee_id": { + "name": "assignee_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "due_date": { + "name": "due_date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "post_id": { + "name": "post_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "page_id": { + "name": "page_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_by": { + "name": "created_by", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": { + "editorial_date_idx": { + "name": "editorial_date_idx", + "columns": [ + "date" + ], + "isUnique": false + }, + "editorial_assignee_idx": { + "name": "editorial_assignee_idx", + "columns": [ + "assignee_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "editorial_items_assignee_id_users_id_fk": { + "name": "editorial_items_assignee_id_users_id_fk", + "tableFrom": "editorial_items", + "tableTo": "users", + "columnsFrom": [ + "assignee_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "editorial_items_post_id_posts_id_fk": { + "name": "editorial_items_post_id_posts_id_fk", + "tableFrom": "editorial_items", + "tableTo": "posts", + "columnsFrom": [ + "post_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "editorial_items_page_id_pages_id_fk": { + "name": "editorial_items_page_id_pages_id_fk", + "tableFrom": "editorial_items", + "tableTo": "pages", + "columnsFrom": [ + "page_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "editorial_items_created_by_users_id_fk": { + "name": "editorial_items_created_by_users_id_fk", + "tableFrom": "editorial_items", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "events": { + "name": "events", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'event'" + }, + "start_date": { + "name": "start_date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "end_date": { + "name": "end_date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "start_time": { + "name": "start_time", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "end_time": { + "name": "end_time", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "published": { + "name": "published", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": { + "events_start_idx": { + "name": "events_start_idx", + "columns": [ + "start_date" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "media": { + "name": "media", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "filename": { + "name": "filename", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "thumbnail": { + "name": "thumbnail", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "original_name": { + "name": "original_name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "size": { + "name": "size", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "width": { + "name": "width", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "height": { + "name": "height", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "alt": { + "name": "alt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": { + "media_filename_unique": { + "name": "media_filename_unique", + "columns": [ + "filename" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "messages": { + "name": "messages", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "read": { + "name": "read", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "pages": { + "name": "pages", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "teaser": { + "name": "teaser", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'file-text'" + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'sky'" + }, + "cover_id": { + "name": "cover_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "content_easy": { + "name": "content_easy", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "attachments": { + "name": "attachments", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "contact_ids": { + "name": "contact_ids", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "published": { + "name": "published", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": { + "pages_slug_idx": { + "name": "pages_slug_idx", + "columns": [ + "slug" + ], + "isUnique": true + }, + "pages_parent_idx": { + "name": "pages_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "pages_parent_id_pages_id_fk": { + "name": "pages_parent_id_pages_id_fk", + "tableFrom": "pages", + "tableTo": "pages", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "pages_cover_id_media_id_fk": { + "name": "pages_cover_id_media_id_fk", + "tableFrom": "pages", + "tableTo": "media", + "columnsFrom": [ + "cover_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "posts": { + "name": "posts", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "teaser": { + "name": "teaser", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "cover_id": { + "name": "cover_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "content_easy": { + "name": "content_easy", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "video_url": { + "name": "video_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "gallery": { + "name": "gallery", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "attachments": { + "name": "attachments", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "contact_ids": { + "name": "contact_ids", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "pinned": { + "name": "pinned", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "published": { + "name": "published", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "published_at": { + "name": "published_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": { + "posts_slug_idx": { + "name": "posts_slug_idx", + "columns": [ + "slug" + ], + "isUnique": true + }, + "posts_published_idx": { + "name": "posts_published_idx", + "columns": [ + "published_at" + ], + "isUnique": false + } + }, + "foreignKeys": { + "posts_cover_id_media_id_fk": { + "name": "posts_cover_id_media_id_fk", + "tableFrom": "posts", + "tableTo": "media", + "columnsFrom": [ + "cover_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sessions": { + "name": "sessions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "sessions_user_id_users_id_fk": { + "name": "sessions_user_id_users_id_fk", + "tableFrom": "sessions", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "settings": { + "name": "settings", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tiles": { + "name": "tiles", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'star'" + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'sky'" + }, + "href": { + "name": "href", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "users": { + "name": "users", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "password_hash": { + "name": "password_hash", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'editor'" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())" + } + }, + "indexes": { + "users_email_unique": { + "name": "users_email_unique", + "columns": [ + "email" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 8d281f6..b4362c1 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -8,6 +8,13 @@ "when": 1790710683402, "tag": "0000_init", "breakpoints": true + }, + { + "idx": 1, + "version": "6", + "when": 1790780351202, + "tag": "0001_redaktionskalender", + "breakpoints": true } ] } \ No newline at end of file diff --git a/scripts/seed.ts b/scripts/seed.ts index a2d89f5..9ba0f09 100644 --- a/scripts/seed.ts +++ b/scripts/seed.ts @@ -27,7 +27,7 @@ if (db.select().from(s.pages).all().length && !force) { process.exit(0); } if (force) { - for (const t of [s.tiles, s.posts, s.pages, s.events, s.contacts, s.messages, s.media, s.settings]) db.delete(t).run(); + for (const t of [s.editorialComments, s.editorialItems, s.tiles, s.posts, s.pages, s.events, s.contacts, s.messages, s.media, s.settings]) db.delete(t).run(); // alte Upload-Dateien mit entfernen for (const f of fs.readdirSync(UPLOAD_DIR)) fs.rmSync(path.join(UPLOAD_DIR, f), { force: true }); } @@ -243,6 +243,25 @@ const eventDefs: (typeof s.events.$inferInsert)[] = [ ]; for (const e of eventDefs) db.insert(s.events).values(e).run(); +// ─── Redaktionskalender ────────────────────────────────────────────────────── + +const teamIds = db.select({ id: s.users.id }).from(s.users).all().map((u) => u.id); +const who = (i: number) => (teamIds.length ? teamIds[i % teamIds.length] : null); +const planDefs: (typeof s.editorialItems.$inferInsert)[] = [ + { title: 'Rückblick Kunstausstellung', kind: 'post', status: 'ready', date: iso(27), dueDate: iso(24), notes: 'Fotos von der Vernissage besorgen (Kreativwerkstatt fragen).\n\nZitat von zwei Künstler:innen einholen.' }, + { title: 'Speiseplan November hochladen', kind: 'page', status: 'progress', date: iso(30), dueDate: iso(28), notes: 'PDF kommt von der Küche.' }, + { title: 'Interview mit dem neuen Werkstattrat', kind: 'post', status: 'review', date: iso(9), dueDate: iso(6), notes: 'Text liegt vor, Freigabe durch Jonas Pieper steht aus.' }, + { title: 'Aushang Weihnachtsferien', kind: 'print', status: 'idea', date: iso(60), notes: 'In Leichter Sprache, mit Piktogrammen.' }, + { title: 'Social-Media-Post Tanzabend', kind: 'social', status: 'progress', date: iso(19), dueDate: iso(17) }, + { title: 'Portrait: 25 Jahre in der Holzwerkstatt', kind: 'post', status: 'idea', notes: 'Idee von Aylin – Jubilar im Dezember.' }, + { title: 'Neue Seite „Fahrdienst“', kind: 'page', status: 'idea', notes: 'Viele Nachfragen im Postfach. Busfahrplan + Ansprechpartner.' }, + { title: 'Erste-Hilfe-Kurs bewerben', kind: 'post', status: 'done', date: iso(-20) }, + { title: 'Fotos Sommerfest sortieren', kind: 'other', status: 'progress', date: '', dueDate: iso(-2) } +]; +planDefs.forEach((p, i) => db.insert(s.editorialItems).values({ ...p, assigneeId: who(i), createdBy: who(0) }).run()); +const firstPlan = db.select({ id: s.editorialItems.id }).from(s.editorialItems).get(); +if (firstPlan && teamIds.length) db.insert(s.editorialComments).values({ itemId: firstPlan.id + 2, userId: teamIds[0], body: 'Habe Jonas heute angeschrieben, Antwort kommt bis Freitag.' }).run(); + db.insert(s.messages).values({ name: 'Petra (Demo)', email: 'petra@example.org', message: 'Hallo! Die App ist super. Könnt ihr auch den Busfahrplan einstellen?' }).run(); console.log('✔ Demo-Inhalte angelegt.'); diff --git a/src/lib/admin/actions.ts b/src/lib/admin/actions.ts new file mode 100644 index 0000000..c3b7d60 --- /dev/null +++ b/src/lib/admin/actions.ts @@ -0,0 +1,25 @@ +import { deserialize } from '$app/forms'; +import { invalidateAll } from '$app/navigation'; +import { toasts } from './toast.svelte'; + +/** + * Ruft eine Form-Action der aktuellen Seite ohne Formular auf (z. B. nach Ziehen & Ablegen), + * lädt danach die Daten neu und meldet Fehler als Hinweis. + */ +export async function callAction(action: string, data: Record, success?: string) { + const body = new FormData(); + for (const [k, v] of Object.entries(data)) body.set(k, v == null ? '' : String(v)); + const res = await fetch(`?/${action}`, { method: 'POST', body, headers: { 'x-sveltekit-action': 'true' } }); + const result = deserialize(await res.text()); + if (result.type === 'failure') { + toasts.show(String(result.data?.error ?? 'Das hat nicht geklappt.'), 'error'); + return null; + } + if (result.type === 'error') { + toasts.show(result.error?.message ?? 'Das hat nicht geklappt.', 'error'); + return null; + } + await invalidateAll(); + if (success) toasts.show(success); + return result.type === 'success' ? (result.data ?? {}) : {}; +} diff --git a/src/lib/admin/calendar/BoardView.svelte b/src/lib/admin/calendar/BoardView.svelte new file mode 100644 index 0000000..69954bf --- /dev/null +++ b/src/lib/admin/calendar/BoardView.svelte @@ -0,0 +1,74 @@ + + +
+ {#each columns as col (col.status)} +
{ + if (!e.dataTransfer?.types.includes('application/x-redaktion')) return; + e.preventDefault(); + dropTarget = col.status; + }} + ondragleave={() => dropTarget === col.status && (dropTarget = null)} + ondrop={(e) => drop(e, col.status)} + > +
+ +

{EDITORIAL_STATUS[col.status]}

+ {col.items.length} + +
+
    + {#each col.items as entry (entry.id)} +
  • + + {#if entry.type === 'plan' && entry.date} + geplant für {formatShort(entry.date)} + {/if} +
  • + {:else} +
  • Hierher ziehen
  • + {/each} +
+
+ {/each} +
diff --git a/src/lib/admin/calendar/EntryChip.svelte b/src/lib/admin/calendar/EntryChip.svelte new file mode 100644 index 0000000..084933f --- /dev/null +++ b/src/lib/admin/calendar/EntryChip.svelte @@ -0,0 +1,97 @@ + + +{#if entry.type === 'plan'} + +{:else if entry.type === 'post'} + +{:else} + +{/if} diff --git a/src/lib/admin/calendar/ItemDialog.svelte b/src/lib/admin/calendar/ItemDialog.svelte new file mode 100644 index 0000000..f972227 --- /dev/null +++ b/src/lib/admin/calendar/ItemDialog.svelte @@ -0,0 +1,273 @@ + + + { + item = null; + confirmDelete = false; + }} + aria-labelledby="item-title" + class="m-0 ml-auto h-dvh max-h-dvh w-full max-w-xl bg-surface text-ink p-0 shadow-float backdrop:bg-black/40" +> + {#if item} +
+
+

{isNew ? 'Neue Planung' : 'Planung bearbeiten'}

+ +
+ +
+
{ + busy = true; + return async ({ result }) => { + busy = false; + if (result.type === 'failure') toasts.show(String(result.data?.error ?? 'Bitte Eingaben prüfen.'), 'error'); + else if (result.type === 'success') { + toasts.show('Gespeichert'); + await invalidateAll(); + item = null; + } + }; + }} + > + +
+ + + +
+ +
+ Status + +
+ {#each statusKeys as s (s)} + + {/each} +
+
+ +
+
+ + +
+
+ + +
+
+ + +

Leer = Ideenspeicher

+
+
+ + +
+
+ +
+ + +
+ + {#if kind === 'post'} +
+ + +
+ {:else} + + {/if} + {#if kind === 'page'} +
+ + +
+ {:else} + + {/if} + + {#if !isNew && (item.postId || item.pageId || kind === 'post')} +
+ {#if item.postId} + Meldung bearbeiten + {:else if kind === 'post'} + + {/if} + {#if item.pageId} + Seite bearbeiten + {/if} +
+ {/if} +
+ + {#if !isNew} +
+

Kommentare

+ {#if comments.length} +
    + {#each comments as c (c.id)} +
  1. +
    + {c.name} + + {#if c.userId === me || isAdmin} + + {/if} +
    +

    {c.body}

    +
  2. + {/each} +
+ {:else} +

Noch keine Kommentare.

+ {/if} +
+ + + +
+

Senden mit Strg + Enter

+
+ {/if} +
+ +
+ + + {#if !isNew} + + {/if} +
+
+ {/if} +
diff --git a/src/lib/admin/calendar/ListView.svelte b/src/lib/admin/calendar/ListView.svelte new file mode 100644 index 0000000..b3007ff --- /dev/null +++ b/src/lib/admin/calendar/ListView.svelte @@ -0,0 +1,52 @@ + + +
+ + + + + + + + + + + + + + {#each rows as r (r.id)} + {@const overdue = !!r.dueDate && r.dueDate < today && r.status !== 'done'} + + + + + + + + + {:else} + + {/each} + +
Alle Planungen
TitelStatusErscheint
+ + + + {EDITORIAL_STATUS[r.status]} + + {r.date ? formatShort(r.date) : 'Ideenspeicher'}
Keine Planungen für diese Auswahl.
+
diff --git a/src/lib/admin/calendar/MonthView.svelte b/src/lib/admin/calendar/MonthView.svelte new file mode 100644 index 0000000..5c786a8 --- /dev/null +++ b/src/lib/admin/calendar/MonthView.svelte @@ -0,0 +1,169 @@ + + +
+ + + + +
    + {#each days.filter((d) => d.startsWith(month) && ((byDay.get(d)?.length ?? 0) > 0 || d === today)) as day (day)} +
  1. +
    +

    {formatLong(day)}{day === today ? ' · heute' : ''}

    + +
    +
      + {#each byDay.get(day) ?? [] as entry (`${entry.type}-${entry.id}`)} +
    • + {/each} +
    +
  2. + {:else} +
  3. In diesem Monat ist noch nichts geplant.
  4. + {/each} +
+ + +
allowDrop(e, 'ideen')} + ondragleave={() => dropTarget === 'ideen' && (dropTarget = null)} + ondrop={(e) => drop(e, '')} + > +
+

Ideenspeicher

+ +
+

Noch ohne Datum. Zum Planen auf einen Tag ziehen oder öffnen und ein Datum wählen.

+ {#if ideas.length} +
    + {#each ideas as entry (entry.id)} +
  • + {/each} +
+ {:else} +

Keine offenen Ideen.

+ {/if} +
+
diff --git a/src/lib/editorial.ts b/src/lib/editorial.ts new file mode 100644 index 0000000..5f9c80e --- /dev/null +++ b/src/lib/editorial.ts @@ -0,0 +1,67 @@ +/** Bezeichnungen für den Redaktionskalender (Server und Browser). */ + +export const EDITORIAL_KINDS = { + post: 'Meldung', + page: 'Seite', + event: 'Termin', + social: 'Social Media', + print: 'Aushang / Druck', + other: 'Sonstiges' +} as const; + +/** Reihenfolge = Arbeitsablauf (Spalten im Board) */ +export const EDITORIAL_STATUS = { + idea: 'Idee', + progress: 'In Arbeit', + review: 'Zur Freigabe', + ready: 'Geplant', + done: 'Erledigt' +} as const; + +export type EditorialKind = keyof typeof EDITORIAL_KINDS; +export type EditorialStatus = keyof typeof EDITORIAL_STATUS; + +export const kindKeys = Object.keys(EDITORIAL_KINDS) as EditorialKind[]; +export const statusKeys = Object.keys(EDITORIAL_STATUS) as EditorialStatus[]; + +export const isKind = (v: string): v is EditorialKind => v in EDITORIAL_KINDS; +export const isStatus = (v: string): v is EditorialStatus => v in EDITORIAL_STATUS; + +/** Farbe je Status – nicht nur Farbe, sondern immer mit Text/Symbol kombiniert (Barrierefreiheit) */ +export const STATUS_TONE: Record = { + idea: 'slate', + progress: 'sky', + review: 'amber', + ready: 'violet', + done: 'emerald' +}; + +/** Ein Eintrag im Kalender – Planung, Meldung oder Termin */ +export type CalendarEntry = + | { + type: 'plan'; + id: number; + title: string; + notes: string; + kind: EditorialKind; + status: EditorialStatus; + date: string; + dueDate: string; + assigneeId: number | null; + postId: number | null; + pageId: number | null; + commentCount: number; + } + | { type: 'post'; id: number; title: string; date: string; time: string; published: boolean; live: boolean } + | { type: 'event'; id: number; title: string; date: string; endDate: string; closure: boolean }; + +export type TeamMember = { id: number; name: string; initials: string }; + +export const initials = (name: string) => + name + .split(/\s+/) + .filter(Boolean) + .map((w) => w[0]) + .slice(0, 2) + .join('') + .toUpperCase(); diff --git a/src/lib/server/db/schema.ts b/src/lib/server/db/schema.ts index a15aa99..5194cbc 100644 --- a/src/lib/server/db/schema.ts +++ b/src/lib/server/db/schema.ts @@ -176,6 +176,50 @@ export const messages = sqliteTable('messages', { ...timestamps }); +// ─── Redaktionskalender ──────────────────────────────────────────────────────── + +/** Geplante Beiträge und Aufgaben des Redaktionsteams */ +export const editorialItems = sqliteTable( + 'editorial_items', + { + id: integer('id').primaryKey({ autoIncrement: true }), + title: text('title').notNull(), + notes: text('notes').notNull().default(''), + kind: text('kind', { enum: ['post', 'page', 'event', 'social', 'print', 'other'] }) + .notNull() + .default('post'), + status: text('status', { enum: ['idea', 'progress', 'review', 'ready', 'done'] }) + .notNull() + .default('idea'), + assigneeId: integer('assignee_id').references(() => users.id, { onDelete: 'set null' }), + /** Geplanter Erscheinungstag YYYY-MM-DD, leer = Ideenspeicher */ + date: text('date').notNull().default(''), + /** Abgabe / Frist YYYY-MM-DD, leer = keine */ + dueDate: text('due_date').notNull().default(''), + postId: integer('post_id').references(() => posts.id, { onDelete: 'set null' }), + pageId: integer('page_id').references(() => pages.id, { onDelete: 'set null' }), + createdBy: integer('created_by').references(() => users.id, { onDelete: 'set null' }), + ...timestamps + }, + (t) => [index('editorial_date_idx').on(t.date), index('editorial_assignee_idx').on(t.assigneeId)] +); + +export const editorialComments = sqliteTable( + 'editorial_comments', + { + id: integer('id').primaryKey({ autoIncrement: true }), + itemId: integer('item_id') + .notNull() + .references(() => editorialItems.id, { onDelete: 'cascade' }), + userId: integer('user_id').references(() => users.id, { onDelete: 'set null' }), + body: text('body').notNull(), + createdAt: integer('created_at', { mode: 'timestamp' }) + .notNull() + .default(sql`(unixepoch())`) + }, + (t) => [index('editorial_comments_item_idx').on(t.itemId)] +); + export type User = typeof users.$inferSelect; export type Media = typeof media.$inferSelect; export type Contact = typeof contacts.$inferSelect; @@ -184,3 +228,5 @@ export type Post = typeof posts.$inferSelect; export type Event = typeof events.$inferSelect; export type Tile = typeof tiles.$inferSelect; export type Message = typeof messages.$inferSelect; +export type EditorialItem = typeof editorialItems.$inferSelect; +export type EditorialComment = typeof editorialComments.$inferSelect; diff --git a/src/lib/server/editorial.ts b/src/lib/server/editorial.ts new file mode 100644 index 0000000..81e31ec --- /dev/null +++ b/src/lib/server/editorial.ts @@ -0,0 +1,186 @@ +import { and, asc, eq, gte, inArray, lte, ne, sql, type SQL } from 'drizzle-orm'; +import { db } from './db'; +import { editorialComments, editorialItems, events, posts, users } from './db/schema'; +import { addDays, TZ, today } from '$lib/dates'; +import { initials, type CalendarEntry, type EditorialKind, type TeamMember } from '$lib/editorial'; + +/** Datum (YYYY-MM-DD) eines Zeitpunkts in deutscher Zeit */ +const berlinDate = (d: Date) => new Intl.DateTimeFormat('sv-SE', { timeZone: TZ }).format(d); +const berlinTime = (d: Date) => + new Intl.DateTimeFormat('de-DE', { timeZone: TZ, hour: '2-digit', minute: '2-digit' }).format(d); + +export function team(): TeamMember[] { + return db + .select({ id: users.id, name: users.name }) + .from(users) + .orderBy(asc(users.name)) + .all() + .map((u) => ({ ...u, initials: initials(u.name) })); +} + +/** Kalenderraster für einen Monat: von Montag vor dem 1. bis Sonntag nach dem Letzten. */ +export function monthGrid(month: string) { + const first = `${month}-01`; + const d = new Date(`${first}T12:00:00Z`); + const weekday = (d.getUTCDay() + 6) % 7; // Montag = 0 + const start = addDays(first, -weekday); + const next = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + 1, 1, 12)); + const last = addDays(next.toISOString().slice(0, 10), -1); + const lastWeekday = (new Date(`${last}T12:00:00Z`).getUTCDay() + 6) % 7; + const end = addDays(last, 6 - lastWeekday); + const days: string[] = []; + for (let x = start; x <= end; x = addDays(x, 1)) days.push(x); + return { first, last, start, end, days }; +} + +export type Filters = { person: number | null; kind: EditorialKind | null; hideDone: boolean }; + +function planConditions(f: Filters): SQL[] { + const c: SQL[] = []; + if (f.person) c.push(eq(editorialItems.assigneeId, f.person)); + if (f.kind) c.push(eq(editorialItems.kind, f.kind)); + if (f.hideDone) c.push(ne(editorialItems.status, 'done')); + return c; +} + +function commentCounts(ids: number[]) { + if (!ids.length) return new Map(); + return new Map( + db + .select({ id: editorialComments.itemId, n: sql`count(*)` }) + .from(editorialComments) + .where(inArray(editorialComments.itemId, ids)) + .groupBy(editorialComments.itemId) + .all() + .map((r) => [r.id, r.n]) + ); +} + +function toPlanEntries(rows: (typeof editorialItems.$inferSelect)[]): CalendarEntry[] { + const counts = commentCounts(rows.map((r) => r.id)); + return rows.map((r) => ({ + type: 'plan', + id: r.id, + title: r.title, + notes: r.notes, + kind: r.kind, + status: r.status, + date: r.date, + dueDate: r.dueDate, + assigneeId: r.assigneeId, + postId: r.postId, + pageId: r.pageId, + commentCount: counts.get(r.id) ?? 0 + })); +} + +/** + * Alle Einträge zwischen from und to: Planungen, Meldungen (nach Erscheinungsdatum) + * und – als Orientierung – Termine & Schließzeiten. + */ +export function entriesBetween(from: string, to: string, f: Filters, opts = { posts: true, events: true }): CalendarEntry[] { + const out: CalendarEntry[] = toPlanEntries( + db + .select() + .from(editorialItems) + .where(and(gte(editorialItems.date, from), lte(editorialItems.date, to), ...planConditions(f))) + .orderBy(asc(editorialItems.date), asc(editorialItems.id)) + .all() + ); + + // Meldungen zeigen nur, wenn nicht nach Person gefiltert wird oder die Art „Meldung“ passt + if (opts.posts && !f.person && (!f.kind || f.kind === 'post')) { + const now = Date.now(); + const rows = db + .select({ id: posts.id, title: posts.title, publishedAt: posts.publishedAt, published: posts.published }) + .from(posts) + // großzügiges Fenster, genau wird unten nach deutscher Zeit gefiltert + .where(and(gte(posts.publishedAt, new Date(`${addDays(from, -1)}T00:00:00Z`)), lte(posts.publishedAt, new Date(`${addDays(to, 1)}T23:59:59Z`)))) + .all(); + for (const p of rows) { + const date = berlinDate(p.publishedAt); + if (date < from || date > to) continue; + out.push({ + type: 'post', + id: p.id, + title: p.title, + date, + time: berlinTime(p.publishedAt), + published: p.published, + live: p.published && p.publishedAt.getTime() <= now + }); + } + } + + if (opts.events && !f.person && !f.kind) { + const endOrStart = sql`coalesce(nullif(${events.endDate}, ''), ${events.startDate})`; + const rows = db + .select() + .from(events) + .where(and(lte(events.startDate, to), gte(endOrStart, from))) + .orderBy(asc(events.startDate)) + .all(); + for (const e of rows) { + out.push({ type: 'event', id: e.id, title: e.title, date: e.startDate, endDate: e.endDate, closure: e.kind === 'closure' }); + } + } + return out; +} + +/** Ideenspeicher: Planungen ohne Datum */ +export function unscheduled(f: Filters): CalendarEntry[] { + return toPlanEntries( + db + .select() + .from(editorialItems) + .where(and(eq(editorialItems.date, ''), ...planConditions(f))) + .orderBy(asc(editorialItems.id)) + .all() + ); +} + +/** Alle Planungen (für Board und Liste), optional gefiltert */ +export function allPlans(f: Filters): CalendarEntry[] { + return toPlanEntries( + db + .select() + .from(editorialItems) + .where(and(...planConditions(f))) + .orderBy(sql`${editorialItems.date} = ''`, asc(editorialItems.date), asc(editorialItems.id)) + .all() + ); +} + +/** Offene Aufgaben einer Person – überfällige zuerst */ +export function myTasks(userId: number, limit = 6) { + const rows = db + .select() + .from(editorialItems) + .where(and(eq(editorialItems.assigneeId, userId), ne(editorialItems.status, 'done'))) + .all(); + const t = today(); + const key = (r: (typeof rows)[number]) => r.dueDate || r.date || '9999'; + return rows + .sort((a, b) => key(a).localeCompare(key(b))) + .slice(0, limit) + .map((r) => ({ + id: r.id, + title: r.title, + status: r.status, + kind: r.kind, + date: r.date, + dueDate: r.dueDate, + overdue: !!r.dueDate && r.dueDate < t + })); +} + +export function commentsFor(itemId: number) { + return db + .select({ id: editorialComments.id, body: editorialComments.body, createdAt: editorialComments.createdAt, userId: editorialComments.userId, name: users.name }) + .from(editorialComments) + .leftJoin(users, eq(editorialComments.userId, users.id)) + .where(eq(editorialComments.itemId, itemId)) + .orderBy(asc(editorialComments.id)) + .all() + .map((c) => ({ ...c, name: c.name ?? 'Ehemaliges Mitglied', createdAt: c.createdAt.toISOString() })); +} diff --git a/src/routes/admin/(panel)/+layout.svelte b/src/routes/admin/(panel)/+layout.svelte index 22db8ea..c060a2d 100644 --- a/src/routes/admin/(panel)/+layout.svelte +++ b/src/routes/admin/(panel)/+layout.svelte @@ -1,6 +1,7 @@ + +Redaktionskalender · {data.brand.appName} + + + {#snippet actions()} + + {/snippet} + + + +
+ + + {#if data.view === 'monat'} +
+ +

{formatMonthYear(`${data.month}-01`)}

+ + {#if data.month !== data.today.slice(0, 7)} + + {/if} +
+ {/if} + +
+ + + + + {#if data.view !== 'board'} + + {/if} +
+
+ +{#if data.view === 'monat'} + create(d)} /> +

+ Einträge per Maus auf einen anderen Tag ziehen – oder öffnen und das Datum ändern. + Meldung online + Meldung geplant / Entwurf +

+{:else if data.view === 'board'} + +

Karten zwischen den Spalten ziehen, um den Status zu ändern – oder öffnen und den Status wählen.

+{:else} + +{/if} + + diff --git a/src/routes/admin/(panel)/redaktion/[id]/kommentare/+server.ts b/src/routes/admin/(panel)/redaktion/[id]/kommentare/+server.ts new file mode 100644 index 0000000..f84e1d7 --- /dev/null +++ b/src/routes/admin/(panel)/redaktion/[id]/kommentare/+server.ts @@ -0,0 +1,4 @@ +import { json } from '@sveltejs/kit'; +import { commentsFor } from '$lib/server/editorial'; + +export const GET = ({ params }) => json(commentsFor(Number(params.id)));