Skip to content

Commit

Permalink
add download option from dump functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
tino097 committed Sep 20, 2017
1 parent 15db64b commit b920f68
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ckan/templates/package/resource_read.html
Expand Up @@ -32,6 +32,7 @@
{% endif %}
{% if res.url and h.is_url(res.url) %}
<li>
<div class="btn-group">
<a class="btn btn-primary resource-url-analytics resource-type-{{ res.resource_type }}" href="{{ res.url }}">
{% if res.resource_type in ('listing', 'service') %}
<i class="fa fa-eye"></i> {{ _('View') }}
Expand All @@ -43,6 +44,24 @@
<i class="fa fa-arrow-circle-o-down"></i> {{ _('Download') }}
{% endif %}
</a>
{%if res.url_type == 'upload' and res.datastore_active %}
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id) }}"
target="_blank">CSV</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='tsv') }}"
target="_blank">TSV</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='json') }}"
target="_blank">JSON</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='xml') }}"
target="_blank">XML</a>
</li>
</ul>
{%endif%}
</div>
</li>
{% endif %}
{% endblock %}
Expand Down

0 comments on commit b920f68

Please sign in to comment.