summaryrefslogtreecommitdiff
path: root/app/unused_apps/figments/admin.py
blob: 34452bd8cbd602b12858175630c39563b7cded0f (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
from django.contrib import admin
from .models import Figment, Series
from utils.widgets import LGEntryForm


class FigmentAdmin(admin.ModelAdmin):
    form = LGEntryForm
    list_display = ('title', 'pub_date', 'get_series')
    prepopulated_fields = {"slug": ('title',)}
    fieldsets = (
        ('Figment', {
            'fields': (
                'title',
                'body_markdown',
                ('slug', 'status'),
                'pub_date',
            ),
            'classes': (
                'show',
                'extrapretty',
                'wide'
            )
        }
        ),
        ('Extra', {
            'fields': (
                'dek',
                'prologue',
                'series',
                'published_link',
            ),
            'classes': (
                'collapse',
                'extrapretty',
                'wide'
            )
        }
        ),
    )


class SeriesAdmin(admin.ModelAdmin):
    pass

admin.site.register(Figment, FigmentAdmin)
admin.site.register(Series, SeriesAdmin)