feat: changes for citation ad dynamic
This commit is contained in:
+49
-1
@@ -1,6 +1,54 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import ContactSubmission, DownloadItem, FAQEntry
|
||||
from .models import (
|
||||
AboutSection,
|
||||
AboutSectionItem,
|
||||
ContactSubmission,
|
||||
DownloadItem,
|
||||
FAQEntry,
|
||||
HomepageSection,
|
||||
HomepageSectionItem,
|
||||
)
|
||||
|
||||
|
||||
class HomepageSectionItemInline(admin.TabularInline):
|
||||
model = HomepageSectionItem
|
||||
extra = 1
|
||||
fields = ("icon", "title", "content", "image", "order")
|
||||
ordering = ("order",)
|
||||
|
||||
|
||||
@admin.register(HomepageSection)
|
||||
class HomepageSectionAdmin(admin.ModelAdmin):
|
||||
list_display = ("section_type", "badge", "title", "order", "is_active")
|
||||
list_filter = ("section_type", "is_active")
|
||||
list_editable = ("order", "is_active")
|
||||
inlines = [HomepageSectionItemInline]
|
||||
fieldsets = (
|
||||
(None, {"fields": ("section_type", "badge", "title", "description")}),
|
||||
("CTA Link (About Strip)", {"fields": ("link_text", "link_url"), "classes": ("collapse",)}),
|
||||
("Settings", {"fields": ("order", "is_active")}),
|
||||
)
|
||||
|
||||
|
||||
class AboutSectionItemInline(admin.StackedInline):
|
||||
model = AboutSectionItem
|
||||
extra = 1
|
||||
fields = ("badge", "title", "content", "url", "image", "image_alt", "is_featured", "order")
|
||||
ordering = ("order",)
|
||||
|
||||
|
||||
@admin.register(AboutSection)
|
||||
class AboutSectionAdmin(admin.ModelAdmin):
|
||||
list_display = ("section_type", "badge", "title", "order", "is_active")
|
||||
list_filter = ("section_type", "is_active")
|
||||
list_editable = ("order", "is_active")
|
||||
inlines = [AboutSectionItemInline]
|
||||
fieldsets = (
|
||||
(None, {"fields": ("section_type", "badge", "title", "subtitle")}),
|
||||
("Content", {"fields": ("content_format", "content")}),
|
||||
("Settings", {"fields": ("order", "is_active")}),
|
||||
)
|
||||
|
||||
|
||||
@admin.register(ContactSubmission)
|
||||
|
||||
Reference in New Issue
Block a user