From 450b4bf68abb8bf7c0159ab077bdd46833b149f8 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:35:50 +0200 Subject: [PATCH] Update ckanext-harvest patch - Improve harvest panel --- ...s.patch => 00_improve_harvest_panel.patch} | 54 ++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) rename ckan/patches/ckanext-harvest/{00_translates.patch => 00_improve_harvest_panel.patch} (63%) diff --git a/ckan/patches/ckanext-harvest/00_translates.patch b/ckan/patches/ckanext-harvest/00_improve_harvest_panel.patch similarity index 63% rename from ckan/patches/ckanext-harvest/00_translates.patch rename to ckan/patches/ckanext-harvest/00_improve_harvest_panel.patch index 83d1fce..da31dde 100644 --- a/ckan/patches/ckanext-harvest/00_translates.patch +++ b/ckan/patches/ckanext-harvest/00_improve_harvest_panel.patch @@ -1,5 +1,30 @@ +diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py +index 7dce1f5..ac4db4f 100644 +--- a/ckanext/harvest/logic/action/update.py ++++ b/ckanext/harvest/logic/action/update.py +@@ -706,7 +706,7 @@ def harvest_jobs_run(context, data_dict): + notify_all = toolkit.asbool(config.get('ckan.harvest.status_mail.all')) + notify_errors = toolkit.asbool(config.get('ckan.harvest.status_mail.errored')) + last_job_errors = status['last_job']['stats'].get('errored', 0) +- log.debug('Notifications: All:{} On error:{} Errors:{}'.format(notify_all, notify_errors, last_job_errors)) ++ log.debug('Notifications: All:{} On error:{} Errors:{} Errordict:{}'.format(notify_all, notify_errors, last_job_errors, status['last_job']['stats'])) + + if last_job_errors > 0 and (notify_all or notify_errors): + send_error_email(context, job_obj.source.id, status) +diff --git a/ckanext/harvest/templates/snippets/source_item.html b/ckanext/harvest/templates/snippets/source_item.html +index a8ba26f..3f50bdb 100644 +--- a/ckanext/harvest/templates/snippets/source_item.html ++++ b/ckanext/harvest/templates/snippets/source_item.html +@@ -48,6 +48,7 @@ Example: + {% endif %} + {% if not within_organization and source.organization %} + — {{ _('Organization') }}: {{ h.link_to(source.organization.title or source.organization.name, h.url_for('organization.read', id=source.organization.name)) }} ++ — {{ _('Datasets') }}: {{ h.link_to(h.schemingdcat_package_count_for_source(source.id), url) }} + {% endif %} +

+ diff --git a/ckanext/harvest/templates/source/new.html b/ckanext/harvest/templates/source/new.html -index b7feb3d..b773a44 100644 +index b7feb3d..b1fe472 100644 --- a/ckanext/harvest/templates/source/new.html +++ b/ckanext/harvest/templates/source/new.html @@ -24,12 +24,18 @@ @@ -60,8 +85,33 @@ index 324d012..37358fc 100644 {% endblock extra_config %} {# if we have a default group then this wants remembering #} +diff --git a/ckanext/harvest/templates/source/read.html b/ckanext/harvest/templates/source/read.html +index e016e55..e60a18c 100644 +--- a/ckanext/harvest/templates/source/read.html ++++ b/ckanext/harvest/templates/source/read.html +@@ -3,6 +3,6 @@ + {% block primary_content_inner %} +
+

{{ _('Datasets') }}

+- {{ h.package_list_for_source(harvest_source.id) }} ++ {{ h.schemingdcat_package_list_for_source(harvest_source.id) }} +
+ {% endblock %} +diff --git a/ckanext/harvest/templates/source/read_base.html b/ckanext/harvest/templates/source/read_base.html +index 5126e25..3191c38 100644 +--- a/ckanext/harvest/templates/source/read_base.html ++++ b/ckanext/harvest/templates/source/read_base.html +@@ -15,7 +15,7 @@ +
+
+
{{ _('Datasets') }}
+-
{{ h.package_count_for_source(harvest_source.id) }}
++
{{ h.schemingdcat_package_count_for_source(harvest_source.id) }}
+
+
+ diff --git a/ckanext/harvest/templates/source/search.html b/ckanext/harvest/templates/source/search.html -index d9ceeea..44d118b 100644 +index d9ceeea..f44a0cb 100644 --- a/ckanext/harvest/templates/source/search.html +++ b/ckanext/harvest/templates/source/search.html @@ -44,7 +44,26 @@