Skip to content

Commit

Permalink
change download button text to 'Download Preview' for streaming resou…
Browse files Browse the repository at this point in the history
…rces
  • Loading branch information
aymanizz committed Sep 27, 2024
1 parent 2bfee69 commit 3f6db43
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion ckanext/smdh/templates/package/resource_read.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,49 @@
{% ckan_extends %}

{% block resource_actions_inner %}
{{ super() }}
{% if h.check_access('package_update', {'id':pkg.id }) and not is_activity_archive %}
<li>{% link_for _('Manage'), named_route=pkg.type ~ '_resource.edit', id=pkg.name, resource_id=res.id, class_='btn
btn-default', icon='wrench' %}</li>
{% 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') }}
{% elif res.resource_type == 'api' %}
<i class="fa fa-key"></i> {{ _('API Endpoint') }}
{% elif not res.has_views and not res.url_type == 'upload' %}
<i class="fa fa-external-link"></i> {{ _('Go to resource') }}
{% elif not h.is_stream_resource(res) %}
<i class="fa fa-arrow-circle-o-down"></i> {{ _('Download') }}
{% else %}
<i class="fa fa-arrow-circle-o-down"></i> Download Preview
{% 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('datastore.dump', resource_id=res.id, bom=True) }}"
target="_blank"><span>CSV</span></a>
<a href="{{ h.url_for('datastore.dump', resource_id=res.id, format='tsv', bom=True) }}"
target="_blank"><span>TSV</span></a>
<a href="{{ h.url_for('datastore.dump', resource_id=res.id, format='json') }}"
target="_blank"><span>JSON</span></a>
<a href="{{ h.url_for('datastore.dump', resource_id=res.id, format='xml') }}"
target="_blank"><span>XML</span></a>
</li>
</ul>
{% endif %}
{% endblock %}
</div>
</li>
{% endif %}

{% if h.check_access('package_update', {'id':pkg.id }) and not is_activity_archive %}
<li>
{% set loading_text = _('Loading...') %}
Expand Down

0 comments on commit 3f6db43

Please sign in to comment.