Skip to content
Snippets Groups Projects
Commit a0842c0e authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Move the content panels onto the Mixin class and reference correctly.

parent 66645f23
No related branches found
No related tags found
No related merge requests found
...@@ -149,8 +149,7 @@ class PersonPage(FundingMixin, BasePage): ...@@ -149,8 +149,7 @@ class PersonPage(FundingMixin, BasePage):
InlinePanel('person_types', label='Person types'), InlinePanel('person_types', label='Person types'),
FieldPanel('introduction'), FieldPanel('introduction'),
StreamFieldPanel('biography'), StreamFieldPanel('biography'),
InlinePanel('funding', label='Funding'), ] + FundingMixin.content_panels
]
class PersonIndexPage(BasePage): class PersonIndexPage(BasePage):
......
...@@ -116,8 +116,7 @@ class ProjectPage(FundingMixin, BasePage): ...@@ -116,8 +116,7 @@ class ProjectPage(FundingMixin, BasePage):
StreamFieldPanel('body'), StreamFieldPanel('body'),
InlinePanel('contact_details', label="Contact Details"), InlinePanel('contact_details', label="Contact Details"),
InlinePanel('related_pages', label="Related Projects"), InlinePanel('related_pages', label="Related Projects"),
InlinePanel('funding', label="Funding"), ] + FundingMixin.content_panels
]
class ProjectIndexPage(BasePage): class ProjectIndexPage(BasePage):
......
...@@ -4,6 +4,7 @@ from django.db import models ...@@ -4,6 +4,7 @@ from django.db import models
from wagtail.wagtailadmin.edit_handlers import ( from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, FieldPanel,
FieldRowPanel, FieldRowPanel,
InlinePanel,
MultiFieldPanel, MultiFieldPanel,
PageChooserPanel, PageChooserPanel,
StreamFieldPanel, StreamFieldPanel,
...@@ -287,8 +288,9 @@ class BaseFunding(Orderable): ...@@ -287,8 +288,9 @@ class BaseFunding(Orderable):
class FundingMixin(models.Model): class FundingMixin(models.Model):
'''Implements the funding total calculation '''Implements the funding total calculation
You still need to include the InlinePanel('funding') in the child class You still need to include the content panel in the child class
''' '''
content_panels = [InlinePanel('funding', label="Funding")]
class Meta: class Meta:
abstract = True abstract = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment