{% ckan_extends %}

{% block resources %}
  {% if package.resources and not hide_resources %}
    {% block resources_outer %}
      <ul class="dataset-resources list-unstyled">
        {% block resources_inner %}
          {% for resource in h.dict_list_reduce(package.resources, 'format') %}
          <li>
            <a href="{{ h.url_for(controller='package', action='read', id=package.name) }}" class="label label-default" data-format="{{ resource.lower() }}">{{ resource }}</a>
          </li>
          {% endfor %}
        {% endblock %}
      </ul>
      
      {# JUST adds a div in case we will preview a resource #}
      {% if h.package_preview(package) %}
      <div id="chart_div_{{ package.name }}"></div>
      {% endif %}

    {% endblock %}
  {% endif %}
{% endblock %}
