From: Alex Sadleir Date: Thu, 05 Jun 2014 05:49:26 +0000 Subject: Merge branch 'master' of git+ssh://maxious.lambdacomplex.org/git/ckanext-datagovau X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-datagovau.git&a=commitdiff&h=201f2c6b0e1b908b77ba82803d341146d81cbbfc --- Merge branch 'master' of git+ssh://maxious.lambdacomplex.org/git/ckanext-datagovau --- --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,9 +1,94 @@ + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + + + + + + + --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,36 +1,14 @@ - - - - - - - - - - + + + - - - - - - - - - - - - - - - - + - - - + + @@ -91,37 +68,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -130,7 +81,8 @@ - + + @@ -139,16 +91,8 @@ - - - - - - - - - - + + @@ -157,7 +101,8 @@ - + + @@ -166,7 +111,18 @@ - + + + + + + + + + + + + @@ -207,14 +163,16 @@ + - @@ -230,7 +188,7 @@ - + @@ -242,7 +200,6 @@ - @@ -271,7 +228,7 @@ @@ -288,6 +245,10 @@ + - + + - - - - - - + - - - - - + + - - @@ -478,6 +429,8 @@ - - - @@ -605,16 +553,16 @@ - - + + - + - - + + @@ -622,170 +570,143 @@ + + + - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + - - + + - - - - - - - - + + - - + + - + + - - - - - - - - - - - - - - - + + - + + - - - - - - - - + + + + + + + + + + --- a/admin/autoupdate.py +++ b/admin/autoupdate.py @@ -1,3 +1,16 @@ +#!/usr/bin/python +# coding=utf-8 +''' +auto update batch job for ckan + +1.0 26/05/2014 initial implementation + +TODO +- archive files in filestore +- update frequency reduced based on dataset metadata +- emails on HTTP errors +''' + import requests import ckanapi import csv @@ -57,6 +70,8 @@ datastore_db_settings['dbname'] = db_settings['datastore_dbname'] datastore_db_settings_json = json.dumps(datastore_db_settings) +#until https://github.com/ckan/ckan/pull/1732 is merged, use database directly + try: conn = psycopg2.connect(dbname=db_settings['dbname'], user=db_settings['user'], password=db_settings['password'], host=db_settings['host']) except: --- a/ckanext-datagovau.iml +++ b/ckanext-datagovau.iml @@ -2,9 +2,7 @@ - - - + --- a/ckanext/datagovau/__init__.py +++ b/ckanext/datagovau/__init__.py @@ -1,1 +1,8 @@ +# this is a namespace package +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) --- a/ckanext/datagovau/plugin.py +++ b/ckanext/datagovau/plugin.py @@ -24,7 +24,7 @@ def get_related_dataset(related_id): result = model.Session.execute("select dataset_id from related_dataset where related_id =\'"+related_id+"\' limit 1;").first()[0] - return lib.helpers.get_action('package_show',{'id':result}) + return result def related_create(context, data_dict=None): return {'success': False, 'msg': 'No one is allowed to create related items'} --- a/ckanext/datagovau/templates/header.html +++ b/ckanext/datagovau/templates/header.html @@ -1,4 +1,42 @@ {% ckan_extends %} + +{% block header_account_logged %} +{% if c.userobj.sysadmin %} +
  • + + Sysadmin settings + +
  • +{% endif %} +
  • + + {{ h.gravatar((c.userobj.email_hash if c and c.userobj else ''), size=22) }} + {{ c.userobj.display_name }} + +
  • +{% set new_activities = h.new_activities() %} +
  • + {% set notifications_tooltip = ngettext('Dashboard (%(num)d new item)', 'Dashboard (%(num)d new items)', new_activities) %} + + Dashboard + {{ new_activities }} + +
  • +{% block header_account_settings_link %} +
  • + + Edit settings + +
  • +{% endblock %} +{% block header_account_log_out_link %} +
  • + + Log out + +
  • +{% endblock %} +{% endblock %} {% block header_site_navigation %}