summaryrefslogtreecommitdiff
path: root/app/posts/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/posts/admin.py')
-rw-r--r--app/posts/admin.py42
1 files changed, 38 insertions, 4 deletions
diff --git a/app/posts/admin.py b/app/posts/admin.py
index 5a51f44..1153e81 100644
--- a/app/posts/admin.py
+++ b/app/posts/admin.py
@@ -4,7 +4,7 @@ from django.contrib.gis.admin import OSMGeoAdmin
from django.contrib.contenttypes.admin import GenericStackedInline
from utils.widgets import AdminImageWidget, LGEntryForm
-from .models import Post, Trip
+from .models import Post, Trip, Guide
from media.models import LuxImage
from utils.util import get_latlon
@@ -34,7 +34,7 @@ class PostAdmin(OSMGeoAdmin):
field = super(PostAdmin, self).formfield_for_dbfield(db_field, **kwargs)
return field
- list_display = ('title', 'site', 'post_type', 'pub_date', 'template_name', 'status',)
+ list_display = ('title', 'site', 'post_type', 'pub_date', 'status',)
search_fields = ['title', 'body_markdown']
prepopulated_fields = {"slug": ('title',)}
list_filter = ('site', 'post_type', 'pub_date', 'enable_comments', 'status')
@@ -45,12 +45,11 @@ class PostAdmin(OSMGeoAdmin):
('title', 'short_title'),
('subtitle', 'trip'),
'body_markdown',
- ('pub_date', 'status', 'post_type'),
+ ('pub_date', 'status', 'post_type', 'post_topic'),
('slug', 'enable_comments',),
'point',
'dek',
'meta_description',
- 'template_name',
('featured_image','related'),
'site'
),
@@ -126,3 +125,38 @@ class TripAdmin(OSMGeoAdmin):
css = {
"all": ("my_styles.css",)
}
+
+
+@admin.register(Guide)
+class GuideAdmin(OSMGeoAdmin):
+ form = LGEntryForm
+ list_display = ('title', 'is_featured', 'slug' )
+ prepopulated_fields = {'slug': ('title',)}
+ search_fields = ('title',)
+ filter_horizontal = ('posts',)
+ fieldsets = (
+ ('', {
+ 'fields': (
+ 'title',
+ 'subtitle',
+ 'seo_title',
+ 'body_markdown',
+ 'posts',
+ ('slug', 'status'),
+ 'dek',
+ 'meta_description',
+ 'featured_image',
+ ('is_featured', 'related')
+ ),
+ 'classes': (
+ 'show',
+ 'extrapretty'
+ )
+ }),
+ )
+
+ class Media:
+ js = ('image-loader.js', 'next-prev-links.js')
+ css = {
+ "all": ("my_styles.css",)
+ }