from django.contrib import admin

from .models import (
    BaseAssetGroup,
    BgmTrack,
    ExportJob,
    Project,
    ProjectStage,
    ScriptSegment,
    ScriptVersion,
    StoryboardFrame,
    StoryboardVersion,
    SubtitleTrack,
    Timeline,
    TimelineClip,
    VideoSegment,
    VideoSegmentVersion,
)


class ProjectStageInline(admin.TabularInline):
    model = ProjectStage
    extra = 0


@admin.register(Project)
class ProjectAdmin(admin.ModelAdmin):
    list_display = ("name", "team", "product", "status", "current_stage", "updated_at")
    search_fields = ("name", "team__name", "product__title")
    list_filter = ("status", "current_stage")
    inlines = [ProjectStageInline]


admin.site.register(ScriptVersion)
admin.site.register(ScriptSegment)
admin.site.register(BaseAssetGroup)
admin.site.register(StoryboardVersion)
admin.site.register(StoryboardFrame)
admin.site.register(VideoSegment)
admin.site.register(VideoSegmentVersion)
admin.site.register(Timeline)
admin.site.register(TimelineClip)
admin.site.register(SubtitleTrack)
admin.site.register(BgmTrack)
admin.site.register(ExportJob)

