{# Renders a list of resources with icons and view links. resources - A list of resources (dicts) to render pkg - A package dict that the resources belong to. Example: {% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %} #} {%- set list_class -%} {% block resource_list_class %}resource-list{% endblock %} {%- endset -%}
{{ ui.heading(_('Data and Resources'), level=2) }} {% block resource_list %} {% if resources %} {%- call ui.util.call(ui.resource_list, attrs={"class": list_class} if list_class else {}) -%} {% block resource_list_inner %} {% set can_edit = can_edit or h.check_access('package_update', {'id':pkg.id }) %} {% for resource in resources %} {{ ui.resource(resource=resource, pkg=pkg, can_edit=can_edit) }} {% endfor %} {% endblock %} {%- endcall %} {% else %} {% block resource_list_empty %} {%- call ui.util.call(ui.empty) -%} {% if h.check_access('resource_create', {'package_id': pkg['id']}) %} {% trans url=h.url_for(pkg.type ~ '_resource.new', id=pkg.name) %}This dataset has no data, why not add some?{% endtrans %} {% else %} {{ _('This dataset has no data') }} {% endif %} {%- endcall %} {% endblock %} {% endif %} {% endblock %}