from django.contrib import admin
from .models import HeroSection, ValueProposition, Statistic, CallToAction

@admin.register(HeroSection)
class HeroSectionAdmin(admin.ModelAdmin):
    def has_add_permission(self, request):
        return not HeroSection.objects.exists()

@admin.register(ValueProposition)
class ValuePropositionAdmin(admin.ModelAdmin):
    list_display = ('title', 'order', 'icon_class')
    list_editable = ('order',)

@admin.register(Statistic)
class StatisticAdmin(admin.ModelAdmin):
    list_display = ('number', 'label', 'order')
    list_editable = ('order',)

@admin.register(CallToAction)
class CallToActionAdmin(admin.ModelAdmin):
    def has_add_permission(self, request):
        return not CallToAction.objects.exists()