Skip to content

Commit

Permalink
Revert "[#2888] first attempt and datapreview on its own"
Browse files Browse the repository at this point in the history
This reverts commit 2e491fd.
  • Loading branch information
kindly committed Aug 23, 2012
1 parent 2e491fd commit 7458492
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 107 deletions.
3 changes: 0 additions & 3 deletions ckan/config/routing.py
Expand Up @@ -194,9 +194,6 @@ def make_map():
)
m.connect('/dataset/{id}.{format}', action='read')
m.connect('/dataset/{id}', action='read')

m.connect('/datapreview/{resource_id}', action='data_preview')

m.connect('/dataset/{id}/resource/{resource_id}',
action='resource_read')
m.connect('/dataset/{id}/resource/{resource_id}/download',
Expand Down
15 changes: 0 additions & 15 deletions ckan/controllers/package.py
Expand Up @@ -794,21 +794,6 @@ def resource_read(self, id, resource_id):
c.related_count = c.pkg.related_count
return render('package/resource_read.html')

def data_preview(self, resource_id):
context = {'model': model, 'session': model.Session,
'user': c.user or c.author}

try:
c.resource = get_action('resource_show')(context,
{'id': resource_id})
c.resource_json = json.dumps(c.resource)
c.pkg_dict = c.package
except NotFound:
abort(404, _('Resource not found'))
except NotAuthorized:
abort(401, _('Unauthorized to read resource %s') % id)
return render('package/datapreview.html')

def resource_download(self, id, resource_id):
"""
Provides a direct download by redirecting the user to the url stored
Expand Down
5 changes: 0 additions & 5 deletions ckan/public/scripts/application.js
Expand Up @@ -46,11 +46,6 @@ CKAN.Utils = CKAN.Utils || {};
CKAN.DataPreview.loadPreviewDialog(preload_resource);
}

var isResourceViewNew = $('#ckanext-datapreview').length > 0;
if (isResourceViewNew) {
CKAN.DataPreview.loadPreviewDialog(preload_resource);
}

var isEmbededDataviewer = $('body.package.resource_embedded_dataviewer').length > 0;
if (isEmbededDataviewer) {
CKAN.DataPreview.loadEmbeddedPreview(preload_resource, reclineState);
Expand Down
57 changes: 0 additions & 57 deletions ckan/templates/package/datapreview.html

This file was deleted.

27 changes: 0 additions & 27 deletions ckanext/datastore/tests/test_datastore.py
Expand Up @@ -575,33 +575,6 @@ def test_search_limit(self):
assert result['total'] == 2
assert result['records'] == [self.expected_records[0]]


data = {'resource_id': self.data['resource_id'],
'limit': 0}
postparams = '%s=1' % json.dumps(data)
auth = {'Authorization': str(self.sysadmin_user.apikey)}
res = self.app.post('/api/action/datastore_search', params=postparams,
extra_environ=auth)
res_dict = json.loads(res.body)
assert res_dict['success'] is True
result = res_dict['result']
assert result['total'] == 2
assert result['records'] == []

#filter returns no results with 0 limit
data = {'resource_id': self.data['resource_id'],
'limit': 0,
'filters': {u'b\xfck': 'annakar'}}
postparams = '%s=1' % json.dumps(data)
auth = {'Authorization': str(self.sysadmin_user.apikey)}
res = self.app.post('/api/action/datastore_search', params=postparams,
extra_environ=auth)
res_dict = json.loads(res.body)
assert res_dict['success'] is True
result = res_dict['result']
assert result['total'] == 0
assert result['records'] == []

def test_search_invalid_limit(self):
data = {'resource_id': self.data['resource_id'],
'limit': 'bad'}
Expand Down

0 comments on commit 7458492

Please sign in to comment.