diff --git a/changes/231.canada.changes b/changes/231.canada.changes new file mode 100644 index 00000000000..94268f72a01 --- /dev/null +++ b/changes/231.canada.changes @@ -0,0 +1 @@ +Added template blocks to the Resource View template snippet for plugin extending capabilities, namely for iFrame Embedding. diff --git a/ckan/templates/package/snippets/resource_view.html b/ckan/templates/package/snippets/resource_view.html index 84f16e3102f..d0edee677ff 100644 --- a/ckan/templates/package/snippets/resource_view.html +++ b/ckan/templates/package/snippets/resource_view.html @@ -3,16 +3,18 @@ {% block resource_view %}
- {# (canada fork only): rel='noopener noreferrer' #} - {# (canada fork only): non-qualified URIs #} - - - {{ _("Fullscreen") }} - - {# (canada fork only): remove embed dur to X-Frame-Options:SAMEORIGIN #} + {# (canada fork only): jinja-block embed due to X-Frame-Options:SAMEORIGIN #} + {% block resource_view_actions %} + {# (canada fork only): rel='noopener noreferrer' #} + {# (canada fork only): non-qualified URIs #} + + + {{ _("Fullscreen") }} + + {% endblock %}
{% block description %}

{{ h.render_markdown(resource_view['description']) }}

@@ -55,7 +57,7 @@ {% endif %} {% else %} {# When previewing we need to stick the whole resource_view as a param as there is no other way to pass to information on to the iframe #} - {# (canada fork only): non-qualified URIs #} + {# (canada fork only): non-qualified URIs #} {% set src = h.url_for(package['type'] ~ '_resource.view', id=package['name'], resource_id=resource['id'], qualified=false) + '?' + h.urlencode({'resource_view': h.dump_json(resource_view)}) %} {% endif %} {# add lazy loading via data-viewer module (canada fork only) TODO: upstream contribution?? #} @@ -64,6 +66,7 @@ {% endif %}
- {# (canada fork only): remove embed dur to X-Frame-Options:SAMEORIGIN #} + {# (canada fork only): jinja-block embed due to X-Frame-Options:SAMEORIGIN #} + {% block resource_view_bottom %}{% endblock %} {% endblock %}