from django.contrib import admin

from .models import Category, MomentumEntry


@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    list_display = ("name", "slug", "accent_color")
    prepopulated_fields = {"slug": ("name",)}
    search_fields = ("name", "description")


@admin.register(MomentumEntry)
class MomentumEntryAdmin(admin.ModelAdmin):
    list_display = (
        "title",
        "entry_date",
        "category",
        "focus_score",
        "energy_score",
        "deep_work_minutes",
    )
    list_filter = ("category", "entry_date")
    search_fields = ("title", "takeaway", "reflection")
    date_hierarchy = "entry_date"
