from django.contrib import admin
from notes.models import Note
from utils.widgets import LGEntryForm, OLAdminBase


@admin.register(Note)
class NoteAdmin(OLAdminBase):
    form = LGEntryForm
    prepopulated_fields = {"slug": ('title',)}
    list_display = ('slug', 'pub_date')
    fieldsets = (
        ('Note', {
            'fields': (
                ('title', 'slug'),
                'body_markdown',
                'pub_date',
            ),
            'classes': (
                'show',
                'extrapretty',
                'wide'
            )
        }
        ),
    )

    class Media:
        js = ('image-loader.js', 'next-prev-links.js')