Skip to content

Commit

Permalink
style->preview_type
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Sep 28, 2012
1 parent a50f999 commit 8b0975d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ckan/config/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def make_map():
action='resource_embedded_dataviewer')
m.connect('/dataset/{id}/resource/{resource_id}/viewer',
action='resource_embedded_dataviewer', width="960", height="800")
m.connect('/dataset/{id}/resource/{resource_id}/datapreview/{style}',
m.connect('/dataset/{id}/resource/{resource_id}/preview/{preview_type}',
action='resource_datapreview')

# group
Expand Down
4 changes: 2 additions & 2 deletions ckan/controllers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ def _parse_recline_state(self, params):
recline_state.pop(k)
return recline_state

def resource_datapreview(self, id, resource_id, style):
def resource_datapreview(self, id, resource_id, preview_type):
'''
Embeded page for a resource data-preview.
'''
Expand All @@ -1295,4 +1295,4 @@ def resource_datapreview(self, id, resource_id, style):
abort(404, _('Resource not found'))
except NotAuthorized:
abort(401, _('Unauthorized to read resource %s') % id)
return render('dataviewer/{style}.html'.format(style=style))
return render('dataviewer/{type}.html'.format(type=preview_type))
6 changes: 3 additions & 3 deletions ckan/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,13 +1354,13 @@ def resource_preview(resource, pkg_id):

if resource.get('datastore_active') or format_lower in ['csv', 'xls', 'tsv']:
url = url_for(controller='package', action='resource_datapreview',
resource_id=resource['id'], style='recline', id=pkg_id, qualified=True)
resource_id=resource['id'], preview_type='recline', id=pkg_id, qualified=True)
elif format_lower in PDF:
url = url_for(controller='package', action='resource_datapreview',
resource_id=resource['id'], style='pdf', id=pkg_id, qualified=True)
resource_id=resource['id'], preview_type='pdf', id=pkg_id, qualified=True)
elif format_lower == 'jsonp':
url = url_for(controller='package', action='resource_datapreview',
resource_id=resource['id'], style='json', id=pkg_id, qualified=True)
resource_id=resource['id'], preview_type='json', id=pkg_id, qualified=True)
elif format_lower in LOADABLE:
url = resource['url']
elif format_lower in DIRECT_EMBEDS:
Expand Down

0 comments on commit 8b0975d

Please sign in to comment.