# HG changeset patch # User domruf # Date 1408388676 -7200 # Node ID fb5760e8ba439ca57e01882ca64fe771808ced22 # Parent d6e96730edfb41b4bebaba43cdd89d328fb4d897 support other analytic systems then just Google Analytics Fallback to Google Analytics code if the string starts with "UA-" diff -r d6e96730edfb -r fb5760e8ba43 kallithea/lib/base.py --- a/kallithea/lib/base.py Thu Aug 21 23:46:55 2014 +0200 +++ b/kallithea/lib/base.py Mon Aug 18 21:04:36 2014 +0200 @@ -305,6 +305,19 @@ c.visual.gravatar_url = rc_config.get('gravatar_url') c.ga_code = rc_config.get('ga_code') + # TODO: replace undocumented backwards compatibility hack with db upgrade and rename ga_code + if c.ga_code and '<' not in c.ga_code: + c.ga_code = '''''' % c.ga_code c.site_name = rc_config.get('title') c.clone_uri_tmpl = rc_config.get('clone_uri_tmpl') diff -r d6e96730edfb -r fb5760e8ba43 kallithea/templates/admin/settings/settings_global.html --- a/kallithea/templates/admin/settings/settings_global.html Thu Aug 21 23:46:55 2014 +0200 +++ b/kallithea/templates/admin/settings/settings_global.html Mon Aug 18 21:04:36 2014 +0200 @@ -24,10 +24,11 @@
- +
- ${h.text('ga_code',size=30)} + ${h.textarea('ga_code', cols=80, rows=10)} + ${_('HTML with JavaScript for web analytics systems like Google Analytics or Piwik. This will be added at the bottom of every page.')}
diff -r d6e96730edfb -r fb5760e8ba43 kallithea/templates/base/root.html --- a/kallithea/templates/base/root.html Thu Aug 21 23:46:55 2014 +0200 +++ b/kallithea/templates/base/root.html Mon Aug 18 21:04:36 2014 +0200 @@ -22,21 +22,6 @@ ${self.css()} - %if c.ga_code: - - - %endif - ## JAVASCRIPT ## <%def name="js()">