Page packages in the harvest source details page
This commit is contained in:
parent
0d9d1f8096
commit
2ac9885150
|
@ -10,7 +10,7 @@ from ckanext.harvest.logic.schema import harvest_source_form_schema
|
|||
from ckanext.harvest.lib import create_harvest_source, edit_harvest_source, \
|
||||
get_harvest_source, get_harvest_sources, \
|
||||
create_harvest_job, get_registered_harvesters_info
|
||||
|
||||
from ckan.lib.helpers import Page
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -115,6 +115,11 @@ class ViewController(BaseController):
|
|||
def read(self,id):
|
||||
try:
|
||||
c.source = get_harvest_source(id)
|
||||
c.page = Page(
|
||||
collection=c.source['status']['packages'],
|
||||
page=request.params.get('page', 1),
|
||||
items_per_page=20
|
||||
)
|
||||
|
||||
return render('source/read.html')
|
||||
except NotFound:
|
||||
|
|
|
@ -80,9 +80,17 @@
|
|||
<td>
|
||||
<div>There could be a 10 minutes delay before these packages (or changes to them) appear on
|
||||
the site or on search results.</div>
|
||||
<div py:for="package in c.source.status.packages">
|
||||
<a href="/package/${package}">${package}</a>
|
||||
|
||||
<p i18n:msg="item_count">There are <strong>${c.page.item_count}</strong> packages.</p>
|
||||
|
||||
${c.page.pager()}
|
||||
<py:for each="item in c.page.items">
|
||||
<div>
|
||||
<a href="/package/${item}">${item}</a>
|
||||
</div>
|
||||
</py:for>
|
||||
${c.page.pager()}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue