from django.contrib import admin

from .models import (
    Character,
    Choice,
    InventoryItem,
    Item,
    Quest,
    Scene,
    StoryEntry,
)


@admin.register(Scene)
class SceneAdmin(admin.ModelAdmin):
    list_display = ("title", "slug")
    search_fields = ("title", "slug")


@admin.register(Choice)
class ChoiceAdmin(admin.ModelAdmin):
    list_display = ("scene", "text", "required_skill", "difficulty")
    list_filter = ("required_skill",)
    search_fields = ("text",)


@admin.register(Character)
class CharacterAdmin(admin.ModelAdmin):
    list_display = ("name", "background", "level")
    list_filter = ("background",)
    search_fields = ("name",)


@admin.register(Quest)
class QuestAdmin(admin.ModelAdmin):
    list_display = ("title", "character", "status")
    list_filter = ("status",)


@admin.register(Item)
class ItemAdmin(admin.ModelAdmin):
    list_display = ("name", "slot", "power")
    list_filter = ("slot",)


@admin.register(InventoryItem)
class InventoryItemAdmin(admin.ModelAdmin):
    list_display = ("character", "item", "equipped")
    list_filter = ("equipped",)


@admin.register(StoryEntry)
class StoryEntryAdmin(admin.ModelAdmin):
    list_display = ("character", "scene", "outcome", "created_at")
    list_filter = ("outcome",)
