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

95 lines
4.0 KiB
HTML
Raw Normal View History

<html xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip="">
<py:def function="page_title">Harvesting Sources</py:def>
<py:def function="body_class">harvest</py:def>
<py:def function="optional_head">
<link type="text/css" rel="stylesheet" media="all" href="/ckanext/harvest/style.css" />
</py:def>
<py:def function="optional_footer">
<script>$("#show-inactive-sources").click(function(){$("#harvest-sources .inactive").toggle()});</script>
</py:def>
<div py:match="content">
<div class="harvest-content">
<h1>Harvesting Sources</h1>
<div id="new-harvest-source"><a href="harvest/new">Add a harvesting source</a></div>
<py:choose>
<py:when test="c.sources">
<div id="show-inactive-sources-content">
<input type="checkbox" id="show-inactive-sources" />
<label for="show-inactive-sources"> Show inactive sources</label>
</div>
2012-05-09 17:03:03 +02:00
<table id="harvest-sources" class="table table-bordered table-condensed ${'publishers' if c.publisher_auth else ''}" >
<tr>
2011-05-13 18:02:18 +02:00
<th class="action">View</th>
<th class="action">Edit</th>
<th class="action">Refresh</th>
<th>URL</th>
<th>Type</th>
<th>Active</th>
<th>Statistics</th>
<th>Next Harvest</th>
<th>Created</th>
</tr>
<?python old_publisher = None ?>
<py:for each="source in c.sources">
<tr class="publisher" py:if="c.publisher_auth and old_publisher != source['publisher_id']">
<py:choose>
<py:when test="source.get('publisher_title')">
<td colspan="9">${source['publisher_title']}</td>
</py:when>
<py:otherwise>
<td colspan="9">${source['publisher_id']}</td>
</py:otherwise>
</py:choose>
</tr>
<?python old_publisher = source['publisher_id'] ?>
<tr class="${'active' if source.active else 'inactive'}">
<td><a href="harvest/${source.id}"><img src="ckanext/harvest/images/icons/source_view.png" alt="View" title="View" /></a></td>
<td><a href="harvest/edit/${source.id}"><img src="ckanext/harvest/images/icons/source_edit.png" alt="Edit" title="Edit" /></a></td>
<td><a href="harvest/refresh/${source.id}"><img src="ckanext/harvest/images/icons/source_refresh.png" alt="Refresh" title="Refresh" /></a></td>
<py:choose>
<py:when test="source.url and len(source.url)>50">
<td>${source.url[:50]}<span title="${source.url}">...</span></td>
</py:when>
<py:otherwise>
<td>${source.url}</td>
</py:otherwise>
</py:choose>
<td>${source.type}</td>
<td class="state">${source.active}</td>
<py:choose>
<py:when test="'msg' in source.status">
<td>${source.status.msg}</td>
<td>${source.status.msg}</td>
</py:when>
<py:otherwise>
<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>
</py:otherwise>
</py:choose>
<td>${h.render_datetime(source.created)}</td>
</tr>
</py:for>
</table>
</py:when>
<py:otherwise>
<div id="no-harvest-sources">No harvest sources defined yet.</div>
</py:otherwise>
</py:choose>
</div>
</div>
<xi:include href="layout.html" />
</html>