from django.contrib import admin

from .models import Event, Registration


@admin.register(Event)
class EventAdmin(admin.ModelAdmin):
    list_display = ('title', 'start_at', 'venue', 'capacity', 'is_published')
    list_filter = ('is_published', 'start_at')
    prepopulated_fields = {'slug': ('title',)}
    search_fields = ('title', 'summary', 'venue')


@admin.register(Registration)
class RegistrationAdmin(admin.ModelAdmin):
    list_display = ('full_name', 'email', 'event', 'status', 'created_at')
    list_filter = ('status', 'event')
    search_fields = ('full_name', 'email', 'company')
