cliss21
/
wagtail-maps
Archivé
5
0
Bifurcation 0
Create and display maps with points in Wagtail https://framagit.org/cliss21/wagtail-maps
Ce dépôt a été archivé le 2022-02-25. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
 
 
 
 
 
 
Aller au fichier
Jérôme Lebleu aabb415b6b doc(changelog): release 0.2.0 2021-10-15 15:43:07 +02:00
examples/frontend doc(frontend): provide an example with JavaScript code and styles 2021-10-14 15:43:17 +02:00
tests feat(models): add center and zoom levels' config to the map 2021-10-12 18:27:43 +02:00
wagtail_maps doc(changelog): release 0.2.0 2021-10-15 15:43:07 +02:00
.babelrc.json feat(js): use webpack to bundle and minify the code 2021-10-15 11:30:25 +02:00
.editorconfig feat: add packaging, models and blocks with tests 2021-10-07 18:37:27 +02:00
.eslintrc.json feat(js): use webpack to bundle and minify the code 2021-10-15 11:30:25 +02:00
.gitignore feat(js): use webpack to bundle and minify the code 2021-10-15 11:30:25 +02:00
.prettierrc feat(js): use webpack to bundle and minify the code 2021-10-15 11:30:25 +02:00
CHANGELOG.md doc(changelog): release 0.2.0 2021-10-15 15:43:07 +02:00
LICENSE feat: add packaging, models and blocks with tests 2021-10-07 18:37:27 +02:00
MANIFEST.in feat(js): use webpack to bundle and minify the code 2021-10-15 11:30:25 +02:00
Makefile feat: add packaging, models and blocks with tests 2021-10-07 18:37:27 +02:00
README.md doc(frontend): provide an example with JavaScript code and styles 2021-10-14 15:43:17 +02:00
package-lock.json feat(js): use webpack to bundle and minify the code 2021-10-15 11:30:25 +02:00
package.json feat(js): use webpack to bundle and minify the code 2021-10-15 11:30:25 +02:00
pyproject.toml feat: add packaging, models and blocks with tests 2021-10-07 18:37:27 +02:00
setup.cfg fix: require Wagtail >=2.14 and document submitted PR 2021-10-14 15:13:14 +02:00
setup.py feat: add packaging, models and blocks with tests 2021-10-07 18:37:27 +02:00
tox.ini fix: require Wagtail >=2.14 and document submitted PR 2021-10-14 15:13:14 +02:00
webpack.config.js feat(js): use webpack to bundle and minify the code 2021-10-15 11:30:25 +02:00

README.md

wagtail-maps

Create and display maps with points in Wagtail.

Warning! This project is still early on in its development lifecycle. It is possible for breaking changes to occur between versions until reaching a stable 1.0. Feedback and pull requests are welcome.

This package extend Wagtail to add a new Map model, which is composed by one or more points. Each point may have a title, some content and link to an internal or external URL. Once you have configured your map from the Wagtail admin, you will be able to display it in a page - e.g. as a StreamField block.

Requirements

This package requires the following:

  • Wagtail >= 2.14: upstream patches have been submitted to provide a proper integration of this extension into the admin - see #7562, #7565 and #7590
  • Django (3.1, 3.2)
  • Python 3 (3.7, 3.8, 3.9)

Installation

  1. Install using pip:
    pip install wagtail-maps
    
  2. Add wagtail_maps to your INSTALLED_APPS setting:
    INSTALLED_APPS = [
        # ...
        'wagtail_maps',
        # ...
    ]
    
  3. Include the URL of wagtail-maps to your urls.py file:
    from wagtail_maps import urls as wagtailmaps_urls
    
    urlpatterns = [
        # ...
        path('maps/', include(wagtailmaps_urls)),
        # ...
    ]
    
  4. Run python manage.py migrate to create the models

Usage

A StreamField block wagtail_maps.blocks.MapBlock can be used to display a map - choosen from the current ones - in your page. The JavaScript code and the Leaflet package is currently not shipped, but you can find an example in examples/frontend/.

Development

Quick start

To set up a development environment, ensure that Python 3 is installed on your system. Then:

  1. Clone this repository
  2. Create a virtual environment and activate it:
    python3 -m venv venv
    source venv/bin/activate
    
  3. Install this package in develop mode with extra requirements:
    pip install -e .[test]
    

Contributing

The Python code is formatted and linted thanks to flake8, isort and black. To ease the use of this tools, the following commands are available:

  • make lint: check the Python code syntax and imports order
  • make format: fix the Python code syntax and imports order

The tests are written with pytest and code coverage is measured with coverage. You can use the following commands for that:

  • make test: run the tests and output a quick report of code coverage
  • make coverage: run the tests and produce an HTML report of code coverage

When submitting a pull-request, please ensure that the code is well formatted and covered, and that all the other tests pass.

License

This extension is mainly developed by Cliss XXI and licensed under the AGPLv3+. Any contribution is welcome!