Add comprehensive page management system to admin dashboard
Features added: - Database schema for pages and media files with content types (Rich Text, HTML, Markdown) - Admin API routes for full page CRUD operations - Image upload functionality with file management - Rich text editor using TinyMCE with image insertion - Admin interface for creating/editing pages with SEO options - Dynamic navigation and footer integration - Public page display routes with proper SEO metadata - Support for featured images and content excerpts Admin features: - Create/edit/delete pages with rich content editor - Upload and manage images through media library - Configure pages to appear in navigation or footer - Set page status (Draft, Published, Archived) - SEO title and description management - Real-time preview of content changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,9 @@ model User {
|
||||
userPrayers UserPrayer[]
|
||||
readingHistory ReadingHistory[]
|
||||
preferences UserPreference[]
|
||||
createdPages Page[] @relation("PageCreator")
|
||||
updatedPages Page[] @relation("PageUpdater")
|
||||
uploadedFiles MediaFile[]
|
||||
|
||||
@@index([role])
|
||||
}
|
||||
@@ -52,6 +55,10 @@ model BibleVersion {
|
||||
abbreviation String // e.g., "KJV", "CORNILESCU", "NIV"
|
||||
language String // e.g., "en", "ro", "es"
|
||||
description String?
|
||||
country String?
|
||||
englishTitle String?
|
||||
flagImageUrl String?
|
||||
zipFileUrl String?
|
||||
isDefault Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -280,4 +287,64 @@ model UserPreference {
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([userId, key])
|
||||
}
|
||||
|
||||
model Page {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
slug String @unique
|
||||
content String @db.Text
|
||||
contentType PageContentType @default(RICH_TEXT)
|
||||
excerpt String? @db.Text
|
||||
featuredImage String?
|
||||
seoTitle String?
|
||||
seoDescription String?
|
||||
status PageStatus @default(DRAFT)
|
||||
showInNavigation Boolean @default(false)
|
||||
showInFooter Boolean @default(false)
|
||||
navigationOrder Int?
|
||||
footerOrder Int?
|
||||
createdBy String
|
||||
updatedBy String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
publishedAt DateTime?
|
||||
|
||||
creator User @relation("PageCreator", fields: [createdBy], references: [id])
|
||||
updater User @relation("PageUpdater", fields: [updatedBy], references: [id])
|
||||
|
||||
@@index([slug])
|
||||
@@index([status])
|
||||
@@index([showInNavigation, navigationOrder])
|
||||
@@index([showInFooter, footerOrder])
|
||||
}
|
||||
|
||||
model MediaFile {
|
||||
id String @id @default(uuid())
|
||||
filename String
|
||||
originalName String
|
||||
mimeType String
|
||||
size Int
|
||||
path String
|
||||
url String
|
||||
alt String?
|
||||
uploadedBy String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
uploader User @relation(fields: [uploadedBy], references: [id])
|
||||
|
||||
@@index([uploadedBy])
|
||||
@@index([mimeType])
|
||||
}
|
||||
|
||||
enum PageContentType {
|
||||
RICH_TEXT
|
||||
HTML
|
||||
MARKDOWN
|
||||
}
|
||||
|
||||
enum PageStatus {
|
||||
DRAFT
|
||||
PUBLISHED
|
||||
ARCHIVED
|
||||
}
|
||||
Reference in New Issue
Block a user