summaryrefslogtreecommitdiff
path: root/app/tutorials/admin.py
blob: e3ae640d779bde2b563a0e3b1b62435de3535b97 (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
from django.contrib import admin
from .models import Tutorial
from utils.widgets import LGEntryForm


@admin.register(Tutorial)
class TutorialAdmin(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'),
                'tags',
                'meta_description',
                ('slug', 'enable_comments', 'has_code'),
            ),
            'classes': (
                'show',
                'extrapretty',
                'wide'
            )
        }
        ),
    )

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