Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wagtail/wagtail-review
A Wagtail extension for gathering annotations and feedback on pages before publication
https://github.com/wagtail/wagtail-review
Last synced: 2 months ago
JSON representation
A Wagtail extension for gathering annotations and feedback on pages before publication
- Host: GitHub
- URL: https://github.com/wagtail/wagtail-review
- Owner: wagtail-nest
- License: bsd-3-clause
- Created: 2018-12-17T15:19:34.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-11-03T21:41:35.000Z (about 1 year ago)
- Last Synced: 2024-05-20T12:13:01.591Z (6 months ago)
- Language: Python
- Size: 717 KB
- Stars: 47
- Watchers: 17
- Forks: 18
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.txt
- License: LICENSE
Awesome Lists containing this project
README
# wagtail-review
An extension for Wagtail allowing pages to be submitted for review (including to non-Wagtail users) prior to publication
![Screencast demo](https://tom.s3.amazonaws.com/wagtail-review.gif)
## Requirements
Wagtail 5.2 or higher
## Installation
Install the package from PyPI:
pip install wagtail-review
Add to your project's `INSTALLED_APPS`:
'wagtail_review',
Add to your project's URL config:
from wagtail_review import urls as wagtailreview_urls
# Somewhere above the include(wagtail_urls) line:
path("review/", include(wagtailreview_urls)),Add a `{% wagtailreview %}` tag to your project's base template(s), towards the bottom of the document ``:
{% load wagtailreview_tags %}
{% wagtailreview %}
## Custom notification emails
To customise the notification email sent to reviewers, override the templates `wagtail_review/email/request_review_subject.txt` (for the subject line) and `wagtail_review/email/request_review.txt` (for the email content). This needs to be done in an app which appears above `wagtail_review` in the `INSTALLED_APPS` list.
The following context variables are available within the templates:
* `email`: the reviewer's email address
* `user`: the reviewer's user object (`None` if the reviewer was specified as an email address only, rather than a user account)
* `review`: The review object (probably only useful when a custom review model is in use - see below)
* `page`: Page object corresponding to the page revision to be reviewed
* `submitter`: user object of the Wagtail user submitting the page for review
* `respond_url`: Personalised URL (including domain) for this reviewer intended to be kept private, allowing them to respond to the review
* `view_url`: Personalised URL (including domain) for this reviewer intended to be shared with colleagues, allowing them to view the page under reviewTo customise the notification email sent to the review submitter when a reviewer responds,
override the templates `wagtail_review/email/response_received_subject.txt` (for the subject line) and `wagtail_review/email/response_received.txt` (for the email content). The following context variables are available:* `submitter`: The user object of the Wagtail user who submitted the page for review
* `reviewer`: Reviewer object for the person responding to the review
* `review`: The review object (probably only useful when a custom review model is in use - see below)
* `page`: Page object corresponding to the page revision being reviewed
* `response`: Object representing the reviewer's response, including fields 'result' (equal to 'approve' or 'comment') and 'comment'## Custom review models
To define a custom review model:
# my_project/my_app/models.py
from wagtail_review.models import BaseReview
REVIEW_TYPE_CHOICES = [
('clinical', "Clinical review"),
('editorial', "Editorial review"),
]class Review(BaseReview):
review_type = models.CharField(max_length=255, choices=REVIEW_TYPE_CHOICES)# my_project/my_app/forms.py
from wagtail_review.forms import CreateReviewForm as BaseCreateReviewForm
class CreateReviewForm(BaseCreateReviewForm):
class Meta(BaseCreateReviewForm.Meta):
fields = ['review_type']# my_project/settings.py
WAGTAILREVIEW_REVIEW_MODEL = 'my_app.Review' # appname.ModelName identifier for model
WAGTAILREVIEW_REVIEW_FORM = 'my_project.my_app.forms.CreateReviewForm' # dotted path to form class## Custom response form
The form for responding to reviews can be customised by overriding the template `wagtail_review/response_form_fields.html`; this needs to be done in an app which appears above `wagtail_review` in the `INSTALLED_APPS` list. The HTML for the default form is:
Submit your review{% for radio in response_form.result %}
{{ radio }}
{% endfor %}
Leave a comment
{{ response_form.comment }}