mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Create /subreddits/quarantine
This lists all of the subreddits that have been quarantined.
This commit is contained in:
committed by
Florence Yeun
parent
6c76c86817
commit
68ed9767d8
@@ -87,8 +87,7 @@ def make_map():
|
||||
mc('/subreddits/login', controller='forms', action='login')
|
||||
mc('/subreddits/:where', controller='reddits', action='listing',
|
||||
where='popular', conditions={'function':not_in_sr},
|
||||
requirements=dict(where="popular|new|banned|employee|gold|default"))
|
||||
|
||||
requirements=dict(where="popular|new|banned|employee|gold|default|quarantine"))
|
||||
# If no subreddit is specified, might as well show a list of 'em.
|
||||
mc('/r', controller='redirect', action='redirect', dest='/subreddits')
|
||||
|
||||
|
||||
@@ -1322,6 +1322,18 @@ class RedditsController(ListingController):
|
||||
stale=True,
|
||||
)
|
||||
reddits._sort = desc('_downs')
|
||||
elif self.where == 'quarantine':
|
||||
if c.user_is_admin:
|
||||
reddits = Subreddit._query(
|
||||
Subreddit.c.quarantine==True,
|
||||
write_cache=True,
|
||||
read_cache=True,
|
||||
cache_time=5 * 60,
|
||||
stale=True,
|
||||
)
|
||||
reddits._sort = desc('_downs')
|
||||
else:
|
||||
abort(404)
|
||||
elif self.where == 'gold':
|
||||
reddits = Subreddit._query(
|
||||
Subreddit.c.type=='gold_only',
|
||||
|
||||
@@ -147,6 +147,7 @@ menu = MenuHandler(hot = _('hot'),
|
||||
popular = _("popular"),
|
||||
create = _("create"),
|
||||
mine = _("my subreddits"),
|
||||
quarantine = _("quarantine"),
|
||||
|
||||
i18n = _("help translate"),
|
||||
errors = _("errors"),
|
||||
|
||||
@@ -2059,6 +2059,8 @@ class SubredditsPage(Reddit):
|
||||
buttons.append(NamedButton("employee"))
|
||||
if c.user.gold or c.user.gold_charter:
|
||||
buttons.append(NamedButton("gold"))
|
||||
if c.user_is_admin:
|
||||
buttons.append(NamedButton("quarantine"))
|
||||
if c.user_is_loggedin:
|
||||
#add the aliases to "my reddits" stays highlighted
|
||||
buttons.append(NamedButton("mine",
|
||||
|
||||
Reference in New Issue
Block a user