diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6c28594a9..ddd41d76e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changelog * Snippets are now ordered alphabetically * Removed the "More" section from the admin menu * Added pagination to page listings in admin + * Support for setting a subpage_types property on page models, to define which page types are allowed as subpages * Fix: Animated GIFs are now coalesced before resizing * Fix: Wand backend clones images before modifying them * Fix: Admin breadcrumb now positioned correctly on mobile diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index d7222307d..a3f9c7221 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -28,6 +28,7 @@ Contributors * Ben Margolis * Tom Talbot * Jeffrey Hearn +* Robert Clark Translators =========== diff --git a/wagtail/tests/models.py b/wagtail/tests/models.py index e061a4bfe..f798129dc 100644 --- a/wagtail/tests/models.py +++ b/wagtail/tests/models.py @@ -294,3 +294,16 @@ class ZuluSnippet(models.Model): def __unicode__(self): return self.text + + +class StandardIndex(Page): + pass + +class StandardChild(Page): + pass + +class BusinessIndex(Page): + subpage_types = ['tests.BusinessChild'] + +class BusinessChild(Page): + subpage_types = [] diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/pages/add_subpage.html b/wagtail/wagtailadmin/templates/wagtailadmin/pages/add_subpage.html index 757c013b5..1158cc857 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/pages/add_subpage.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/pages/add_subpage.html @@ -12,9 +12,9 @@

{% trans "Choose which type of page you'd like to create." %}

- {% if all_page_types %} + {% if page_types %}