Metadata-Version: 2.4
Name: wagtail-sb-structblock
Version: 0.5.0
Summary: Tabbed interface for Wagtail's struct blocks with settings fields.
Keywords: cms,django,dynova,softbutterfly,structblock,wagtail
Author: Dynova Development Team, zodiacfireworks
Author-email: Dynova Development Team <dev@dynova.io>, zodiacfireworks <martin.vuelta@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django :: 4
Classifier: Framework :: Django :: 5
Classifier: Framework :: Django :: 6
Classifier: Framework :: Wagtail :: 5
Classifier: Framework :: Wagtail :: 6
Classifier: Framework :: Wagtail :: 7
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: django>=4.2
Requires-Dist: djangorestframework>=3.14
Requires-Dist: wagtail>=5.2
Maintainer: zodiacfireworks
Maintainer-email: zodiacfireworks <martin.vuelta@gmail.com>
Requires-Python: >=3.11.0, <4.0.0
Project-URL: Bug Tracker, https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/-/issues
Project-URL: Changelog, https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/-/blob/v0.5.0/CHANGELOG.md
Project-URL: Documentation, https://softbutterfly.gitlab.io/open-source/wagtail-sb-structblock
Project-URL: Download, https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/-/archive/v0.5.0/wagtail-sb-structblock-v0.5.0.tar.gz
Project-URL: Homepage, https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock
Project-URL: Issues, https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/-/issues
Project-URL: Repository, https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock
Description-Content-Type: text/markdown

# Wagtail SB Struct Block

**Tabbed interface for Wagtail's struct blocks with settings fields.**

![Community-Project][repository:banner]

![PyPI - Supported versions][pypi:badge:python]
![PyPI - Package version][pypi:badge:version]
![PyPI - Downloads][pypi:badge:downloads]
![PyPI - License][pypi:badge:license]
[![Codacy Grade Badge][codacy:grade]][codacy:dashboard]
[![Codacy Coverage Badge][codacy:coverage]][codacy:dashboard]
[![Gitlab Pipeline Status][repository:pipeline]][repository:commits]

Package to render Wagtail `StructBlock` with a tabbed interface to distinguish
between content fields and settings fields, improving the editor experience.

## ✨ Features

- **Tabbed Interface**: Cleanly separate content fields from settings fields.
- **Easy Configuration**: Simple to use by subclassing and defining
  `settings_fields` in `Meta`.
- **Modern Stack**: Built for modern Python (3.11+) and up to date
  Django/Wagtail versions.

## 📋 Requirements

- Python 3.11 or higher
- Wagtail 5.2 or higher
- Django 4.2 or higher

## 📦 Installation

### Using pip

```bash
pip install wagtail-sb-structblock
```

### Using uv

```bash
uv add wagtail-sb-structblock
```

## 🚀 Usage

Add `wagtail_sb_structblock` to your `INSTALLED_APPS` settings:

```python
INSTALLED_APPS = [
  # ...
  "wagtail_sb_structblock",
  # ...
]
```

In your struct blocks must inherit from
`wagtail_sb_structblock.blocks.StructBlock` and you must specify the
`settings_fields` in your `Meta` class.

```python
from wagtail.blocks import CharBlock
from wagtail_sb_structblock.blocks import StructBlock

class EnhancedHTMLBlock(StructBlock):
    text = CharBlock()
    html_attrs = CharBlock()

    class Meta:
        settings_fields = [
            "html_attrs",
        ]
```

Include it in your stream field and your model so you can use a tabbed
interface for your struct block.

![content tab](https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/-/raw/master/_assets/content_tab.png)

![settings tab](https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/-/raw/master/_assets/settings_tab.png)

## 🛠️ Development

Check out our [Contribution Guide](./CONTRIBUTING.md) for details on setting up
your development environment, running tests, and submitting pull requests.

The project uses `uv` for dependency management, `ruff` for linting, and `tox`
for multi-environment testing.

## 📜 Changelog

See the [CHANGELOG.md](./CHANGELOG.md) for a history of changes.

## 👥 Contributors

See our [list of contributors][repository:contributors].

## 📄 License

This project is licensed under the Apache License 2.0. See the
[LICENSE](./LICENSE) file for details.

[repository:banner]: https://gitlab.com/softbutterfly/open-source/open-source-office/-/raw/master/assets/dynova/dynova-open-source--banner--community-project.png
[repository:pipeline]: https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/badges/master/pipeline.svg
[repository:commits]: https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/-/commits/master
[repository:contributors]: https://gitlab.com/softbutterfly/open-source/wagtail-sb-structblock/-/graphs/develop

[pypi:badge:python]: https://img.shields.io/pypi/pyversions/wagtail-sb-structblock
[pypi:badge:version]: https://img.shields.io/pypi/v/wagtail-sb-structblock
[pypi:badge:downloads]: https://img.shields.io/pypi/dm/wagtail-sb-structblock
[pypi:badge:license]: https://img.shields.io/pypi/l/wagtail-sb-structblock

[codacy:grade]: https://app.codacy.com/project/badge/Grade/00f3debb1fa94a51894b03ec2273fafa
[codacy:coverage]: https://app.codacy.com/project/badge/Coverage/00f3debb1fa94a51894b03ec2273fafa
[codacy:dashboard]: https://app.codacy.com/gl/softbutterfly/wagtail-sb-structblock/dashboard
