This Wagtail app provides several ui improvements to the Wagtail editor interface.
Project description
Wagtail UI Plus
This Wagtail app provides several ui improvements to the Wagtail editor interface.
Collapsable panels
- Click on the panel header to collapse/expand the panel
- Set the default collapsed state
- Supported panels:
MultiFieldPanel
andStreamFieldPanel
Stream field improvements
- Added borders around blocks
- Added panel-style headers to blocks
- Added spacing between blocks
- Permanently visible add buttons
- Use more of the available space for blocks
- Supported blocks:
CharBlock
,TextBlock
,EmailBlock
,IntegerBlock
,FloatBlock
,DecimalBlock
,RegexBlock
,URLBlock
,BooleanBlock
,DateBlock
,TimeBlock
,DateTimeBlock
,RichTextBlock
,RawHTMLBlock
,BlockQuoteBlock
,ChoiceBlock
,PageChooserBlock
,DocumentChooserBlock
,ImageChooserBlock
,SnippetChooserBlock
,EmbedBlock
,StaticBlock
,StructBlock
andStreamBlock
Struct block improvements
- All of the above stream field improvements
- If the first field in the struct block is a
CharBlock
, show it's value in the block header - Click on the block header to collapse/expand the struct block
- All struct blocks are default collapsed on page load, but newly added blocks are default expanded
Compatibility
- Wagtail 2.5+
Installation
pip install wagtailuiplus
- Add
wagtailuiplus
to your installed apps
Usage
Collapsable panels
The panels automatically become collapsable. To set the initial collapsed state of panels, add the wagtailuiplus__panel--collapsed
classname to the panel, for example:
class HomePage(Page):
content_panels = [
MultiFieldPanel([
FieldPanel('title'),
], 'My multi field panel', classname='wagtailuiplus__panel--collapsed'),
]
StreamField UI improvements
The UI improvements automatically apply. Just create your StreamField as usual, for example:
from wagtail.admin.edit_handlers import StreamFieldPanel
from wagtail.core.blocks import (
CharBlock,
StreamBlock,
StructBlock,
RichTextBlock,
)
from wagtail.core.fields import StreamField
from wagtail.core.models import Page
class MyCharBlock(CharBlock):
class Meta:
icon = 'pilcrow'
label = 'My char block'
class MyRichTextBlock(RichTextBlock):
class Meta:
icon = 'openquote'
label = 'My rich text block'
class MyStreamBlock(StreamBlock):
title = MyCharBlock()
text = MyRichTextBlock()
class Meta:
label = 'My stream block'
class MyStructBlock(StructBlock):
items = MyStreamBlock(required=False)
class Meta:
icon = 'list-ul'
label = 'My struct block'
class HomePage(Page):
my_stream_field = StreamField([
('my_title_block', MyCharBlock()),
('my_text_block', MyRichTextBlock()),
('my_struct_block', MyStructBlock()),
], blank=True, verbose_name='My stream field')
content_panels = [
StreamFieldPanel('my_stream_field'),
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wagtailuiplus-1.1.2.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for wagtailuiplus-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d0f319a7b5dd170fa5809ff184f8768c217b72ca7aaef973d84af6241722b9 |
|
MD5 | 1e8b49fbfa6ade1a13813af291a40755 |
|
BLAKE2b-256 | 6ddfac95a8961214368e09f00f94c7c8fa5f30b620184d82f889252f062dc497 |