feat: add people sections and opt-in read more
This commit is contained in:
+24
-11
@@ -10,6 +10,7 @@ from .models import (
|
||||
AboutSection,
|
||||
AboutSectionItem,
|
||||
BlogPost,
|
||||
BlogPostPartner,
|
||||
ContactSubmission,
|
||||
ContactSubmissionAttachment,
|
||||
CustomPage,
|
||||
@@ -27,7 +28,7 @@ class HeroSectionAdmin(admin.ModelAdmin):
|
||||
fieldsets = (
|
||||
("Badge", {"fields": ("badge",)}),
|
||||
("Title", {"fields": ("title", "title_highlight")}),
|
||||
("Text", {"fields": ("subtitle", "description")}),
|
||||
("Text", {"fields": ("subtitle", "read_more_subtitle", "description", "read_more_description")}),
|
||||
("Primary Button", {"fields": ("primary_cta_text", "primary_cta_url")}),
|
||||
("Secondary Button", {"fields": ("secondary_cta_text", "secondary_cta_url")}),
|
||||
("Image", {"fields": ("image", "image_alt")}),
|
||||
@@ -51,7 +52,7 @@ class HeroSectionAdmin(admin.ModelAdmin):
|
||||
class HomepageSectionItemInline(admin.TabularInline):
|
||||
model = HomepageSectionItem
|
||||
extra = 1
|
||||
fields = ("icon", "title", "content", "url", "image", "order")
|
||||
fields = ("icon", "title", "content", "read_more_content", "url", "image", "order")
|
||||
ordering = ("order",)
|
||||
|
||||
|
||||
@@ -63,7 +64,7 @@ class HomepageSectionAdmin(admin.ModelAdmin):
|
||||
inlines = [HomepageSectionItemInline]
|
||||
readonly_fields = ("video_preview",)
|
||||
fieldsets = (
|
||||
(None, {"fields": ("section_type", "badge", "title", "description_format", "description")}),
|
||||
(None, {"fields": ("section_type", "badge", "title", "description_format", "description", "read_more_description")}),
|
||||
("CTA Link (About Strip)", {"fields": ("link_text", "link_url"), "classes": ("collapse",)}),
|
||||
VIDEO_ADMIN_FIELDSET,
|
||||
("Settings", {"fields": ("order", "is_active")}),
|
||||
@@ -76,7 +77,7 @@ class HomepageSectionAdmin(admin.ModelAdmin):
|
||||
class AboutSectionItemInline(admin.TabularInline):
|
||||
model = AboutSectionItem
|
||||
extra = 1
|
||||
fields = ("icon", "title", "content", "url", "image", "image_alt", "badge", "is_featured", "order")
|
||||
fields = ("icon", "title", "role", "content", "read_more_content", "url", "image", "image_alt", "badge", "is_featured", "order")
|
||||
ordering = ("order",)
|
||||
|
||||
|
||||
@@ -88,8 +89,8 @@ class AboutSectionAdmin(admin.ModelAdmin):
|
||||
inlines = [AboutSectionItemInline]
|
||||
readonly_fields = ("video_preview",)
|
||||
fieldsets = (
|
||||
(None, {"fields": ("section_type", "badge", "title", "subtitle")}),
|
||||
("Content", {"fields": ("content_format", "content")}),
|
||||
(None, {"fields": ("section_type", "badge", "title", "subtitle", "read_more_subtitle")}),
|
||||
("Content", {"fields": ("content_format", "content", "read_more_content")}),
|
||||
VIDEO_ADMIN_FIELDSET,
|
||||
("Settings", {"fields": ("order", "is_active")}),
|
||||
)
|
||||
@@ -161,6 +162,7 @@ class CustomPageSectionItemInline(admin.TabularInline):
|
||||
"title",
|
||||
"content_format",
|
||||
"content",
|
||||
"read_more_content",
|
||||
"url",
|
||||
"image",
|
||||
"image_alt",
|
||||
@@ -178,10 +180,13 @@ class CustomPageSectionInline(admin.StackedInline):
|
||||
"badge",
|
||||
"title",
|
||||
"subtitle",
|
||||
"read_more_subtitle",
|
||||
"description_format",
|
||||
"description",
|
||||
"read_more_description",
|
||||
"content_format",
|
||||
"content",
|
||||
"read_more_content",
|
||||
"link_text",
|
||||
"link_url",
|
||||
"order",
|
||||
@@ -204,6 +209,7 @@ class CustomPageSectionItemOnPageInline(admin.TabularInline):
|
||||
"title",
|
||||
"content_format",
|
||||
"content",
|
||||
"read_more_content",
|
||||
"url",
|
||||
"image",
|
||||
"order",
|
||||
@@ -225,8 +231,8 @@ class CustomPageSectionAdmin(admin.ModelAdmin):
|
||||
inlines = [CustomPageSectionItemInline]
|
||||
readonly_fields = ("video_preview",)
|
||||
fieldsets = (
|
||||
(None, {"fields": ("page", "section_type", "badge", "title", "subtitle")}),
|
||||
("Text", {"fields": ("description_format", "description", "content_format", "content")}),
|
||||
(None, {"fields": ("page", "section_type", "badge", "title", "subtitle", "read_more_subtitle")}),
|
||||
("Text", {"fields": ("description_format", "description", "read_more_description", "content_format", "content", "read_more_content")}),
|
||||
("CTA Link", {"fields": ("link_text", "link_url"), "classes": ("collapse",)}),
|
||||
VIDEO_ADMIN_FIELDSET,
|
||||
("Settings", {"fields": ("order", "is_active")}),
|
||||
@@ -275,6 +281,12 @@ class CustomPageAdmin(admin.ModelAdmin):
|
||||
admin.site.register(CustomPageSection, CustomPageSectionAdmin)
|
||||
|
||||
|
||||
class BlogPostPartnerInline(admin.TabularInline):
|
||||
model = BlogPostPartner
|
||||
extra = 1
|
||||
fields = ("role", "name", "description", "read_more_description", "image", "image_alt", "url", "order")
|
||||
|
||||
|
||||
@admin.register(BlogPost)
|
||||
class BlogPostAdmin(admin.ModelAdmin):
|
||||
list_display = ("title", "status", "published_at", "updated_at")
|
||||
@@ -282,9 +294,10 @@ class BlogPostAdmin(admin.ModelAdmin):
|
||||
search_fields = ("title", "excerpt", "content", "author_name")
|
||||
prepopulated_fields = {"slug": ("title",)}
|
||||
date_hierarchy = "published_at"
|
||||
inlines = [BlogPostPartnerInline]
|
||||
fieldsets = (
|
||||
(None, {"fields": ("title", "slug", "excerpt")}),
|
||||
("Article", {"fields": ("content_format", "content")}),
|
||||
(None, {"fields": ("title", "slug", "excerpt", "read_more_excerpt")}),
|
||||
("Article", {"fields": ("content_format", "content", "read_more_content")}),
|
||||
("Cover image", {"fields": ("cover_image", "cover_image_alt")}),
|
||||
("Publishing", {"fields": ("status", "published_at", "author_name")}),
|
||||
)
|
||||
@@ -298,7 +311,7 @@ class PageVideoAdmin(admin.ModelAdmin):
|
||||
search_fields = ("title", "description", "video_url")
|
||||
readonly_fields = ("video_preview",)
|
||||
fieldsets = (
|
||||
(None, {"fields": ("page", "badge", "title", "description_format", "description")}),
|
||||
(None, {"fields": ("page", "badge", "title", "description_format", "description", "read_more_description")}),
|
||||
VIDEO_ADMIN_FIELDSET,
|
||||
("Settings", {"fields": ("order", "is_active")}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user