From 2ac9885150c2d55ea564f25b2d86274760db911f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Mercader?= Date: Tue, 14 Jun 2011 10:27:48 +0100 Subject: [PATCH] Page packages in the harvest source details page --- ckanext/harvest/controllers/view.py | 7 ++++++- ckanext/harvest/templates/source/read.html | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ckanext/harvest/controllers/view.py b/ckanext/harvest/controllers/view.py index 302f589..e39370a 100644 --- a/ckanext/harvest/controllers/view.py +++ b/ckanext/harvest/controllers/view.py @@ -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: diff --git a/ckanext/harvest/templates/source/read.html b/ckanext/harvest/templates/source/read.html index 665fff7..614e27a 100644 --- a/ckanext/harvest/templates/source/read.html +++ b/ckanext/harvest/templates/source/read.html @@ -80,9 +80,17 @@
There could be a 10 minutes delay before these packages (or changes to them) appear on the site or on search results.
-
- ${package} + +

There are ${c.page.item_count} packages.

+ + ${c.page.pager()} + +
+ ${item}
+
+ ${c.page.pager()} +