from django.contrib import admin
from .models import Skill, Event, TaskArea, Shift, ShiftSignup, EventTemplate

@admin.register(Skill)
class SkillAdmin(admin.ModelAdmin):
    list_display = ['name', 'color', 'created_at']
    search_fields = ['name']

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

@admin.register(TaskArea)
class TaskAreaAdmin(admin.ModelAdmin):
    list_display = ['name', 'event', 'order']
    list_filter = ['event']

@admin.register(Shift)
class ShiftAdmin(admin.ModelAdmin):
    list_display = ['title', 'task_area', 'start_time', 'end_time', 'max_participants']
    list_filter = ['task_area__event', 'task_area']

@admin.register(ShiftSignup)
class ShiftSignupAdmin(admin.ModelAdmin):
    list_display = ['shift', 'user', 'guest_name', 'created_at']
    list_filter = ['shift__task_area__event', 'created_at']

@admin.register(EventTemplate)
class EventTemplateAdmin(admin.ModelAdmin):
    list_display = ['name', 'created_by', 'created_at']
