summaryrefslogtreecommitdiff
path: root/app/essays/admin.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2019-02-07 09:54:16 -0600
committerluxagraf <sng@luxagraf.net>2019-02-07 09:54:16 -0600
commit27aaf92d26eb75157dcfa923a5d63ea63feeb98c (patch)
tree8f6213bc0ecd7738ad050dc4454732c4fd210ab1 /app/essays/admin.py
parent3a54cdb85027e4a59ca6d78f5b91dbf7be77afd0 (diff)
updated stylesheets and added essays
Diffstat (limited to 'app/essays/admin.py')
-rw-r--r--app/essays/admin.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/app/essays/admin.py b/app/essays/admin.py
new file mode 100644
index 0000000..f326092
--- /dev/null
+++ b/app/essays/admin.py
@@ -0,0 +1,49 @@
+from django.contrib import admin
+from .models import Essay, PostType
+from utils.widgets import LGEntryForm
+
+
+@admin.register(PostType)
+class PostTypeAdmin(admin.ModelAdmin):
+ prepopulated_fields = {"slug": ('name',)}
+
+
+@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', 'post_type'),
+ ),
+ 'classes': (
+ 'show',
+ 'extrapretty',
+ 'wide'
+ )
+ }),
+ ('meta', {
+ 'fields': (
+ 'originally_published_by',
+ 'originally_published_by_url',
+ 'afterword',
+ ('field_notes', 'books'),
+ ),
+ 'classes': (
+ 'hide',
+ 'extrapretty',
+ 'wide'
+ )
+ }),
+ )
+
+ class Media:
+ js = ('image-loader.js', 'next-prev-links.js')