summaryrefslogtreecommitdiff
path: root/app/unused_apps/essays/admin.py
blob: ed39ca3d90d210300b646b3d4b4a0c959272ab03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from django.contrib import admin

from utils.widgets import LGEntryForm

from .models import Essay


@admin.register(Essay)
class EssayAdmin(admin.ModelAdmin):
    form = LGEntryForm
    list_display = ('title', 'pub_date', 'enable_comments', 'status')
    list_filter = ('pub_date', 'enable_comments', 'status')
    prepopulated_fields = {"slug": ('title',)}
    fieldsets = (
        ('Entry', {
            'fields': (
                'title',
                'sub_title',
                'body_markdown',
                ('pub_date', 'status'),
                'meta_description',
                ('slug', 'enable_comments', 'has_code'),
            ),
            'classes': (
                'show',
                'extrapretty',
                'wide'
            )
        }),
        ('meta', {
            'fields': (
                'originally_published_by',
                'originally_published_by_url',
                'afterword',
                'preamble',
                ('field_notes', 'books'),
            ),
            'classes': (
                'hide',
                'extrapretty',
                'wide'
            )
        }),
    )

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