feat(blog): add subscription-only content gating
Adds SubscriptionOnly flag to blog posts to restrict full content access to active subscribers. Shows teaser/preview for non-subscribers with subscribe CTA. Integrates with repository subscription system when monetization is enabled. Updates v2 API structs and editor UI with subscription toggle. Admins and repo writers bypass the gate.
This commit is contained in:
@@ -14,14 +14,15 @@ import (
|
||||
|
||||
// BlogPostForm is the form for creating/editing blog posts.
|
||||
type BlogPostForm struct {
|
||||
Title string `binding:"Required;MaxSize(255)"`
|
||||
Subtitle string `binding:"MaxSize(500)"`
|
||||
Content string `binding:"Required"`
|
||||
Tags string `binding:"MaxSize(1000)"`
|
||||
Series string `binding:"MaxSize(255)"`
|
||||
FeaturedImage string // attachment UUID
|
||||
Status int `binding:"Range(0,2)"` // 0=draft, 1=public, 2=published
|
||||
AllowComments bool
|
||||
Title string `binding:"Required;MaxSize(255)"`
|
||||
Subtitle string `binding:"MaxSize(500)"`
|
||||
Content string `binding:"Required"`
|
||||
Tags string `binding:"MaxSize(1000)"`
|
||||
Series string `binding:"MaxSize(255)"`
|
||||
FeaturedImage string // attachment UUID
|
||||
Status int `binding:"Range(0,2)"` // 0=draft, 1=public, 2=published
|
||||
AllowComments bool
|
||||
SubscriptionOnly bool
|
||||
}
|
||||
|
||||
// Validate validates the fields
|
||||
|
||||
Reference in New Issue
Block a user