mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 07:19:25 -05:00
Show self-serve advertising button on traffic pages.
This commit is contained in:
committed by
Neil Williams
parent
c47a6ad28e
commit
98e874a97d
@@ -1069,7 +1069,7 @@ class FrontController(RedditController, OAuth2ResourceController):
|
||||
after)
|
||||
return LinkInfoPage(link=link,
|
||||
page_classes=["promoted-traffic"],
|
||||
comment=None,
|
||||
comment=None, show_promote_button=True,
|
||||
content=content).render()
|
||||
|
||||
@validate(VEmployee())
|
||||
|
||||
@@ -1172,7 +1172,7 @@ class LinkInfoPage(Reddit):
|
||||
|
||||
def __init__(self, link = None, comment = None,
|
||||
link_title = '', subtitle = None, num_duplicates = None,
|
||||
*a, **kw):
|
||||
show_promote_button=False, *a, **kw):
|
||||
|
||||
c.permalink_page = True
|
||||
expand_children = kw.get("expand_children", not bool(comment))
|
||||
@@ -1220,6 +1220,7 @@ class LinkInfoPage(Reddit):
|
||||
else:
|
||||
self.num_duplicates = num_duplicates
|
||||
|
||||
self.show_promote_button = show_promote_button
|
||||
robots = "noindex,nofollow" if link._deleted else None
|
||||
Reddit.__init__(self, title = title, short_description=short_description, robots=robots, *a, **kw)
|
||||
|
||||
@@ -1240,6 +1241,9 @@ class LinkInfoPage(Reddit):
|
||||
if self.num_duplicates > 0:
|
||||
buttons.append(info_button('duplicates', num=self.num_duplicates))
|
||||
|
||||
if self.show_promote_button:
|
||||
buttons.append(NavButton(menu.promote, 'promoted', sr_path=False))
|
||||
|
||||
toolbar = [NavMenu(buttons, base_path = "", type="tabmenu")]
|
||||
|
||||
if not isinstance(c.site, DefaultSR) and not c.cname:
|
||||
|
||||
Reference in New Issue
Block a user