Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #72 from GSA/explore-dropdown-fix
Browse files Browse the repository at this point in the history
Explore Dropdown Fix + Tag List Fix (Released)
  • Loading branch information
btylerburton authored Jul 6, 2023
2 parents 15be31a + 578baad commit f852f86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 48 deletions.
47 changes: 2 additions & 45 deletions ckanext/usmetadata/templates/package/snippets/resource_item.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% ckan_extends %}

{% set can_edit = h.check_access('package_update', {'id':pkg.id }) %}
{% set url_action = 'edit' if url_is_edit and can_edit else 'read' %}
{% set url = h.url_for(controller='resource', action=url_action, id=pkg.name, resource_id=res.id) %}
Expand All @@ -23,49 +25,4 @@
</span>
{% endif %}
</p>
{% block resource_item_explore %}
{% if not url_is_edit %}
<div class="dropdown btn-group">
<a href="#" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="icon-share-alt"></i>
{{ _('Explore') }}
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
{% block resource_item_explore_links %}
<li>
<a href="{{ url }}">
{% if res.can_be_previewed %}
<i class="icon-bar-chart"></i>
{{ _('Preview') }}
{% else %}
<i class="icon-info-sign"></i>
{{ _('More information') }}
{% endif %}
</a>
</li>
<li>
<a href="{{ res.url }}" class="resource-url-analytics" target="_blank">
{% if res.can_be_previewed %}
<i class="icon-download"></i>
{{ _('Download') }}
{% else %}
<i class="icon-external-link"></i>
{{ _('Go to resource') }}
{% endif %}
</a>
</li>
{% if can_edit %}
<li>
<a href="{{ h.url_for(controller='resource', action='edit', id=pkg.name, resource_id=res.id) }}">
<i class="icon-edit"></i>
{{ _('Edit') }}
</a>
</li>
{% endif %}
{% endblock %}
</ul>
</div>
{% endif %}
{% endblock %}
</li>
4 changes: 2 additions & 2 deletions ckanext/usmetadata/templates/snippets/package_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ <h3 class="dataset-heading">
{% endif %}
</div>
{% if package.resources and not hide_resources -%}
<ul class="dataset-resources unstyled">
<ul class="dataset-resources list-unstyled">
{% for resource in h.dict_list_reduce(package.resources, 'format') -%}
<li>
<a href="{{ h.url_for(controller='dataset', action='read', id=package.name) }}" class="label"
<a href="{{ h.url_for(controller='dataset', action='read', id=package.name) }}" class="badge"
data-format="{{ resource.lower() }}">{{ resource }}</a>
</li>
{%- endfor %}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='ckanext-usmetadata',
version='0.3.0',
version='0.3.1',
description='US Metadata Plugin for CKAN',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit f852f86

Please sign in to comment.