2008-07-19 07:54:34 +08:00
|
|
|
from django.contrib import admin
|
|
|
|
from django.contrib.flatpages.models import FlatPage
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2011-10-07 23:45:52 +08:00
|
|
|
from django.contrib.flatpages.forms import FlatpageForm
|
2008-08-11 12:28:33 +08:00
|
|
|
|
2008-07-19 07:54:34 +08:00
|
|
|
class FlatPageAdmin(admin.ModelAdmin):
|
2008-08-11 12:28:33 +08:00
|
|
|
form = FlatpageForm
|
2008-07-19 07:54:34 +08:00
|
|
|
fieldsets = (
|
|
|
|
(None, {'fields': ('url', 'title', 'content', 'sites')}),
|
|
|
|
(_('Advanced options'), {'classes': ('collapse',), 'fields': ('enable_comments', 'registration_required', 'template_name')}),
|
|
|
|
)
|
|
|
|
list_display = ('url', 'title')
|
|
|
|
list_filter = ('sites', 'enable_comments', 'registration_required')
|
|
|
|
search_fields = ('url', 'title')
|
|
|
|
|
2008-08-11 12:28:33 +08:00
|
|
|
admin.site.register(FlatPage, FlatPageAdmin)
|