# HG changeset patch # User Simon Descarpentries # Date 1399377121 -7200 # Node ID 9bbc657f68372804977ef221a26df865592a5556 # Parent 24067001082cfabcbdf1962c32572e2b9a97265d Replace DISABLE_TRACKING and TRACKING_HTML by a TRACKING_ID variable in configuration files diff -r 24067001082c -r 9bbc657f6837 settings_local_sample.py --- a/settings_local_sample.py Wed Apr 30 18:39:32 2014 +0200 +++ b/settings_local_sample.py Tue May 06 13:52:01 2014 +0200 @@ -79,6 +79,6 @@ # Set to False to use LibreOffice for convertion from and to legacy formats. USE_ABI = True -# Set to True if you don't want to appear in Sopinspace Piwik statistics -DISABLE_TRACKING = DEBUG +# Set to False to avoid appearing in Sopinspace Piwik statistics +TRACKING_ID = False diff -r 24067001082c -r 9bbc657f6837 src/cm/cm_settings.py --- a/src/cm/cm_settings.py Wed Apr 30 18:39:32 2014 +0200 +++ b/src/cm/cm_settings.py Tue May 06 13:52:01 2014 +0200 @@ -13,6 +13,9 @@ DEFAULT_TIME_ZONE = get_setting('DEFAULT_TIME_ZONE','Europe/Paris') +# Piwik tracking ID +TRACKING_ID = get_setting ('TRACKING_ID', 17) + # button for new text version creation checked by default NEW_TEXT_VERSION_ON_EDIT = get_setting('NEW_TEXT_VERSION_ON_EDIT', True) @@ -25,8 +28,6 @@ # show email in user list SHOW_EMAILS_IN_ADMIN = get_setting('SHOW_EMAILS_IN_ADMIN', True) -TRACKING_HTML = get_setting('TRACKING_HTML', '') - # Store IP (or not) in activity STORE_ACTIVITY_IP = get_setting('STORE_ACTIVITY_IP', True) diff -r 24067001082c -r 9bbc657f6837 src/cm/context_processors.py --- a/src/cm/context_processors.py Wed Apr 30 18:39:32 2014 +0200 +++ b/src/cm/context_processors.py Tue May 06 13:52:01 2014 +0200 @@ -1,7 +1,8 @@ from django.conf import settings +from cm.cm_settings import TRACKING_ID from cm.models import ApplicationConfiguration -from cm.cm_settings import TRACKING_HTML from cm.converters.pandoc_converters import PANDOC_VERSION + def static(request): """ add static data to be used in templates @@ -9,11 +10,10 @@ return { 'SITE_URL' : settings.SITE_URL, 'CLIENT_DEBUG' : settings.CLIENT_DEBUG, - 'DISABLE_TRACKING' : settings.DISABLE_TRACKING, + 'TRACKING_ID' : TRACKING_ID, 'YUI_VERSION' : settings.YUI_VERSION, 'CONF': ApplicationConfiguration, 'CM_MEDIA_PREFIX' : settings.CM_MEDIA_PREFIX, - 'TRACKING_HTML' : TRACKING_HTML, 'PANDOC_VERSION' : PANDOC_VERSION, } diff -r 24067001082c -r 9bbc657f6837 src/cm/settings.py --- a/src/cm/settings.py Wed Apr 30 18:39:32 2014 +0200 +++ b/src/cm/settings.py Tue May 06 13:52:01 2014 +0200 @@ -2,10 +2,6 @@ CLIENT_DEBUG = DEBUG TEMPLATE_DEBUG = DEBUG -# Set to True if you don't want to appear in Sopinspace Piwik statistics -DISABLE_TRACKING = DEBUG - - ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) diff -r 24067001082c -r 9bbc657f6837 src/cm/templates/site/tracking.html --- a/src/cm/templates/site/tracking.html Wed Apr 30 18:39:32 2014 +0200 +++ b/src/cm/templates/site/tracking.html Tue May 06 13:52:01 2014 +0200 @@ -1,8 +1,4 @@ -{% if DISABLE_TRACKING %} - -{% else %} - -{% autoescape off %}{{ TRACKING_HTML }}{% endautoescape %} +{% if TRACKING_ID %}