Add a DISABLE_TRACKING variable in settings as suggested here : http://www.co-ment.org/ticket/86
authorSimon Descarpentries <sid@sopinspace.com>
Tue, 05 Nov 2013 18:29:29 +0100
changeset 561 6da1a12084a9
parent 560 b7c7da996d7a
child 562 92e8e5aaacde
Add a DISABLE_TRACKING variable in settings as suggested here : http://www.co-ment.org/ticket/86
settings_local_sample.py
src/cm/context_processors.py
src/cm/settings.py
src/cm/templates/site/tracking.html
--- 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
+
--- 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,
--- 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'),
 )
--- 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 %}
 
 <!-- Piwik -->
@@ -12,5 +16,4 @@
 } catch( err ) {}
 </script><noscript><p><img src="https://stats.co-ment.com/piwik.php?idsite=17" style="border:0" alt=""/></p></noscript>
 <!-- End Piwik Tag -->
-
-
+{% endif %}