Added a "reported" queue for subreddit moderators

This commit is contained in:
ketralnis
2008-09-03 11:59:17 -07:00
parent 58fd1e8582
commit 9bc6d96e52
3 changed files with 19 additions and 1 deletions

View File

@@ -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)

View File

@@ -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):

View File

@@ -766,3 +766,4 @@ def title_to_url(title, max_length = 50):
if (last_word > 0):
title = title[:last_word]
return title