from django.contrib import admin
from .models import HomeBanner


@admin.register(HomeBanner)
class HomeBannerAdmin(admin.ModelAdmin):
    list_display = ['heading', 'highlight', 'badge', 'display_order', 'is_active', 'created_at']
    list_filter = ['is_active', 'created_at']
    search_fields = ['heading', 'highlight', 'badge', 'description']
    ordering = ['display_order', 'created_at']
    readonly_fields = ['created_at', 'updated_at']
    
    fieldsets = (
        ('Content', {
            'fields': ('icon', 'badge', 'heading', 'highlight', 'subheading', 'description')
        }),
        ('Call to Action', {
            'fields': ('button_text', 'button_url')
        }),
        ('Settings', {
            'fields': ('display_order', 'is_active')
        }),
        ('Timestamps', {
            'fields': ('created_at', 'updated_at'),
            'classes': ('collapse',)
        }),
    )

