From: root Date: Mon, 24 Feb 2014 08:16:13 +0000 Subject: Remove source field which is now available in CKAN 2.2 X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-agls.git&a=commitdiff&h=534c1e3fb365810d2d278113f77ea25d2b417e1b --- Remove source field which is now available in CKAN 2.2 --- --- a/ckanext/agls/plugin.py +++ b/ckanext/agls/plugin.py @@ -10,18 +10,6 @@ from sqlalchemy import orm import ckan.model -#parse the activity feed for last active non-system user -def get_last_active_user(id): - system_user = lib.helpers.get_action('user_show',{'id': config.get('ckan.site_id', 'ckan_site_user')}) - user_list = [x for x in lib.helpers.get_action('package_activity_list',{'id':id}) if x['user_id'] != system_user['id']] - user = None - if len(user_list) > 0: - user = user_list[0].get('user_id', None) - if user is None: - return system_user - else: - return lib.helpers.get_action('user_show',{'id':user}) - class AGLSPlugin(plugins.SingletonPlugin, tk.DefaultDatasetForm): '''An example IDatasetForm CKAN plugin. @@ -31,7 +19,6 @@ ''' plugins.implements(plugins.IConfigurer, inherit=False) plugins.implements(plugins.IDatasetForm, inherit=False) - plugins.implements(plugins.ITemplateHelpers, inherit=False) def update_config(self, config): # Add this plugin's templates dir to CKAN's extra_template_paths, so @@ -44,8 +31,6 @@ tk.add_resource('theme/public', 'ckanext-agls') # config['licenses_group_url'] = 'http://%(ckan.site_url)/licenses.json' - def get_helpers(self): - return {'get_last_active_user': get_last_active_user} def is_fallback(self): # Return True to register this plugin as the default handler for --- a/ckanext/agls/templates/package/read.html +++ b/ckanext/agls/templates/package/read.html @@ -100,13 +100,6 @@ {% endif %} -{% set email =h.get_last_active_user(c.pkg_dict['id']).get('email','') %} - - {{ _('Maintainer') }} - {{ - h.mail_to(email_address=(email or ' '), name=h.get_last_active_user(c.pkg_dict['id']).get("display_name",'')) }} - - Publisher/Agency {{ c.pkg_dict['organization']['title']}} --- a/ckanext/agls/templates/package/read.rdf +++ b/ckanext/agls/templates/package/read.rdf @@ -74,13 +74,6 @@ ${ c.pkg_dict['organization']['title'] } - - - ${h.get_last_active_user(c.pkg_dict['id'])["display_name"]} - - - --- a/ckanext/agls/templates/package/snippets/package_metadata_fields.html +++ b/ckanext/agls/templates/package/snippets/package_metadata_fields.html @@ -9,14 +9,6 @@ {# https://github.com/okfn/ckan/blob/master/ckan/templates/macros/form.html documents the macros for fields #} -{% block package_metadata_fields %} -{{ form.input('url', label=_('Source URL'), id='field-url', -placeholder=_('URL where dataset came from or more information can be obtained'), -value=data.url, error=errors.url, classes=['control-medium']) }} -{{ super() }} - -{% endblock %} - {# hide author/maintainer fields #} {% block package_metadata_author %} {% endblock %}