summaryrefslogtreecommitdiff
path: root/app/tutorials/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/tutorials/admin.py')
-rw-r--r--app/tutorials/admin.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/app/tutorials/admin.py b/app/tutorials/admin.py
new file mode 100644
index 0000000..e3ae640
--- /dev/null
+++ b/app/tutorials/admin.py
@@ -0,0 +1,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')