-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
47 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,37 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from wagtail.wagtailadmin.edit_handlers import StreamFieldPanel | ||
from wagtail.wagtailcore import blocks, fields | ||
from wagtail.wagtailcore.models import Page | ||
|
||
from wagtail_personalisation.blocks import (PersonalisedCharBlock, | ||
PersonalisedImageChooserBlock, PersonalisedRichTextBlock, | ||
PersonalisedStructBlock, PersonalisedTextBlock) | ||
from wagtail_personalisation.models import PersonalisablePageMixin | ||
|
||
|
||
class HomePage(Page, PersonalisablePageMixin): | ||
pass | ||
|
||
|
||
class PersonalisedFieldsPage(Page): | ||
body = fields.StreamField([ | ||
('personalised_block', PersonalisedStructBlock([ | ||
('heading', blocks.CharBlock()), | ||
('paragraph', blocks.RichTextBlock()) | ||
], render_fields=['heading', 'paragraph'])), | ||
('personalised_block_template', PersonalisedStructBlock([ | ||
('heading', blocks.CharBlock()), | ||
('paragraph', blocks.RichTextBlock()) | ||
], template='blocks/personalised_block_template.html', label=_('Block with template'))), | ||
('personalised_rich_text_block', PersonalisedRichTextBlock()), | ||
('personalised_image', PersonalisedImageChooserBlock()), | ||
('personalised_char', PersonalisedCharBlock()), | ||
('personalised_text', PersonalisedTextBlock()), | ||
]) | ||
|
||
content_panels = Page.content_panels + [ | ||
StreamFieldPanel('body') | ||
] |
2 changes: 1 addition & 1 deletion
2
...s/blocks/personalised_block_template.html → ...s/blocks/personalised_block_template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.