mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-05 05:54:44 +00:00
Move content_panels inside FormPage definition.
This commit is contained in:
parent
010838b53e
commit
ce57281f6a
1 changed files with 10 additions and 11 deletions
|
|
@ -37,17 +37,16 @@ Within the ``models.py`` of one of your apps, create a model that extends ``wagt
|
|||
intro = RichTextField(blank=True)
|
||||
thank_you_text = RichTextField(blank=True)
|
||||
|
||||
FormPage.content_panels = [
|
||||
FieldPanel('title', classname="full title"),
|
||||
FieldPanel('intro', classname="full"),
|
||||
InlinePanel('form_fields', label="Form fields"),
|
||||
FieldPanel('thank_you_text', classname="full"),
|
||||
MultiFieldPanel([
|
||||
FieldPanel('to_address', classname="full"),
|
||||
FieldPanel('from_address', classname="full"),
|
||||
FieldPanel('subject', classname="full"),
|
||||
], "Email")
|
||||
]
|
||||
content_panels = AbstractEmailForm.content_panels + [
|
||||
FieldPanel('intro', classname="full"),
|
||||
InlinePanel('form_fields', label="Form fields"),
|
||||
FieldPanel('thank_you_text', classname="full"),
|
||||
MultiFieldPanel([
|
||||
FieldPanel('to_address', classname="full"),
|
||||
FieldPanel('from_address', classname="full"),
|
||||
FieldPanel('subject', classname="full"),
|
||||
], "Email")
|
||||
]
|
||||
|
||||
``AbstractEmailForm`` defines the fields ``to_address``, ``from_address`` and ``subject``, and expects ``form_fields`` to be defined. Any additional fields are treated as ordinary page content - note that ``FormPage`` is responsible for serving both the form page itself and the landing page after submission, so the model definition should include all necessary content fields for both of those views.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue