Re-tweaked page add form to preserve 'continue on normal save' functionality. This...
authormelinath <stephen.r.burrows@gmail.com>
Thu, 19 Aug 2010 16:02:10 +0000 (12:02 -0400)
committermelinath <stephen.r.burrows@gmail.com>
Thu, 19 Aug 2010 16:02:10 +0000 (12:02 -0400)
templates/admin/philo/page/add_form.html

index 5b101c4..67f6ec4 100644 (file)
@@ -1,8 +1,25 @@
 {% extends "admin/change_form.html" %}
 {% load i18n %}
 
+{% block extrahead %}{{ block.super }}
+<!-- This will break if anything ever changes and may not work in all browsers. Sad face. -->
+<script type='text/javascript'>
+(function($){
+       $(function(){
+               $('#page_form input[type=submit]').click(function(e){
+                       if (e.target.name == '_addanother') {
+                               hidden = document.getElementById('page_form')._continue[0]
+                               hidden.parentNode.removeChild(hidden)
+                       }
+               })
+       })
+}(django.jQuery));
+</script>
+{% endblock %}
+
 {% block form_top %}
        <p>{% trans "First, choose a template. After saving, you'll be able to provide additional content for containers." %}</p>
+       <input type="hidden" name="_continue" value="1" />
 {% endblock %}
 
 {% block content %}