mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-29 00:38:11 -05:00
Parameterize the Ads template.
This commit is contained in:
@@ -2339,7 +2339,16 @@ class AdminAwardWinners(Templated):
|
||||
Templated.__init__(self, award = award, trophies = trophies)
|
||||
|
||||
class Ads(Templated):
|
||||
pass
|
||||
def __init__(self):
|
||||
Templated.__init__(self)
|
||||
path = ""
|
||||
if c.custom_dart_keyword:
|
||||
path = "r/%s/%s" % (c.site.path, c.custom_dart_keyword)
|
||||
elif not c.default_sr:
|
||||
path = "r/%s/" % c.site.path
|
||||
self.ad_url = g.ad_domain + "/ads/" + path
|
||||
self.frame_id = "ad-frame"
|
||||
|
||||
|
||||
class Embed(Templated):
|
||||
"""wrapper for embedding /help into reddit as if it were not on a separate wiki."""
|
||||
|
||||
@@ -26,18 +26,8 @@
|
||||
import random
|
||||
%>
|
||||
|
||||
<%
|
||||
|
||||
name = ''
|
||||
if c.custom_dart_keyword:
|
||||
name = "r/%s/%s" % (c.site.name, c.custom_dart_keyword)
|
||||
elif not c.default_sr:
|
||||
name = "r/%s/" % c.site.name
|
||||
|
||||
%>
|
||||
|
||||
<iframe id="ad-frame" frameborder="0" scrolling="no" name="ad-frame"
|
||||
src="${g.ad_domain}/ads/${name}">
|
||||
<iframe id="${thing.frame_id}" frameborder="0" scrolling="no" name="${thing.frame_id}"
|
||||
src="${thing.ad_url}">
|
||||
</iframe>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
Reference in New Issue
Block a user