Skip to content

Commit

Permalink
Merge pull request #42 from liip/fix/fix-harvester-job-details
Browse files Browse the repository at this point in the history
Fix/fix harvester job details
  • Loading branch information
bellisk authored Jan 25, 2024
2 parents 205090a + acaa0bc commit 071aba2
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 10 deletions.
1 change: 1 addition & 0 deletions ckanext/switzerland/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
and in odpch-wp-theme/style.css #}
<link rel="stylesheet" href="{{ c.wordpress_css }}">
{% asset 'ckanext-activity/activity-css' %}
{% asset 'ckanext-harvest/harvest_css' %}
{% endblock %}

{% block title %}
Expand Down
12 changes: 2 additions & 10 deletions ckanext/switzerland/templates/snippets/job_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

{% if job.status == 'Finished' %}
<p class="harvester-labels">
<span class="label label-danger" data-diff="error">
<span class="label label-important" data-diff="error">
{% if 'errored' in stats and stats['errored'] > 0 %}
{{ stats['errored'] }}
{% else %}
Expand All @@ -26,15 +26,7 @@
{{ _('errors') }}
</span>
{% for action in ['added', 'updated', 'deleted', 'not modified'] %}
{% if "deleted" == action %}
<span class="label label-warning" data-diff="{{ action }}">
{% elif "added" == action %}
<span class="label label-success" data-diff="{{ action }}">
{% elif "updated" == action %}
<span class="label label-info" data-diff="{{ action }}">
{% else %}
<span class="label label-default" data-diff="{{ action }}">
{% endif %}
<span class="label" data-diff="{{ action }}">
{% if action in stats and stats[action] > 0 %}
{{ stats[action] }}
{% else %}
Expand Down
67 changes: 67 additions & 0 deletions ckanext/switzerland/templates/source/job/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{% extends "source/admin_base.html" %}


{% block subtitle %}{{ _('Harvest Jobs')}} - {{ super() }}{% endblock %}

{% block primary_content_inner %}
<div class="module-content">

<h1 class="results">{{ _('Harvest Jobs') }}</h1>

{% if jobs|length == 0 %}
<p class="empty">{{ _('No jobs yet for this source') }}</p>
{% else %}
<ul class="dataset-list unstyled">
{% for job in jobs %}
<li class="dataset-item">
<div class="dataset-content">
<h3 class="dataset-heading">
<a href="{{ h.url_for('harvester.job_show', source=harvest_source.name, id=job.id) }}">
{{ _('Job: ') }} {{ job.id }}
</a>
{% if job.status != 'Finished' %}
<span class="label">{{ job.status }}</span>
{% endif %}
</h3>
<p>
{{ _('Started:') }}
<span class="automatic-local-datetime" data-datetime="{{ h.render_datetime(job.gather_started, date_format='%Y-%m-%dT%H:%M:%S%z') }}">
{{ h.render_datetime(job.gather_started, with_hours=True) or _('Not yet') }}
</span>
&mdash;
{{ _('Finished:') }}
<span class="automatic-local-datetime" data-datetime="{{ h.render_datetime(job.finished, date_format='%Y-%m-%dT%H:%M:%S%z') }}">
{{ h.render_datetime(job.finished, with_hours=True) or _('Not yet') }}
</span>
</p>
</div>
{% if job.status == 'Finished' %}
<ul class="dataset-resources harvester-labels unstyled">
{% if 'errored' in job.stats and job.stats['errored'] > 0 %}
<li>
<span class="label label-important" data-diff="error">
{{ job.stats['errored'] }} {{ _('errors') }}
</span>
</li>
{% endif %}
{% for action in ['added', 'updated', 'deleted', 'not modified'] %}
<li>
<span class="label" data-diff="{{ action }}" title="{{ _(action) }}">
{% if action in job.stats and job.stats[action] > 0 %}
{{ job.stats[action] }}
{% else %}
0
{% endif %}
{{ _(action) }}
</span>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}

</div>
{% endblock %}

0 comments on commit 071aba2

Please sign in to comment.