Skip to main content

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 panel types: MultiFieldPanel and StreamFieldPanel

StreamField UI improvements

  • Added border around blocks
  • Added spacing between blocks
  • Permanently visible add buttons
  • Use more of the available space for stream blocks

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'),
    ]

Screenshot

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'),
    ]

Screenshot

Project details


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.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wagtailuiplus-1.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file wagtailuiplus-1.1.0.tar.gz.

File metadata

  • Download URL: wagtailuiplus-1.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.5.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.1

File hashes

Hashes for wagtailuiplus-1.1.0.tar.gz
Algorithm Hash digest
SHA256 75ccad08cf9953fe2b8f1e2666dea74d35b73e0915cd0b8cda3096788a2c575d
MD5 e36c2c4a4588301bb56f0e5991a448c6
BLAKE2b-256 ad81146269484d40b8f4a57509877533282b6e08d0c22b80d44ba25e42793a6b

See more details on using hashes here.

File details

Details for the file wagtailuiplus-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: wagtailuiplus-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.5.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.1

File hashes

Hashes for wagtailuiplus-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 224d29496e3e7d2ce09001f9108ddc8f0238103a7b8557dab3f91e29b33de480
MD5 5aa791b03dea8da95b5cf6cda8c36c89
BLAKE2b-256 4b026616df27729b00bb5e6c46a2e2ce84805dbf12e99632c8a81c8f2069c594

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page