From e9952e20295fdd1703c43ac55e18727b03f3c4ac Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Wed, 16 Jun 2010 08:48:29 -0400 Subject: [PATCH] Hiding save_on_top on the Page add form template, and adding template documentation to Page change forms when the page's selected template provides it. --- admin.py | 7 +++++-- templates/admin/philo/page/add_form.html | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/admin.py b/admin.py index 37939e8..e9a59ad 100644 --- a/admin.py +++ b/admin.py @@ -120,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 - 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), { diff --git a/templates/admin/philo/page/add_form.html b/templates/admin/philo/page/add_form.html index a200165..8937463 100644 --- a/templates/admin/philo/page/add_form.html +++ b/templates/admin/philo/page/add_form.html @@ -5,3 +5,9 @@

{% trans "First, choose a template. After saving, you'll be able to provide additional content for containers." %}

{% endblock %} + +{% block content %} +{% with 0 as save_on_top %} +{{ block.super }} +{% endwith %} +{% endblock %} \ No newline at end of file -- 2.20.1