Skip to content

Commit

Permalink
add data API link to the resource explore links
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanizz committed Sep 27, 2024
1 parent 37cd457 commit 2bfee69
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ckanext/smdh/templates/package/snippets/resource_item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% ckan_extends %}

{% block resource_item_explore_links %}
{{ super() }}
{% if h.check_access('package_update', {'id':pkg.id }) and not is_activity_archive %}
<li>
{% set loading_text = _('Loading...') %}
{% set api_info_url = h.url_for(controller='api', action='snippet', ver=1, snippet_path='api_popup.html',
resource_id=res.id) %}
<a href="{{ api_info_url }}" data-module="api-info"
data-module-template="/api/1/util/snippet/api_popup.html?resource_id={{ res.id }}"
data-loading-text="{{ loading_text }}"><i class="fa fa-flask"></i> {{ _('Data API') }}</a>
</li>
{% endif %}
{% endblock %}

0 comments on commit 2bfee69

Please sign in to comment.