[ckan-changes] commit/ckanext-harvest: amercader: Page packages in the harvest source details page
Bitbucket
commits-noreply at bitbucket.org
Tue Jun 14 09:28:55 UTC 2011
1 new changeset in ckanext-harvest:
http://bitbucket.org/okfn/ckanext-harvest/changeset/cef5b55a599d/
changeset: cef5b55a599d
user: amercader
date: 2011-06-14 11:27:48
summary: Page packages in the harvest source details page
affected #: 2 files (413 bytes)
--- a/ckanext/harvest/controllers/view.py Mon Jun 13 17:36:35 2011 +0200
+++ b/ckanext/harvest/controllers/view.py Tue Jun 14 10:27:48 2011 +0100
@@ -10,7 +10,7 @@
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 @@
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:
--- a/ckanext/harvest/templates/source/read.html Mon Jun 13 17:36:35 2011 +0200
+++ b/ckanext/harvest/templates/source/read.html Tue Jun 14 10:27:48 2011 +0100
@@ -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>
Repository URL: https://bitbucket.org/okfn/ckanext-harvest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list