[ckan-changes] commit/ckan: dread: [templates]: #1169 links to json dumps, if present. Also slightly improved speed by deduping an auth look-up in layout_base template.

Bitbucket commits-noreply at bitbucket.org
Mon May 30 11:19:37 UTC 2011


1 new changeset in ckan:

http://bitbucket.org/okfn/ckan/changeset/cebebea4465f/
changeset:   cebebea4465f
branches:    
user:        dread
date:        2011-05-30 13:15:41
summary:     [templates]: #1169 links to json dumps, if present. Also slightly improved speed by deduping an auth look-up in layout_base template.
affected #:  3 files (1.2 KB)

--- a/ckan/templates/layout_base.html	Fri May 27 10:43:44 2011 +0100
+++ b/ckan/templates/layout_base.html	Mon May 30 12:15:41 2011 +0100
@@ -97,7 +97,10 @@
         <ul><li>${h.nav_link(c, _('Home'), controller='home', action='index', id=None)}</li><li>${h.nav_link(c, _('Search'), controller='package', action='index', id=None, highlight_actions = 'search index')}</li>
-          <li py:if="h.am_authorized(c, actions.PACKAGE_CREATE)">${h.nav_link(c, _('Add a package'), controller='package', action='new', id=None)}</li>
+<?python
+    am_authorized_package_create = h.am_authorized(c, actions.PACKAGE_CREATE)
+?>
+          <li py:if="am_authorized_package_create">${h.nav_link(c, _('Add a package'), controller='package', action='new', id=None)}</li><li>${h.nav_link(c, _('Tags'), controller='tag', action='index', id=None)}</li><li>${h.nav_link(c, _('Groups'), controller='group', action='index', id=None, highlight_actions = 'new index')}</li><li>${h.nav_link(c, _('About'), controller='home', action='about', id=None)}</li>
@@ -164,10 +167,16 @@
           <div class="textwidget"><ul><li>${h.nav_link(c, _('Search'), controller='package', action='search', id=None)}</li>                
-                <li py:if="h.am_authorized(c, actions.PACKAGE_CREATE)">${h.nav_link(c, _('Register a new Package'), controller='package', action='new', id=None)}</li>
+                <li py:if="am_authorized_package_create">${h.nav_link(c, _('Register a new Package'), controller='package', action='new', id=None)}</li><li>${h.nav_link(c, _('Revision History'), controller='revision', action='index', id=None)}</li><li>${h.link_to(_('API'), h.url_for(controller='api', action='get_api', id=None))}</li><li>${h.link_to(_('API Docs'), 'http://wiki.ckan.net/API')}</li>
+<?python
+  from pylons import config
+  dumps_url = config.get('ckan.dumps_url')
+  dumps_format = config.get('ckan.dumps_format', '')
+?>
+                <li py:if="dumps_url">${h.link_to(_('Full %s dump') % dumps_format, dumps_url)}</li></ul></div></li>


--- a/ckan/templates/package/search.html	Fri May 27 10:43:44 2011 +0100
+++ b/ckan/templates/package/search.html	Mon May 30 12:15:41 2011 +0100
@@ -25,6 +25,22 @@
     ${facet_sidebar('res_format')}
     ${facet_sidebar('license')}
 
+    <li class="widget-container widget_text">
+        <h4>Other access</h4>
+<?python
+  from pylons import config
+  dumps_url = config.get('ckan.dumps_url')
+  dumps_format = config.get('ckan.dumps_format', '')
+?>
+        <p>
+            You can also access this registry using the 
+            ${h.link_to(_('API'), h.url_for(controller='api', action='get_api', id=None))}
+            (see ${h.link_to(_('API Docs'), 'http://wiki.ckan.net/API')})<py:if test="dumps_url">
+                or download a <a href="${dumps_url}">full ${dumps_format} 
+                dump</a></py:if>.
+        </p>
+    </li>
+ 
   </py:match><div py:match="content">


--- a/doc/configuration.rst	Fri May 27 10:43:44 2011 +0100
+++ b/doc/configuration.rst	Mon May 30 12:15:41 2011 +0100
@@ -335,6 +335,7 @@
 API is hosted on a different domain, for example when a third party site uses
 the forms API.
 
+
 default_roles
 -------------
 
@@ -360,3 +361,14 @@
   ckan.plugins = disqus synchronous_search datapreview googleanalytics stats storage admin follower
 
 Specify which CKAN extensions are to be enabled. If you specify an extension but have not installed the code then CKAN will not start. Format in a space separated list of the extension names. The extension name is the key in the [ckan.plugins] section of the extension's setup.py.
+
+
+dumps_url & dumps_format
+------------------------
+
+Example::
+
+  ckan.dumps_url = http://ckan.net/dump/
+  ckan.dumps_format = CSV/JSON
+
+If there is a page which allows you to download a dump of the entire catalogue then specify the URL and the format here, so that it can be advertised in the web interface. The dumps_format is just a string for display.
\ No newline at end of file

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list