[ckan-changes] [okfn/ckan] 3991c1: make tracking optional via config options

GitHub noreply at github.com
Mon Apr 30 14:18:08 UTC 2012


  Branch: refs/heads/master
  Home:   https://github.com/okfn/ckan
  Commit: 3991c18ac482e9b5a55dd520acea7cd6bbf54f68
      https://github.com/okfn/ckan/commit/3991c18ac482e9b5a55dd520acea7cd6bbf54f68
  Author: Toby <toby.junk at gmail.com>
  Date:   2012-04-30 (Mon, 30 Apr 2012)

  Changed paths:
    M ckan/config/middleware.py
    M ckan/lib/helpers.py
    M ckan/templates/layout_base.html

  Log Message:
  -----------
  make tracking optional via config options


diff --git a/ckan/config/middleware.py b/ckan/config/middleware.py
index 5d2be57..f0dca73 100644
--- a/ckan/config/middleware.py
+++ b/ckan/config/middleware.py
@@ -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):
diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py
index ea8a4fe..408b912 100644
--- a/ckan/lib/helpers.py
+++ b/ckan/lib/helpers.py
@@ -809,4 +809,5 @@ def process_names(items):
            'mail_to',
            'radio',
            'submit',
+           'asbool',
 ]
diff --git a/ckan/templates/layout_base.html b/ckan/templates/layout_base.html
index 8913814..9ed0ce6 100644
--- a/ckan/templates/layout_base.html
+++ b/ckan/templates/layout_base.html
@@ -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
@@ -289,6 +290,7 @@ <h3 class="widget-title">Meta</h3>
                          });
                  });
   </script>
+  </py:if>
 
   <py:if test="defined('optional_footer')">
     ${optional_footer()}


================================================================
  Commit: 45c30b64ae44c4b7f82400bb7d05107b2662dd45
      https://github.com/okfn/ckan/commit/45c30b64ae44c4b7f82400bb7d05107b2662dd45
  Author: Toby <toby.junk at gmail.com>
  Date:   2012-04-30 (Mon, 30 Apr 2012)

  Changed paths:
    M ckan/config/routing.py

  Log Message:
  -----------
  Merge branch 'master' of github.com:okfn/ckan


diff --git a/ckan/config/routing.py b/ckan/config/routing.py
index 6c03cb0..43fa8fd 100644
--- a/ckan/config/routing.py
+++ b/ckan/config/routing.py
@@ -153,7 +153,6 @@ def make_map():
     ##map.connect('/package/edit/{id}', controller='package_formalchemy', action='edit')
 
     with SubMapper(map, controller='related') as m:
-        m.connect('related_edit', '/related/{id}/edit', action='edit')
         m.connect('related_list', '/dataset/{id}/related', action='list')
         m.connect('related_read', '/dataset/{id}/related/{related_id}', action='read')
 


================================================================
Compare: https://github.com/okfn/ckan/compare/b1d529f...45c30b6


More information about the ckan-changes mailing list