from django.contrib import admin

from .models import Post, PegawaiAktif

from .models import Organisasi, Tusi, Dokumen, Stakeholder, Produk
from django.conf import settings

class PostAdmin(admin.ModelAdmin):
    list_display = ('title', 'body')
    prepopulated_fields = {'slug': ('title',)}

class PostPegawai(admin.ModelAdmin):
    list_display = ('nama', 'nip')

# Register your models here.
admin.site.register(Post, PostAdmin)
admin.site.register(PegawaiAktif, PostPegawai)


class AdminTusi(admin.ModelAdmin):
    list_display = ("esl4", "tugas", "urjab")
    search_fields = ["esl4", "tugas", "urjab"]


class AdminDokumen(admin.ModelAdmin):
    list_display = ("jns_dok", "output", "tgl_mulai")
    search_fields = ["jns_dok", "output"]


class AdminStakeholder(admin.ModelAdmin):
    list_display = ("stakeholders", "ttg_dok", "output")
    search_fields = ["stakeholders", "ttg_dok"]


admin.site.register(Tusi, AdminTusi)
admin.site.register(Dokumen, AdminDokumen)
admin.site.register(Stakeholder, AdminStakeholder)


class AdminProduk(admin.ModelAdmin):
    list_display = ("judul", "deskripsi", "link", "slug")
    search_fields = ["judul", "deskripsi"]
    prepopulated_fields = {'slug': ('judul',)}


admin.site.register(Produk, AdminProduk)
