diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index 13f86cc74..99eb4089b 100755 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -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()) diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index a1e60e112..06c59f2bc 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -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: