Metadata-Version: 2.1
Name: wagtail-news-image
Version: 0.0.2
Summary: An extended Draftail image block for news sites.
Home-page: https://github.com/StocksDigital/wagtail-news-image
Author: Matthew Segal
Author-email: matthew.segal@stocksdigital.com
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Framework :: Django
Classifier: Framework :: Wagtail
Classifier: Framework :: Wagtail :: 2
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Provides-Extra: test
Requires-Dist: wagtail (>=2)
Requires-Dist: djangorestframework (>=3)
Provides-Extra: test
Requires-Dist: pytest (>=3.5); extra == 'test'

# Wagtail News Image

This [Django](https://www.djangoproject.com/) app provides an inline image block for the Draftail WYSIWYG editor.

You can play with this plugin on a demo site [here](https://github.com/MattSegal/wagtail-news-image-demo).

This image block supports:

- upload
- search
- resize
- captions
- hyperlinks

This is what the image block looks like in the Draftail WYSIWYG editor:

<img src="./screenshots/WYSIWYG.png" alt="Wagtail WYSIWYG view" width="500px"/>

Clicking on the block reveals a modal, which allows you to edit the image:

<img src="./screenshots/modal.png" alt="Wagtail editor modal" width="500px"/>

## Installation

In `settings.py` you need to register the app in `INSTALLED_APPS`

```python
# settings.py

INSTALLED_APPS = [
  # ...
  'wagtailnewsimage',
  # ...
]
```

In `urls.py` you need to add `wagtailnewsimage.urls`. The base url (`wagtailnewsimage/`) can be configured to be whatever you like.

```python
# urls.py
urlpatterns = [
  # ...
  path(r'wagtailnewsimage/', include('wagtailnewsimage.urls')),
  # ...
]
```

In `models.py` you need to add `news-image` to your RichTextField features whitelist

```python
# models.py

class MyPage(Page):
    body = RichTextField(features=[
        # ...
        'news-image',
        # ...
    ])
```

## Dependencies

* Wagtail (2+)
* Django (1.11+)
* Django Rest Framework (3+)


