Fix admin

This commit is contained in:
Iacopo Spalletti 2016-06-23 09:57:08 +02:00
parent 413c9bb3aa
commit 52146269f6
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6
3 changed files with 10 additions and 11 deletions

View file

@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
__author__ = 'Iacopo Spalletti'
__email__ = 'i.spalletti@nephila.it'
__version__ = '0.9.pre4'

View file

@ -57,24 +57,20 @@ class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
enhance_exclude = ('main_image', 'tags')
_fieldsets = [
(None, {
'fields': [('title', 'categories', 'publish', 'app_config')]
'fields': [['title', 'categories', 'publish', 'app_config']]
}),
('Info', {
'fields': (['slug', 'tags'],
('date_published', 'date_published_end',),
(
'enable_comments',
'enable_liveblog' if apps.is_installed('djangocms_blog.liveblog')
else None
)),
'fields': [['slug', 'tags'],
['date_published', 'date_published_end'],
['enable_comments']],
'classes': ('collapse',)
}),
('Images', {
'fields': (('main_image', 'main_image_thumbnail', 'main_image_full'),),
'fields': [['main_image', 'main_image_thumbnail', 'main_image_full']],
'classes': ('collapse',)
}),
('SEO', {
'fields': [('meta_description', 'meta_title', 'meta_keywords')],
'fields': [['meta_description', 'meta_title', 'meta_keywords']],
'classes': ('collapse',)
}),
]
@ -198,6 +194,8 @@ class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
fsets[1][1]['fields'][0].append('sites')
if request.user.is_superuser:
fsets[1][1]['fields'][0].append('author')
if apps.is_installed('djangocms_blog.liveblog'):
fsets[1][1]['fields'][2].append('enable_liveblog')
filter_function = get_setting('ADMIN_POST_FIELDSET_FILTER')
if callable(filter_function):
fsets = filter_function(fsets, request, obj=obj)

View file

@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals