[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH] Disable piwik statistics in debug mode
From: |
gael . utard |
Subject: |
[Maposmatic-dev] [PATCH] Disable piwik statistics in debug mode |
Date: |
Fri, 30 Mar 2012 17:18:07 +0200 |
From: Gael UTARD <address@hidden>
Signed-off-by: Gael UTARD <address@hidden>
---
www/maposmatic/context_processors.py | 1 +
www/templates/maposmatic/base.html | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/www/maposmatic/context_processors.py
b/www/maposmatic/context_processors.py
index 58dc05f..a4cb772 100644
--- a/www/maposmatic/context_processors.py
+++ b/www/maposmatic/context_processors.py
@@ -59,4 +59,5 @@ def all(request):
'blogposts': get_latest_blog_posts(),
'MAPOSMATIC_DAEMON_RUNNING': www.settings.is_daemon_running(),
'osm_date': get_osm_database_last_update(),
+ 'DEBUG': www.settings.DEBUG,
}
diff --git a/www/templates/maposmatic/base.html
b/www/templates/maposmatic/base.html
index 069032f..e02a222 100644
--- a/www/templates/maposmatic/base.html
+++ b/www/templates/maposmatic/base.html
@@ -147,6 +147,7 @@
</td>
</tr></tbody></table>
+{% if not DEBUG %}
<!-- Piwik statistics -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ?
"https://stats.maposmatic.org/piwik/" : "http://stats.maposmatic.org/piwik/");
@@ -163,5 +164,6 @@
<img src="http://stats.maposmatic.org/piwik/piwik.php?idsite=2" />
</noscript>
<!-- End Piwik Tag -->
+{% endif %}
</body>
</html>
--
1.7.5.4
- [Maposmatic-dev] [PATCH] Disable piwik statistics in debug mode,
gael . utard <=