From: root Date: Fri, 20 Dec 2013 00:16:03 +0000 Subject: my datasets deduplication X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-datagovau.git&a=commitdiff&h=cd34075c9b61e299ac0ecf54414811429e102e68 --- my datasets deduplication --- --- 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__) --- a/ckanext/datagovau/plugin.py +++ b/ckanext/datagovau/plugin.py @@ -28,8 +28,12 @@ created_datasets_list = user_dict['datasets'] active_datasets_list = [x['data']['package'] for x in lib.helpers.get_action('user_activity_list',{'id':user_dict['id']}) if x['data'].get('package')] - return created_datasets_list + active_datasets_list - + raw_list = created_datasets_list + active_datasets_list + filtered_dict = {} + for dataset in raw_list: + if dataset['id'] not in filtered_dict.keys(): + filtered_dict[dataset['id']] = dataset + return filtered_dict.values() class DataGovAuPlugin(plugins.SingletonPlugin, tk.DefaultDatasetForm): --- /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 %} +