from django.contrib import admin

from events import models


@admin.register(models.Category)
class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'description', 'event')
    list_filter = ('event',)

@admin.register(models.Event)
class EventAdmin(admin.ModelAdmin):
    list_display = ('start', 'name', 'is_actual', 'is_public', 'registrations_enabled')


@admin.register(models.Registration)
class RegistrationAdmin(admin.ModelAdmin):
    list_display = ('created', 'variable_symbol', 'event', 'email', 'first_name', 'last_name', 'is_confirmed' ,'is_paid', 'is_finished')
    list_filter = ('event', 'is_confirmed', 'is_paid', 'is_finished', 'email')
    search_fields = ('email', 'first_name', 'last_name', 'variable_symbol')


@admin.register(models.HTMLSection)
class HTMLSectionAdmin(admin.ModelAdmin):
    list_display = ('created', 'event', 'identifier', 'order_index')


@admin.register(models.Lap)
class LapAdmin(admin.ModelAdmin):
    list_display = ('number', 'registration', 'start', 'end', 'duration')
    list_filter = ('registration',)