mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-29 00:38:11 -05:00
Fully rendered sidebars now at /r/foo/about/sidebar
This commit is contained in:
@@ -61,6 +61,7 @@ def make_map():
|
||||
|
||||
mc('/about/message/:where', controller='message', action='listing')
|
||||
mc('/about/log', controller='front', action='moderationlog')
|
||||
mc('/about/sidebar', controller='front', action='sidebar')
|
||||
mc('/about', controller='front', action='about')
|
||||
mc('/about/:location', controller='front', action='editreddit',
|
||||
location='about')
|
||||
|
||||
@@ -692,6 +692,11 @@ class FrontController(RedditController, OAuth2ResourceController):
|
||||
return self.abort404()
|
||||
return Reddit(content = Wrapped(c.site)).render()
|
||||
|
||||
@require_oauth2_scope("read")
|
||||
def GET_sidebar(self):
|
||||
usertext = UserText(c.site, c.site.description)
|
||||
return Reddit(content=usertext).render()
|
||||
|
||||
def GET_awards(self):
|
||||
"""The awards page."""
|
||||
return BoringPage(_("awards"), content = UserAwards()).render()
|
||||
|
||||
@@ -213,6 +213,7 @@ class SubredditJsonTemplate(ThingJsonTemplate):
|
||||
url = "path",
|
||||
over18 = "over_18",
|
||||
description = "description",
|
||||
description_html = "description_html",
|
||||
public_description = "public_description",
|
||||
display_name = "name",
|
||||
header_img = "header",
|
||||
@@ -229,6 +230,8 @@ class SubredditJsonTemplate(ThingJsonTemplate):
|
||||
# Don't return accounts_active counts in /reddits
|
||||
elif (attr == "accounts_active" and isinstance(c.site, SubSR)):
|
||||
return None
|
||||
elif attr == 'description_html':
|
||||
return safemarkdown(thing.description)
|
||||
else:
|
||||
return ThingJsonTemplate.thing_attr(self, thing, attr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user