diff --git a/ckanext/harvest/fanstatic_library/styles/harvest.css b/ckanext/harvest/fanstatic_library/styles/harvest.css index 5232af3..29d7a84 100644 --- a/ckanext/harvest/fanstatic_library/styles/harvest.css +++ b/ckanext/harvest/fanstatic_library/styles/harvest.css @@ -11,6 +11,9 @@ header.with-filter h1 { text-shadow: none; font-weight: normal; } +[data-diff="error"] { + background-color: #b55457; +} [data-diff="added"] { background-color: #9ee592; } @@ -36,9 +39,8 @@ header.with-filter h1 { .harvest-types label.radio input { top: 3px; } -#source-new .controls { - margin-left: 135px; -} -#source-new .control-label { + +#source-new.bs2 .control-label { width: 125px; -} +-} + diff --git a/ckanext/harvest/helpers.py b/ckanext/harvest/helpers.py index 6cb6ff2..fab9147 100644 --- a/ckanext/harvest/helpers.py +++ b/ckanext/harvest/helpers.py @@ -110,3 +110,12 @@ def harvest_source_extra_fields(): fields[harvester.info()['name']] = harvester.extra_schema().keys() return fields + +def bootstrap_version(): + if p.toolkit.check_ckan_version(max_version='2.7.99'): + return 'bs2' + else: + return ( + 'bs2' if + p.toolkit.config.get('ckan.base_public_folder') == 'public-bs2' + else 'bs3') diff --git a/ckanext/harvest/plugin.py b/ckanext/harvest/plugin.py index 55ab3dd..a197144 100644 --- a/ckanext/harvest/plugin.py +++ b/ckanext/harvest/plugin.py @@ -218,7 +218,7 @@ class Harvest(p.SingletonPlugin, DefaultDatasetForm, DefaultTranslation): # Setup harvest model model_setup() - + # Configure database logger _configure_db_logger(config) @@ -293,6 +293,7 @@ class Harvest(p.SingletonPlugin, DefaultDatasetForm, DefaultTranslation): 'harvest_frequencies': harvest_helpers.harvest_frequencies, 'link_for_harvest_object': harvest_helpers.link_for_harvest_object, 'harvest_source_extra_fields': harvest_helpers.harvest_source_extra_fields, + 'bootstrap_version': harvest_helpers.bootstrap_version, } def dataset_facets(self, facets_dict, package_type): @@ -472,7 +473,7 @@ def _delete_harvest_source_object(context, data_dict): def _configure_db_logger(config): # Log scope - # + # # -1 - do not log to the database # 0 - log everything # 1 - model, logic.action, logic.validators, harvesters @@ -486,16 +487,16 @@ def _configure_db_logger(config): scope = p.toolkit.asint(config.get('ckan.harvest.log_scope', -1)) if scope == -1: return - + parent_logger = 'ckanext.harvest' - children = ['plugin', 'model', 'logic.action.create', 'logic.action.delete', - 'logic.action.get', 'logic.action.patch', 'logic.action.update', + children = ['plugin', 'model', 'logic.action.create', 'logic.action.delete', + 'logic.action.get', 'logic.action.patch', 'logic.action.update', 'logic.validators', 'harvesters.base', 'harvesters.ckanharvester'] - + children_ = {0: children, 1: children[1:], 2: children[1:-2], 3: children[1:-3], 4: children[2:-3], 5: children[1:2], 6: children[:1], 7: children[-2:]} - + # Get log level from config param - default: DEBUG from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL level = config.get('ckan.harvest.log_level', 'debug').upper() @@ -513,7 +514,7 @@ def _configure_db_logger(config): level = DEBUG loggers = children_.get(scope) - + # Get root logger and set db handler logger = getLogger(parent_logger) if scope < 1: diff --git a/ckanext/harvest/templates/snippets/job_details.html b/ckanext/harvest/templates/snippets/job_details.html index a2bf26b..123a4ec 100644 --- a/ckanext/harvest/templates/snippets/job_details.html +++ b/ckanext/harvest/templates/snippets/job_details.html @@ -17,7 +17,7 @@ Example: {% if job.status == 'Finished' %}
-
+
{% if 'errored' in stats and stats['errored'] > 0 %}
{{ stats['errored'] }}
{% else %}
diff --git a/ckanext/harvest/templates/source/admin.html b/ckanext/harvest/templates/source/admin.html
index 95fb681..337b923 100644
--- a/ckanext/harvest/templates/source/admin.html
+++ b/ckanext/harvest/templates/source/admin.html
@@ -6,7 +6,7 @@
{% if source.status and source.status.last_job %}
{% snippet "snippets/job_details.html", job=source.status.last_job %}
- {{ h.nav_link(_('Back to job list'), named_route='harvest_job_list', source=source.name, class_='btn', icon='arrow-left')}}
+ {{ h.nav_link(_('Back to job list'), named_route='harvest_job_list', source=source.name, class_='btn btn-default', icon='arrow-left')}}
{% if 'errored' in job.stats and job.stats['errored'] > 0 %}
{{ _('Job Report') }}
diff --git a/ckanext/harvest/templates/source/new_source_form.html b/ckanext/harvest/templates/source/new_source_form.html
index 6823bfe..5263b0e 100644
--- a/ckanext/harvest/templates/source/new_source_form.html
+++ b/ckanext/harvest/templates/source/new_source_form.html
@@ -1,7 +1,7 @@
{% import 'macros/form.html' as form %}
{% resource 'harvest-extra-field/main' %}
-