diff --git a/r2/example.ini b/r2/example.ini index 707645d3f..95b4890bf 100644 --- a/r2/example.ini +++ b/r2/example.ini @@ -36,6 +36,9 @@ FEEDSECRET = abcdefghijklmnopqrstuvwxyz0123456789 INDEXTANK_API_URL = +# -- feature toggles -- +disable_ads = false + # -- important settings -- # the domain that this app serves itself up as domain = reddit.local diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index d424aa425..cff198add 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -216,7 +216,7 @@ class Reddit(Templated): if not isinstance(c.site, FakeSubreddit) and not c.cname: #don't show the subreddit info bar on cnames ps.append(SubredditInfoBar()) - if c.user.pref_show_adbox or not c.user.gold: + if (c.user.pref_show_adbox or not c.user.gold) and not g.disable_ads: ps.append(Ads()) no_ads_yet = False @@ -265,7 +265,7 @@ class Reddit(Templated): ps.append(SideContentBox(_('admin box'), self.sr_admin_menu())) - if no_ads_yet: + if no_ads_yet and not g.disable_ads: if c.user.pref_show_adbox or not c.user.gold: ps.append(Ads())