92 lines
4.0 KiB
HTML
92 lines
4.0 KiB
HTML
{% extends "page.html" %}
|
|
|
|
{% block title %}{{ _('Harvesting Sources') }} - {{ super() }}{% endblock %}
|
|
|
|
{% block breadcrumb_content %}
|
|
{% endblock %}
|
|
|
|
{% block styles %}
|
|
{{ super() }}
|
|
<link type="text/css" rel="stylesheet" media="all" href="/ckanext/harvest/style.css" />
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
{{ super() }}
|
|
<script>$("#show-inactive-sources").click(function(){$("#harvest-sources .inactive").toggle()});</script>
|
|
{% endblock %}
|
|
|
|
{% block primary %}
|
|
<article class="module">
|
|
<div class="module-content">
|
|
<h1>{% trans %}Harvesting Sources{% endtrans %}</h1>
|
|
{% if c.status %}
|
|
<div class="status">
|
|
<h3>{{ _('Status') }}:</h3>
|
|
{{ h.literal(c.status) }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div id="new-harvest-source"><a href="harvest/new">{% trans %}Add a harvesting source{% endtrans %}</a></div>
|
|
|
|
{% if c.sources %}
|
|
<div id="show-inactive-sources-content">
|
|
<label for="show-inactive-sources">Show inactive sources</label>
|
|
<input type="checkbox" id="show-inactive-sources" />
|
|
</div>
|
|
|
|
<table id="harvest-sources" class="table table-bordered table-condensed ${'publishers' if c.publisher_auth else ''}" >
|
|
<tr>
|
|
<th class="action">{{ _('View') }}</th>
|
|
<th class="action">{{ _('Edit') }}</th>
|
|
<th class="action">{{ _('Refresh')}}</th>
|
|
<th class="url">URL</th>
|
|
{# TRANSLATORS: Appears in harvest source table for the type of harvester #}
|
|
<th>{{ _('Type')}}</th>
|
|
{# TRANSLATORS: Appears in harvest source table 'is Active' #}
|
|
<th>{{ _('Active')}}</th>
|
|
<th>{{ _('Statistics') }}</th>
|
|
{# TRANSLATORS: Appears in harvest source table 'date of next harvest #}
|
|
<th>{{ _('Next Harvest') }}</th>
|
|
{# TRANSLATORS: Appears in harvest source table date created #}
|
|
<th>{{ _('Created') }}</th>
|
|
</tr>
|
|
{% set old_publisher = None %}
|
|
{% for source in c.sources %}
|
|
{% if c.publisher_auth and old_publisher != source['publisher_id'] %}
|
|
<tr class="publisher">
|
|
{% if source.get('publisher_title') %}
|
|
<td colspan="9">{{ source['publisher_title'] }}</td>
|
|
{% else %}
|
|
<td colspan="9">{{ source['publisher_id'] }}</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endif %}
|
|
{% set old_publisher = source['publisher_id'] %}
|
|
<tr class="{{ 'active' if source.active else 'inactive' }}">
|
|
<td class="action"><a href="harvest/{{ source.id }}"><img src="ckanext/harvest/images/icons/source_view.png" alt="View" title="View" /></a></td>
|
|
<td class="action"><a href="harvest/edit/{{ source.id }}"><img src="ckanext/harvest/images/icons/source_edit.png" alt="Edit" title="Edit" /></a></td>
|
|
<td class="action"><a href="harvest/refresh/{{ source.id }}"><img src="ckanext/harvest/images/icons/source_refresh.png" alt="Refresh" title="Refresh" /></a></td>
|
|
<td title="{{ source.url }}">{{ source.url | truncate(50) }}</td>
|
|
<td>{{ source.type }}</td>
|
|
<td class="state">{{ source.active }}</td>
|
|
{% if 'msg' in source.status %}
|
|
<td>{{ source.status.msg }}</td>
|
|
<td>{{ source.status.msg }}</td>
|
|
{% else %}
|
|
<td>Datasets: <a href="harvest/{{ source.id }}#datasets">{{ source.status.overall_statistics.added }}</a><br/>
|
|
Last errors: <a href="harvest/{{ source.id }}#errors">{{ source.status.last_harvest_statistics.errors }}</a></td>
|
|
<td>{{ source.status.next_harvest }}</td>
|
|
{% endif %}
|
|
<td>{{ h.render_datetime(source.created) }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% else %}
|
|
<div id="no-harvest-sources">{% trans %}No harvest sources defined yet.{% endtrans %}</div>
|
|
{% endif %}
|
|
</div>
|
|
</article>
|
|
{% endblock %}
|
|
|
|
{% block sidebar %}{% endblock %}
|