diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -305,6 +305,19 @@ class BaseController(WSGIController): 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 --git a/kallithea/templates/admin/settings/settings_global.html b/kallithea/templates/admin/settings/settings_global.html --- a/kallithea/templates/admin/settings/settings_global.html +++ b/kallithea/templates/admin/settings/settings_global.html @@ -24,10 +24,11 @@ ${h.form(url('admin_settings_global'), m
- +
- ${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 --git a/kallithea/templates/base/root.html b/kallithea/templates/base/root.html --- a/kallithea/templates/base/root.html +++ b/kallithea/templates/base/root.html @@ -22,21 +22,6 @@ ${self.css()} - %if c.ga_code: - - - %endif - ## JAVASCRIPT ## <%def name="js()">