From 9bc6d96e522e68f1cf2838d5eb733f4526e62133 Mon Sep 17 00:00:00 2001 From: ketralnis Date: Wed, 3 Sep 2008 11:59:17 -0700 Subject: [PATCH] Added a "reported" queue for subreddit moderators --- r2/r2/controllers/front.py | 16 ++++++++++++++++ r2/r2/lib/pages/pages.py | 3 ++- r2/r2/lib/utils/utils.py | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index cd6b43a36..75fdd9042 100644 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -368,6 +368,22 @@ class FrontController(RedditController): stylesheet_contents = '' pane = SubredditStylesheet(site = c.site, stylesheet_contents = stylesheet_contents) + elif is_moderator and location == 'reports': + links = Link._query(Link.c.reported != 0, + Link.c._spam == False) + comments = Comment._query(Comment.c.reported != 0, + Comment.c._spam == False) + query = thing.Merge((links, comments), + sort = desc('_date'), + data = True, + *c.site.query_rules()) + + builder = QueryBuilder(query, num = num, after = after, + count = count, reverse = reverse, + wrap = ListingController.builder_wrapper) + listing = LinkListing(builder) + pane = listing.listing() + elif is_moderator and location == 'spam': links = Link._query(Link.c._spam == True) comments = Comment._query(Comment.c._spam == True) diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index 265d174cf..6f413cc7a 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -257,7 +257,8 @@ class SubredditInfoBar(Wrapped): if c.site.type != 'public': buttons.append(NavButton(plurals.contributors, 'contributors')) buttons.extend([NavButton(menu.banusers, 'banned'), - NamedButton('spam')]) + NamedButton('spam'), + NamedButton('reports')]) return [NavMenu(buttons, type = "flatlist", base_path = "/about/")] class SideBox(Wrapped): diff --git a/r2/r2/lib/utils/utils.py b/r2/r2/lib/utils/utils.py index 365d17cd5..a9a0ee92d 100644 --- a/r2/r2/lib/utils/utils.py +++ b/r2/r2/lib/utils/utils.py @@ -766,3 +766,4 @@ def title_to_url(title, max_length = 50): if (last_word > 0): title = title[:last_word] return title +