Skip to content

Commit

Permalink
add download selection for bootstrap2
Browse files Browse the repository at this point in the history
  • Loading branch information
tino097 committed Nov 2, 2017
1 parent 287f83d commit 448be7e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ckan/templates-bs2/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,31 @@
<i class="fa fa-arrow-circle-o-down"></i> {{ _('Download') }}
{% endif %}
</a>
{% block download_resource_button %} {%if 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, bom=True) }}"
target="_blank">
<span>CSV</span>
</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='tsv', bom=True) }}"
target="_blank">
<span>TSV</span>
</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='json') }}"
target="_blank">
<span>JSON</span>
</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='xml') }}"
target="_blank">
<span>XML</span>
</a>
</li>
</ul>
{%endif%} {% endblock %}
</li>
{% endif %}
{% endblock %}
Expand Down

0 comments on commit 448be7e

Please sign in to comment.