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/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/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.
+ +