[ckan-changes] [okfn/ckan] 62ce62: Merge branch 'master' of https://github.com/okfn/c...

GitHub noreply at github.com
Tue May 1 08:37:57 UTC 2012


  Branch: refs/heads/master
  Home:   https://github.com/okfn/ckan
  Commit: 62ce626b0c5931605aa82d07c2401865bd40d26b
      https://github.com/okfn/ckan/commit/62ce626b0c5931605aa82d07c2401865bd40d26b
  Author: Ross Jones <rossdjones 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:
  -----------
  Merge branch 'master' of https://github.com/okfn/ckan


diff --git a/ckan/config/middleware.py b/ckan/config/middleware.py
index 5d2be57..ea1dccb 100644
--- a/ckan/config/middleware.py
+++ b/ckan/config/middleware.py
@@ -134,8 +134,9 @@ def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
     if asbool(config.get('ckan.page_cache_enabled')):
         app = PageCacheMiddleware(app, config)
 
-    # Tracking add config option
-    app = TrackingMiddleware(app, config)
+    # Tracking
+    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..ed0ed72 100644
--- a/ckan/lib/helpers.py
+++ b/ckan/lib/helpers.py
@@ -153,9 +153,14 @@ def _add_i18n_to_url(url_to_amend, **kw):
     return url
 
 def lang():
-    ''' Reurn the language code for the current locale eg `en` '''
+    ''' Return the language code for the current locale eg `en` '''
     return request.environ.get('CKAN_LANG')
 
+def lang_native_name():
+    ''' Return the langage name currently used in it's localised form '''
+    locale = get_locales_dict().get(lang())
+    return locale.display_name or locale.english_name
+
 class Message(object):
     """A message returned by ``Flash.pop_messages()``.
 
@@ -799,6 +804,7 @@ def process_names(items):
            'snippet',
            'convert_to_dict',
            'activity_div',
+           'lang_native_name',
     # imported into ckan.lib.helpers
            'literal',
            'link_to',
@@ -809,4 +815,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: c1d648c7860bc5bac63ddee6953dbaed4e155999
      https://github.com/okfn/ckan/commit/c1d648c7860bc5bac63ddee6953dbaed4e155999
  Author: Ross Jones <rossdjones at gmail.com>
  Date:   2012-05-01 (Tue, 01 May 2012)

  Changed paths:
    M doc/_themes/sphinx-theme-okfn
    M doc/conf.py

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


diff --git a/doc/_themes/sphinx-theme-okfn b/doc/_themes/sphinx-theme-okfn
index fd96c62..3c912d2 160000
--- a/doc/_themes/sphinx-theme-okfn
+++ b/doc/_themes/sphinx-theme-okfn
@@ -1 +1 @@
-Subproject commit fd96c62b6426a3cc72b3c70314bc4af25e265cb3
+Subproject commit 3c912d26ad863a9cdadf89a47f63aef41d6c095b
diff --git a/doc/conf.py b/doc/conf.py
index c8294fe..3b672db 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -113,7 +113,8 @@
 html_theme_path = ['_themes']
 html_theme = 'sphinx-theme-okfn'
 html_theme_options = {
-        'logo_icon': 'http://assets.okfn.org/p/opendatahandbook/img/data-wrench-inverted.png'
+        'logo_icon': 'http://assets.okfn.org/p/opendatahandbook/img/data-wrench-inverted.png',
+        'show_version': True
     }
 
 html_sidebars = {


================================================================
  Commit: 4827743e99d17ff3c1a70d2d255a494728c2fbf6
      https://github.com/okfn/ckan/commit/4827743e99d17ff3c1a70d2d255a494728c2fbf6
  Author: Ross Jones <rossdjones at gmail.com>
  Date:   2012-05-01 (Tue, 01 May 2012)

  Changed paths:
    M ckan/lib/helpers.py

  Log Message:
  -----------
  [1650] Fixed native name for language to optionally take a parameter


diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py
index ed0ed72..b84636c 100644
--- a/ckan/lib/helpers.py
+++ b/ckan/lib/helpers.py
@@ -156,10 +156,14 @@ def lang():
     ''' Return the language code for the current locale eg `en` '''
     return request.environ.get('CKAN_LANG')
 
-def lang_native_name():
-    ''' Return the langage name currently used in it's localised form '''
-    locale = get_locales_dict().get(lang())
-    return locale.display_name or locale.english_name
+def lang_native_name(lang=None):
+    ''' Return the langage name currently used in it's localised form
+        either from parameter or current environ setting'''
+    lang = lang or lang()
+    locale = get_locales_dict().get(lang)
+    if locale:
+        return locale.display_name or locale.english_name
+    return lang
 
 class Message(object):
     """A message returned by ``Flash.pop_messages()``.


================================================================
Compare: https://github.com/okfn/ckan/compare/2960349...4827743


More information about the ckan-changes mailing list