From: CKAN data.gov.au Date: Wed, 04 Dec 2013 00:44:01 +0000 Subject: Add embed hint to datapreviews X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-datagovau.git&a=commitdiff&h=e2d9caa5d42d30433cd2b0da5613ca12b6971861 --- Add embed hint to datapreviews --- --- a/README.rst +++ b/README.rst @@ -4,9 +4,11 @@ * A CKAN Extension "plugin" at ``ckanext/datagovau/plugin.py`` which, when loaded, overrides various settings in the core ``ini``-file to provide: - * A path to local customisations of the core templates + * A path to local customisations of the core templates to include AGLS/Dublin Core minimum metadata * A custom Package edit form that defaults to cc-by licence * A custom n3/rdf output format + * Replaces links with http/https protocol independent versions + * Provides HTML to users to embed data previews on their own website * A cut down licenses.json file --- a/ckanext/datagovau/controller.py +++ b/ckanext/datagovau/controller.py @@ -7,6 +7,8 @@ import threading from ckan.common import _, c, request, response from pylons import config +from webob.multidict import UnicodeMultiDict +from paste.util.multidict import MultiDict log = logging.getLogger(__name__) --- /dev/null +++ b/ckanext/datagovau/templates/base.html @@ -1,1 +1,7 @@ +{% ckan_extends %} + {% block meta %} + {{ super() }} + + {% endblock %} + --- /dev/null +++ b/ckanext/datagovau/templates/dataviewer/base.html @@ -1,1 +1,11 @@ +{% ckan_extends %} +{% block scripts %} + {{ super() }} + +{% endblock %} + + --- /dev/null +++ b/ckanext/datagovau/templates/dataviewer/snippets/data_preview.html @@ -1,1 +1,32 @@ +
+ {% if embed %} + {# images can be embedded directly #} + + {% else %} +
+

+ + {{ _('This resource can not be previewed at the moment.') }} + + {{ _('Click here for more information.') }} + +

+

+

+ + + {{ _('Download resource') }} + +

+
+ + {% endif %} +
+
+

Embed this visualisation in your own website...

+Copy the HTML in the box below and you can display this visualisation on your own website.
+ +
--- a/ckanext/datagovau/templates/package/read.html +++ b/ckanext/datagovau/templates/package/read.html @@ -1,7 +1,6 @@ {% ckan_extends %} {% block primary_content_inner %} {{ super() }} -
{{ h.disqus_comments() }}
@@ -128,3 +127,13 @@ {% endblock %} +{% block secondary_content %} + {{ super() }} + + {% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %} + {% if dataset_extent %} + {% snippet "spatial/snippets/dataset_map_sidebar.html", extent=dataset_extent %} + {% endif %} + +{% endblock %} + --- /dev/null +++ b/ckanext/datagovau/templates/package/search.html @@ -1,1 +1,7 @@ +{% ckan_extends %} +{% block secondary_content %} +{{ super() }} + {% snippet "spatial/snippets/spatial_query.html", default_extent="[[-11, 114], [-42, 154]]" %} +{% endblock %} +