from django.contrib import admin
from .models import Announcement, Comment, Event, Resource

@admin.register(Announcement)
class AnnouncementAdmin(admin.ModelAdmin):
    list_display = ('title', 'type', 'created_at')
    list_filter = ('type', 'created_at')
    search_fields = ('title', 'content')

@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
    list_display = ('author_name', 'announcement', 'created_at')
    search_fields = ('author_name', 'content')

@admin.register(Event)
class EventAdmin(admin.ModelAdmin):
    list_display = ('title', 'start_date', 'location')
    list_filter = ('start_date',)
    search_fields = ('title', 'description', 'location')

@admin.register(Resource)
class ResourceAdmin(admin.ModelAdmin):
    list_display = ('title', 'url')
    search_fields = ('title', 'description')