#!/usr/bin/env Python
# coding=utf-8

from django.contrib import admin
from .models import Category, Post, Tag, Sidebar


admin.site.register(Category)
admin.site.register(Tag)
admin.site.register(Sidebar)


class PostAdmin(admin.ModelAdmin):
    list_display = ('id', 'title', 'category', 'tags', 'owner', 'is_hot', 'pv', 'pub_date', )
    list_filter = ('owner', )
    search_fields = ('title', 'desc', )
    list_editable = ('is_hot', )
    list_display_links = ('id', 'title', )

    class Media:
        css = {
            'all': ('CKEditor_5/ckeditor.css', )
        }

        js = (
            'CKEditor_5/jquery.js',
            'CKEditor_5/translations/zh.js',
            'CKEditor_5/ckeditor.js',
            'CKEditor_5/config.js'
        )


admin.site.register(Post, PostAdmin)
