harvester-d4science/ckanext/harvest/templates/index.html

92 lines
4.0 KiB
HTML
Raw Normal View History

2012-08-10 11:00:02 +02:00
{% extends "page.html" %}
{% block title %}{{ _('Harvesting Sources') }} - {{ super() }}{% endblock %}
{% block breadcrumb_content %}
{% endblock %}
2012-08-14 12:04:17 +02:00
{% 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 %}
2012-08-10 11:00:02 +02:00
{% block primary %}
<article class="module">
<div class="module-content">
2015-06-10 13:14:20 +02:00
<h1>{% trans %}Harvesting Sources{% endtrans %}</h1>
2012-08-10 11:00:02 +02:00
{% if c.status %}
<div class="status">
2015-06-10 13:14:20 +02:00
<h3>{{ _('Status') }}:</h3>
2012-08-10 11:00:02 +02:00
{{ h.literal(c.status) }}
</div>
{% endif %}
2015-06-10 13:14:20 +02:00
<div id="new-harvest-source"><a href="harvest/new">{% trans %}Add a harvesting source{% endtrans %}</a></div>
2012-08-10 11:00:02 +02:00
{% if c.sources %}
<div id="show-inactive-sources-content">
2012-08-14 12:04:17 +02:00
<label for="show-inactive-sources">Show inactive sources</label>
2012-08-10 11:00:02 +02:00
<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>
2015-06-10 13:14:20 +02:00
<th class="action">{{ _('View') }}</th>
<th class="action">{{ _('Edit') }}</th>
2016-05-09 13:36:21 +02:00
<th class="action">{{ _('Refresh')}}</th>
2012-08-14 13:02:02 +02:00
<th class="url">URL</th>
2015-06-10 13:14:20 +02:00
{# 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>
2012-08-10 11:00:02 +02:00
</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' }}">
2012-08-14 12:04:17 +02:00
<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>
2012-08-10 11:00:02 +02:00
<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 %}
2015-06-10 13:14:20 +02:00
<div id="no-harvest-sources">{% trans %}No harvest sources defined yet.{% endtrans %}</div>
2012-08-10 11:00:02 +02:00
{% endif %}
</div>
</article>
{% endblock %}
{% block sidebar %}{% endblock %}