Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: okfn/ckan-barnet
base: bff538b^
...
head fork: okfn/ckan-barnet
compare: d700680
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
3  ckan/public/css/style.css
View
@@ -1149,6 +1149,9 @@ body.package.read h3 {
.dataset-resource p {
margin: 0;
}
+.resource-url-cached {
+ font-size: 0.9em;
+}
body.package.read .resource-information {
color: #808080;
3  ckan/templates/package/read_core.html
View
@@ -31,6 +31,9 @@
<a class="resource-url-analytics" href="${res.get('url', '')}" rel="dcat:accessURL" target="_blank">
${res.get('url', '')}
</a>
+ <a py:if="res.get('cache_url')" class="resource-url-cached" href="${res.get('cache_url')}" target="_blank">
+ [cached]
+ </a>
</p>
</div>
</py:for>
16 ckan/tests/functional/test_package.py
View
@@ -17,6 +17,7 @@
from ckan.lib.create_test_data import CreateTestData
import ckan.lib.helpers as h
import ckan.lib.search as search
+from ckan.logic.action import get, update
from ckan.controllers.package import PackageController
from ckan.plugins import SingletonPlugin, implements, IPackageController
from ckan import plugins
@@ -349,6 +350,21 @@ def test_read_plugin_hook(self):
assert plugin.calls['read'] == 1, plugin.calls
plugins.unload(plugin)
+ def test_resource_list(self):
+ name = 'annakarenina'
+ cache_url = 'http://thedatahub.org/test_cache_url.csv'
+ # add a cache_url to the first resource in the package
+ context = {'model': model, 'session': model.Session, 'user': 'testsysadmin'}
+ data = {'id': 'annakarenina'}
+ pkg = get.package_show(context, data)
+ pkg['resources'][0]['cache_url'] = cache_url
+ update.package_update(context, pkg)
+ # check that the cache url is included on the dataset view page
+ offset = url_for(controller='package', action='read', id=name)
+ res = self.app.get(offset)
+ assert '[cached]'in res
+ assert cache_url in res
+
class TestReadAtRevision(FunctionalTestCase, HtmlCheckMethods):

No commit comments for this range

Something went wrong with that request. Please try again.