From 5ba39f457ffb2ec8e22f3d2f19dc3c06efe5c90c Mon Sep 17 00:00:00 2001 From: "Jonathan S. Katz" Date: Sun, 4 Nov 2018 09:39:30 -0500 Subject: [PATCH] Break up "Awaiting Moderation" and "Approved" articles/events/etc. This was becoming illegible and also hard to maintain based on how we changed up the look/feel of the entire site. That way, we have two distinct categories for both types of objects, which makes it easier for the user to understand what is what. Also reworded the explanation for what is going on, both based on the structural change and because it read like a literal interpretation of the code. --- pgweb/account/views.py | 5 ++++- templates/account/objectlist.html | 25 +++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index a524a123..88df6245 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -202,7 +202,10 @@ def listobjects(request, objtype): o = objtypes[objtype] return render_pgweb(request, 'account', 'account/objectlist.html', { - 'objects': o['objects'](request.user), + 'objects': { + 'approved': o['objects'](request.user).filter(approved=True), + 'unapproved': o['objects'](request.user).filter(approved=False), + }, 'title': o['title'], 'submit_header': o.has_key('submit_header') and o['submit_header'] or None, 'suburl': objtype, diff --git a/templates/account/objectlist.html b/templates/account/objectlist.html index 834e3d5c..7d31f85b 100644 --- a/templates/account/objectlist.html +++ b/templates/account/objectlist.html @@ -3,15 +3,28 @@ {%block contents%}

{{title}}s

-Objects in bright red are awaiting moderator approval. Note that modifying a previously -approved object may result in it being un-approved if the changes are -extensive. +Objects that are awaiting moderator approval are listed in their own category. +Note that modifying anything that was previously approved might result in +additional moderation based upon what has changed in the content.

+ +{% if objects.unapproved %} +

Awaiting Moderation

+{% endif %} + +{% if objects.approved %} +

Approved

+ +{% endif %} {%if submit_header%}

{{submit_header|safe}}