Re-work moderation of submitted items
authorMagnus Hagander <magnus@hagander.net>
Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)
commit5ffe6c389c020c718065b5d2146ce25ebe4b0c9b
treedb5699adf9daa7a65c1cfa0cb9e6dd87d1af4021
parentb3e9a962e4514962a1fdbf86b8cdbae3103e76e9
Re-work moderation of submitted items

This includes a number of new features:

* Move some moderation functionality into shared places, so we don't
  keep re-inventing the wheel.
* Implement three-state moderation, where the submitter can edit their
  item and then explicitly say "i'm done, please moderate this now".
  This is currently only implemented for News, but done in a reusable
  way.
* Move moderation workflow to it's own set of URLs instead of
  overloading it on the general admin interface. Admin interface remains
  for editing things, but these are now separated out into separate
  things.
* Do proper stylesheet clearing for moderation of markdown fields, using
  a dynamic sandboxed iframe, so it's not ruined by the /admin/ css.
* Move moderation email notification into dedicated moderation code,
  thereby simplifying the admin subclassing we did which was in some
  places quite fragile.
* Reset date of news postings to the date of their approval, when
  approved. This avoids some annoying ordering issues.
38 files changed:
media/css/admin_pgweb.css
media/css/main.css
media/js/admin_pgweb.js
pgweb/account/forms.py
pgweb/account/urls.py
pgweb/account/views.py
pgweb/core/forms.py
pgweb/core/models.py
pgweb/core/views.py
pgweb/downloads/forms.py
pgweb/downloads/models.py
pgweb/downloads/views.py
pgweb/events/models.py
pgweb/events/views.py
pgweb/news/admin.py
pgweb/news/feeds.py
pgweb/news/forms.py
pgweb/news/management/commands/twitter_post.py
pgweb/news/migrations/0005_modstate.py [new file with mode: 0644]
pgweb/news/models.py
pgweb/news/struct.py
pgweb/news/views.py
pgweb/profserv/forms.py
pgweb/profserv/models.py
pgweb/profserv/views.py
pgweb/urls.py
pgweb/util/admin.py
pgweb/util/helpers.py
pgweb/util/moderation.py
pgweb/util/signals.py
templates/account/index.html
templates/account/objectlist.html
templates/account/submit_form.html [new file with mode: 0644]
templates/account/submit_preview.html [new file with mode: 0644]
templates/admin/change_form_pgweb.html
templates/admin/news/newsarticle/change_form.html [deleted file]
templates/core/admin_moderation_form.html [new file with mode: 0644]
templates/core/admin_pending.html