from django.contrib import admin

from ..models import DokumentLink


@admin.register(DokumentLink)
class DokumentLinkAdmin(admin.ModelAdmin):
    list_display = ["titel", "kontext", "paperless_document_id"]
    list_filter = ["kontext"]
    search_fields = ["titel", "kontext"]
    ordering = ["titel"]
    readonly_fields = ["id"]

    fieldsets = (
        (
            "Dokument",
            {"fields": ("titel", "kontext", "paperless_document_id", "beschreibung")},
        ),
        ("System", {"fields": ("id",), "classes": ("collapse",)}),
    )
