Skip to content

Commit

Permalink
Show latest api docs when not release version
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Mar 6, 2013
1 parent e7bc39e commit a4c5be4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ckan/lib/app_globals.py
Expand Up @@ -177,6 +177,10 @@ def _init(self):

self.ckan_version = ckan.__version__
self.ckan_base_version = re.sub('[^0-9\.]', '', self.ckan_version)
if self.ckan_base_version == self.ckan_version:
self.ckan_doc_version = 'ckan-{0}'.format(self.ckan_version)
else:
self.ckan_doc_version = 'latest'

# process the config_details to set globals
for name, options in config_details.items():
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/footer.html
Expand Up @@ -5,7 +5,7 @@
{% block footer_nav %}
<ul class="unstyled row-fluid">
{% block footer_links %}
{% set api_url = 'http://docs.ckan.org/{0}/ckan-{1}/api.html'.format(request.environ.CKAN_LANG, g.ckan_base_version) %}
{% set api_url = 'http://docs.ckan.org/{0}/{1}/api.html'.format(request.environ.CKAN_LANG, g.ckan_doc_version) %}
<li><a href="{{ h.url_for(controller='home', action='about') }}">{{ _('About {0}'.format( g.site_title)) }}</a></li>
<li><a href="{{ api_url }}">{{ _('CKAN API') }}</a></li>
<li><a href="http://www.opendefinition.org/okd/"><img src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png"></a></li>
Expand Down

0 comments on commit a4c5be4

Please sign in to comment.