Skip to content

Commit

Permalink
make tracking optional via config options
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Apr 30, 2012
1 parent 010066d commit 3991c18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/config/middleware.py
Expand Up @@ -135,7 +135,8 @@ def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
app = PageCacheMiddleware(app, config)

# Tracking add config option
app = TrackingMiddleware(app, config)
if asbool(config.get('ckan.tracking_enabled', 'false')):
app = TrackingMiddleware(app, config)
return app

class I18nMiddleware(object):
Expand Down
1 change: 1 addition & 0 deletions ckan/lib/helpers.py
Expand Up @@ -809,4 +809,5 @@ def process_names(items):
'mail_to',
'radio',
'submit',
'asbool',
]
2 changes: 2 additions & 0 deletions ckan/templates/layout_base.html
Expand Up @@ -268,6 +268,7 @@ <h3 class="widget-title">Meta</h3>
});
</script>

<py:if test="h.asbool(config.get('ckan.tracking_enabled', 'false'))">
<script type="text/javascript">
$(function (){
// Tracking
Expand All @@ -289,6 +290,7 @@ <h3 class="widget-title">Meta</h3>
});
});
</script>
</py:if>

<py:if test="defined('optional_footer')">
${optional_footer()}
Expand Down

0 comments on commit 3991c18

Please sign in to comment.