from django.contrib import admin
from simple_history.admin import SimpleHistoryAdmin
from .models import Park, ParkArea

@admin.register(Park)
class ParkAdmin(SimpleHistoryAdmin):
    list_display = ('name', 'location', 'owner', 'status', 'opening_date')
    list_filter = ('status', 'owner')
    search_fields = ('name', 'location', 'description')
    prepopulated_fields = {'slug': ('name',)}
    readonly_fields = ('id', 'created_at', 'updated_at')

@admin.register(ParkArea)
class ParkAreaAdmin(SimpleHistoryAdmin):
    list_display = ('name', 'park', 'opening_date')
    list_filter = ('park',)
    search_fields = ('name', 'description')
    prepopulated_fields = {'slug': ('name',)}
    readonly_fields = ('id', 'created_at', 'updated_at')
