mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-05-21 21:42:00 +00:00
incorrect variable names/syntax (this should not of worked)
This commit is contained in:
parent
38b9cc70e6
commit
c929410aef
1 changed files with 5 additions and 6 deletions
|
|
@ -8,13 +8,13 @@ import re
|
|||
|
||||
from django.template import Library, Node, TemplateSyntaxError
|
||||
|
||||
from analytical.utils import get_identity, is_internal_ip, disable_html, get_required_setting
|
||||
from analytical.utils import is_internal_ip, disable_html, get_required_setting
|
||||
|
||||
|
||||
CLICKMAP_TRACKER_ID_RE = re.compile(r'^\d+$')
|
||||
TRACKING_CODE = """
|
||||
<script type="text/javascript">
|
||||
var clickmapConfig = {tracker: '%(tracker_id)', version:'2'};
|
||||
var clickmapConfig = {tracker: '%(tracker_id)s', version:'2'};
|
||||
window.clickmapAsyncInit = function(){ __clickmap.init(clickmapConfig); };
|
||||
(function() { var _cmf = document.createElement('script'); _cmf.async = true;
|
||||
_cmf.src = document.location.protocol + '//www.clickmap.ch/tracker.js?t=';
|
||||
|
|
@ -46,12 +46,11 @@ def clickmap(parser, token):
|
|||
class ClickmapNode(Node):
|
||||
def __init__(self):
|
||||
self.tracker_id = get_required_setting('CLICKMAP_TRACKER_ID',
|
||||
CLICKMAP_TRACKER_ID_RE,
|
||||
"must be a (string containing) a number")
|
||||
CLICKMAP_TRACKER_ID_RE,
|
||||
"must be a (string containing) a number")
|
||||
|
||||
def render(self, context):
|
||||
html = TRACKING_CODE % {'portal_id': self.portal_id,
|
||||
'domain': self.domain}
|
||||
html = TRACKING_CODE % {'tracker_id': self.tracker_id}
|
||||
if is_internal_ip(context, 'CLICKMAP'):
|
||||
html = disable_html(html, 'Clickmap')
|
||||
return html
|
||||
|
|
|
|||
Loading…
Reference in a new issue