mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Add hook to hot display pane and home sidebox.
This commit is contained in:
@@ -457,17 +457,30 @@ class HotController(ListingWithPromos):
|
||||
|
||||
def content(self):
|
||||
content = super(HotController, self).content()
|
||||
if (c.render_style == "html" and isinstance(c.site, DefaultSR) and
|
||||
not self.listing_obj.prev):
|
||||
trending_info = self.trending_info()
|
||||
if trending_info:
|
||||
return PaneStack(filter(None, [
|
||||
|
||||
if c.render_style == "html":
|
||||
stack = None
|
||||
if isinstance(c.site, DefaultSR) and not self.listing_obj.prev:
|
||||
trending_info = self.trending_info()
|
||||
stack = [
|
||||
self.spotlight,
|
||||
TrendingSubredditsBar(**trending_info),
|
||||
self.listing_obj,
|
||||
]), css_class='spacer')
|
||||
return content
|
||||
]
|
||||
else:
|
||||
hot_hook = hooks.get_hook("hot.get_content")
|
||||
hot_pane = hot_hook.call_until_return(controller=self)
|
||||
if hot_pane:
|
||||
stack = [
|
||||
self.spotlight,
|
||||
hot_pane,
|
||||
self.listing_obj
|
||||
]
|
||||
|
||||
if stack:
|
||||
return PaneStack(filter(None, stack), css_class='spacer')
|
||||
|
||||
return content
|
||||
|
||||
def title(self):
|
||||
return c.site.title
|
||||
|
||||
@@ -638,6 +638,12 @@ class Reddit(Templated):
|
||||
subtitles = rand_strings.get("create_reddit", 2),
|
||||
show_cover = True, nocname=True))
|
||||
|
||||
if c.default_sr:
|
||||
hook = hooks.get_hook('home.add_sidebox')
|
||||
extra_sidebox = hook.call_until_return()
|
||||
if extra_sidebox:
|
||||
ps.append(extra_sidebox)
|
||||
|
||||
if not isinstance(c.site, FakeSubreddit) and not c.cname:
|
||||
moderators = self.sr_moderators()
|
||||
if moderators:
|
||||
|
||||
Reference in New Issue
Block a user