from django.contrib import admin

from .models import Berita, Post, PegawaiAktif, Video

from .models import Organisasi, Tusi, Dokumen, Stakeholder, Produk, Video, Berita, Category
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)


class AdminVideo(admin.ModelAdmin):
    list_display = ("title", "link", "grup", "tag")
    search_fields = ["title", "grup", "tag"]


admin.site.register(Video)


class PostBerita(admin.ModelAdmin):
    list_display = ("title", "author", "date_added", "featured","status")
    search_fields = ["title", "isi"]


class CategoryBerita(admin.ModelAdmin):
    list_display = ("name", "description")
    search_fields = ["name", "description"]

admin.site.register(Berita, PostBerita)
admin.site.register(Category, CategoryBerita)
