Added flatpages-extra
This PR adds django-flatpages-extra, which is a package I created after a discussion with @StephanieAG from the fundraising WG on how to make it easier to update flat pages.
As you can tell from the very short PR, the package is a drop-in replacement and is reversible. It adds the following features to the admin:
- The ability to create a revision for a flat page
- preview revisions (including a shareable link for people who don't have an admin account)
- reverting revisions
- better history of changes for flat pages
Initially I was going to develop this as an app in this project, but then realized it might be useful as a 3rd party too. If accepted I would release a 1.0 of the package.
Screenshots:
Editing content directly is disabled
Preview page
Compare view (diff)
Adding the link for easier review: https://pypi.org/project/django-flatpages-extra/
+1 for having the "is published" feature and revisions, but not sure about offloading both of them to a new package.
- If we are going to keep history, I'd prefer a package like https://django-simple-history.readthedocs.io/en/stable/ that works with every model.
- For "is published" feature, I think a small custom model could solve it.
@bmispelon I think we may want to have CI on that package as well, otherwise upgrades could be a bit tricky in the future [if things fall out of date with new versions of Django].
@bmispelon I think we may want to have CI on that package as well, otherwise upgrades could be a bit tricky in the future [if things fall out of date with new versions of Django].
The code is hosted on Codeberg where CI is not so easy to set up. I've added a just ci command that runs the test suite (100% coverage) on all supported versions of Django: 5.0, 5.1, 5.2 and event 6.0 (alpha release). They all pass locally, so I've released the current code as version 1.0 on pypi.
I also took the liberty of rebasing this PR onto the latest main branch.
Would folks be ok if I deployed this on the preview server?
+1 for having the "is published" feature and revisions, but not sure about offloading both of them to a new package.
* If we are going to keep history, I'd prefer a package like https://django-simple-history.readthedocs.io/en/stable/ that works with every model. * For "is published" feature, I think a small custom model could solve it.
The "small custom model" is how django-flatpages-extra started. I originally created it inside the source code of this site, but realized it could be useful as a third party.
I've designed the django-flatpages-extra so it can be added and removed with no ill effect, so we can install it temporarily while an alternate solution is worked on (maybe one involving django-simple-history and/or a simpler custom model).
The "small custom model" is how django-flatpages-extra started. I originally created it inside the source code of this site, but realized it could be useful as a third party.
Thanks for the details.
I've designed the django-flatpages-extra so it can be added and removed with no ill effect, so we can install it temporarily while an alternate solution is worked on (maybe one involving django-simple-history and/or a simpler custom model).
That sounds okay to me.
I've deployed this to the preview server. I'll reach out to Stephanie to see if she has time to test it to see if it this solution would work for her.