From: Stephen Burrows Date: Wed, 27 Apr 2011 16:33:58 +0000 (-0400) Subject: Updated page admin/add form to use the same method for redirection as the 1.3 user... X-Git-Tag: philo-0.9~12^2~35^2~1 X-Git-Url: http://git.ithinksw.org/philo.git/commitdiff_plain/b8334054d908e8c49bdbd8ac28ab2c9e7b37a937 Updated page admin/add form to use the same method for redirection as the 1.3 user admin. --- diff --git a/admin/pages.py b/admin/pages.py index 13d4098..f9e96c0 100644 --- a/admin/pages.py +++ b/admin/pages.py @@ -46,6 +46,12 @@ class PageAdmin(ViewAdmin): list_filter = ('template',) search_fields = ['title', 'contentlets__content'] inlines = [ContentletInline, ContentReferenceInline] + ViewAdmin.inlines + + def response_add(self, request, obj, post_url_continue='../%s/'): + # Shamelessly cribbed from django/contrib/auth/admin.py:143 + if '_addanother' not in request.POST and '_popup' not in request.POST: + request.POST['_continue'] = 1 + return super(PageAdmin, self).response_add(request, obj, post_url_continue) class TemplateAdmin(TreeAdmin): diff --git a/templates/admin/philo/page/add_form.html b/templates/admin/philo/page/add_form.html index 67f6ec4..b2a6358 100644 --- a/templates/admin/philo/page/add_form.html +++ b/templates/admin/philo/page/add_form.html @@ -1,29 +1,14 @@ {% extends "admin/change_form.html" %} {% load i18n %} -{% block extrahead %}{{ block.super }} - - -{% endblock %} - {% block form_top %} -

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

- + {% if not is_popup %} +

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

+ {% else %} +

{% trans "Choose a template" %}

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