Hiding save_on_top on the Page add form template, and adding template documentation...
[philo.git] / admin.py
index 74e3d07..e9a59ad 100644 (file)
--- a/admin.py
+++ b/admin.py
@@ -102,6 +102,7 @@ class FileAdmin(NodeAdmin):
 
 
 class PageAdmin(NodeAdmin):
 
 
 class PageAdmin(NodeAdmin):
+       add_form_template = 'admin/philo/page/add_form.html'
        prepopulated_fields = {'slug': ('title',)}
        fieldsets = (
                (None, {
        prepopulated_fields = {'slug': ('title',)}
        fieldsets = (
                (None, {
@@ -119,8 +120,11 @@ class PageAdmin(NodeAdmin):
        def get_fieldsets(self, request, obj=None, **kwargs):
                fieldsets = list(self.fieldsets)
                if obj: # if no obj, creating a new page, thus no template set, thus no containers
        def get_fieldsets(self, request, obj=None, **kwargs):
                fieldsets = list(self.fieldsets)
                if obj: # if no obj, creating a new page, thus no template set, thus no containers
-                       page = obj
-                       template = page.template
+                       template = obj.template
+                       if template.documentation:
+                               fieldsets.append(('Template Documentation', {
+                                       'description': template.documentation
+                               }))
                        contentlet_containers, contentreference_containers = template.containers
                        for container_name in contentlet_containers:
                                fieldsets.append((('Container: %s' % container_name), {
                        contentlet_containers, contentreference_containers = template.containers
                        for container_name in contentlet_containers:
                                fieldsets.append((('Container: %s' % container_name), {