{#
Displays a sidebar module with navigation containing the provided resources.
If no resources are provided then the module will not be displayed.
pkg - The package dict that owns the resources.
active - The id of the currently displayed resource.
action - The resource action to use (default: 'read', meaning route 'resource.read').
Example:
{% snippet "package/snippets/resources.html", pkg=pkg, active=res.id %}
#}
{% set resources = pkg.resources or [] %}
{% set can_edit = pkg and h.check_access('package_update', {'id':pkg.id }) %}
{% if pkg and resources %}
{% block resources %}
{{ _("Resources") }}
{% endblock %}
{% block resources_list %}
{% for resource in resources %}
{% set url = h.url_for('%s_resource.read' % pkg.type, id=pkg.name, resource_id=resource.id) %}
{% if active == resource.id %}
{% endblock %}
{% endblock %}
{% elif can_edit %}
{% else %}
{% endif %}
{% endfor %}