autoupdate
--- a/admin/autoupdate.py
+++ b/admin/autoupdate.py
@@ -1,3 +1,16 @@
+#!/usr/bin/python
+# coding=utf-8
+'''
+auto update batch job for ckan
+<alex.sadleir@linkdigital.com.au>
+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/templates/header.html
+++ b/ckanext/datagovau/templates/header.html
@@ -1,41 +1,4 @@
{% ckan_extends %}
-
-{% block header_account_logged %}
-{% if c.userobj.sysadmin %}
-<li>
- <a href="{{ h.url_for(controller='admin', action='index') }}" title="{{ _('Sysadmin settings') }}">
- <i class="icon-legal"> Sysadmin settings</i>
- </a>
-</li>
-{% endif %}
-<li>
- <a href="{{ h.url_for(controller='user', action='read', id=c.userobj.name) }}" class="image" title="{{ _('View profile') }}">
- {{ h.gravatar((c.userobj.email_hash if c and c.userobj else ''), size=22) }}
- <span class="username">{{ c.userobj.display_name }}</span>
- </a>
-</li>
-{% set new_activities = h.new_activities() %}
-<li class="notifications {% if new_activities > 0 %}notifications-important{% endif %}">
- {% set notifications_tooltip = ngettext('Dashboard (%(num)d new item)', 'Dashboard (%(num)d new items)', new_activities) %}
- <a href="{{ h.url_for(controller='user', action='dashboard') }}" title="{{ notifications_tooltip }}">
- <i class="icon-dashboard"> notifications_tooltip</i>
- <span>{{ new_activities }}</span>
- </a>
-</li>
-{% block header_account_settings_link %}
-<li>
- <a href="{{ h.url_for(controller='user', action='edit', id=c.userobj.name) }}" title="{{ _('Edit settings') }}">
- <i class="icon-cog"> Edit settings</i>
- </a>
-</li>
-{% endblock %}
-{% block header_account_log_out_link %}
-<li>
- <a href="{{ h.url_for('/user/_logout') }}" title="{{ _('Log out') }}">
- <i class="icon-signout"> Log out</i>
- </a>
-</li>
-{% endblock %}
{% block header_site_navigation %}
<nav class="section navigation">
--- a/ckanext/datagovau/templates/package/snippets/resource_form.html
+++ b/ckanext/datagovau/templates/package/snippets/resource_form.html
@@ -21,7 +21,7 @@
{% call form.input(field_url, label=url_label, id='field-image-url', placeholder=placeholder, value=data.get(field_url), error=errors.get(field_url), classes=['control-full']) %}
<span id="autoupdate_form">
- {% call form.select('autoupdate', label=_('Generate API from this Link'), options= [{'value': 'active', 'text': 'Active'}, {'value': 'inactive', 'text': 'Inactive'}], selected='Inactive', error=errors.autoupdate) %}
+ {% call form.select('autoupdate', label=_('Generate API from this Link'), options= [{'value': 'active', 'text': 'Active'}, {'value': 'inactive', 'text': 'Inactive'}], selected='Active', error=errors.autoupdate) %}
<br/>
Where a file is compatible with either CKAN or GeoServer we will attempt to make a functional end-point for this resource. The link provided above will also be checked for a new version based on the update frequency as set at the dataset level.
</span>