# HG changeset patch # User Simon Descarpentries # Date 1383672569 -3600 # Node ID 6da1a12084a9aacc5a30e1101dde8bbdcf457a1c # Parent b7c7da996d7a906f2d73bee818c31c184b2f2fa1 Add a DISABLE_TRACKING variable in settings as suggested here : http://www.co-ment.org/ticket/86 diff -r b7c7da996d7a -r 6da1a12084a9 settings_local_sample.py --- a/settings_local_sample.py Tue Nov 05 14:41:38 2013 +0100 +++ b/settings_local_sample.py Tue Nov 05 18:29:29 2013 +0100 @@ -78,3 +78,7 @@ # Set to TRUE to use Abiword for convertion from and to legacy formats. # 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 + diff -r b7c7da996d7a -r 6da1a12084a9 src/cm/context_processors.py --- a/src/cm/context_processors.py Tue Nov 05 14:41:38 2013 +0100 +++ b/src/cm/context_processors.py Tue Nov 05 18:29:29 2013 +0100 @@ -9,6 +9,7 @@ return { 'SITE_URL' : settings.SITE_URL, 'CLIENT_DEBUG' : settings.CLIENT_DEBUG, + 'DISABLE_TRACKING' : settings.DISABLE_TRACKING, 'YUI_VERSION' : settings.YUI_VERSION, 'CONF': ApplicationConfiguration, 'CM_MEDIA_PREFIX' : settings.CM_MEDIA_PREFIX, diff -r b7c7da996d7a -r 6da1a12084a9 src/cm/settings.py --- a/src/cm/settings.py Tue Nov 05 14:41:38 2013 +0100 +++ b/src/cm/settings.py Tue Nov 05 18:29:29 2013 +0100 @@ -2,6 +2,10 @@ 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 b7c7da996d7a -r 6da1a12084a9 src/cm/templates/site/tracking.html --- a/src/cm/templates/site/tracking.html Tue Nov 05 14:41:38 2013 +0100 +++ b/src/cm/templates/site/tracking.html Tue Nov 05 18:29:29 2013 +0100 @@ -1,3 +1,7 @@ +{% if DISABLE_TRACKING %} + +{% else %} + {% autoescape off %}{{ TRACKING_HTML }}{% endautoescape %} @@ -12,5 +16,4 @@ } catch( err ) {} - - +{% endif %}