[ui] Cleanup sources list and details page
This commit is contained in:
parent
0f8c607187
commit
3a489bbb82
|
@ -34,7 +34,7 @@ def _get_source_status(source, detailed=True):
|
|||
# Get next scheduled job
|
||||
next_job = HarvestJob.filter(source=source,status=u'New').first()
|
||||
if next_job:
|
||||
out['next_harvest'] = 'Within 15 minutes'
|
||||
out['next_harvest'] = 'Scheduled'
|
||||
else:
|
||||
out['next_harvest'] = 'Not yet scheduled'
|
||||
|
||||
|
|
|
@ -1,4 +1,16 @@
|
|||
/* Harvest styles */
|
||||
|
||||
|
||||
|
||||
body.index.ViewController #minornavigation {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.index.ViewController #content {
|
||||
width: 100% !important;
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
#new-harvest-source {
|
||||
background: transparent url("images/icons/source_new.png") no-repeat 0px 0px;
|
||||
padding-left: 20px;
|
||||
|
@ -6,10 +18,34 @@
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
#show-inactive-sources-content{
|
||||
float: right;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
#show-inactive-sources-content input{
|
||||
float: left;
|
||||
}
|
||||
|
||||
#show-inactive-sources-content label{
|
||||
float: left;
|
||||
font-weight: normal;
|
||||
margin-top: -4px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#harvest-sources th.action{
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#harvest-sources .inactive{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#harvest-sources .inactive .state{
|
||||
color: red;
|
||||
}
|
||||
|
||||
.harvester-title{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
@ -8,14 +8,21 @@
|
|||
<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>
|
||||
|
||||
<table id="harvest-sources">
|
||||
<tr>
|
||||
|
@ -30,25 +37,33 @@
|
|||
<th>Created</th>
|
||||
</tr>
|
||||
|
||||
<tr py:for="source in c.sources">
|
||||
<tr py:for="source in c.sources" 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>${source.active}</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>${source.status.overall_statistics.added} pkgs ${source.status.overall_statistics.errors} errors</td>
|
||||
<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>${source.created}</td>
|
||||
<td>${h.render_datetime(source.created)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</py:when>
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
<tr>
|
||||
<th>Status</th>
|
||||
<td>
|
||||
Last Harvest Errors: ${c.source.status.last_harvest_statistics.errors}<br/>
|
||||
<a name="errors"/>Last Harvest Errors: ${c.source.status.last_harvest_statistics.errors}<br/>
|
||||
<py:choose>
|
||||
<py:when test="len(c.source.status.last_harvest_errors.gather)>0">
|
||||
<i>Gathering errors</i>
|
||||
|
@ -105,21 +105,22 @@
|
|||
<td>${c.source.status.overall_statistics.errors}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Total Packages</th>
|
||||
<th>Total Datasets</th>
|
||||
<td>${c.source.status.overall_statistics.added}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Packages</th>
|
||||
<th>Datasets</th>
|
||||
<td>
|
||||
<div>There could be a 10 minutes delay before these packages (or changes to them) appear on
|
||||
<a name="datasets"/>
|
||||
<div>There could be a 10 minutes delay before these datasets (or changes to them) appear on
|
||||
the site or on search results.</div>
|
||||
|
||||
<p i18n:msg="item_count">There are <strong>${c.page.item_count}</strong> packages.</p>
|
||||
<p i18n:msg="item_count">There are <strong>${c.page.item_count}</strong> datasets.</p>
|
||||
|
||||
${c.page.pager()}
|
||||
<py:for each="item in c.page.items">
|
||||
<div>
|
||||
<a href="/package/${item}">${item}</a>
|
||||
<a href="/dataset/${item}">${item}</a>
|
||||
</div>
|
||||
</py:for>
|
||||
${c.page.pager()}
|
||||
|
|
Loading…
Reference in New Issue