Add hook to hot display pane and home sidebox.

This commit is contained in:
umbrae
2015-02-27 00:06:13 -08:00
parent 86a3d262f2
commit 69a129b5eb
2 changed files with 26 additions and 7 deletions

View File

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

View File

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