feat: changes for citation ad dynamic

This commit is contained in:
mohamad
2026-05-17 18:51:26 +03:30
parent f0a9d5832b
commit b8ab67049f
22 changed files with 1170 additions and 287 deletions
+49 -1
View File
@@ -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)