changeset 1224:64c02d0697d5

there were some serious flaws in continued paging.. works now ;)
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Sun, 06 Aug 2006 14:12:26 +0200
parents d0e72768f936
children d7d17b4285f5
files MoinMoin/search/results.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/results.py	Sun Aug 06 14:00:18 2006 +0200
+++ b/MoinMoin/search/results.py	Sun Aug 06 14:12:26 2006 +0200
@@ -669,7 +669,7 @@
         
         pages = float(hitsNum) / hitsPerPage
         if pages - int(pages) > 0.0:
-            pages = int(pages) + 2
+            pages = int(pages) + 1
         cur_page = hitsFrom / hitsPerPage
         l = []
 
@@ -686,11 +686,9 @@
         # list of pages to be shown
         page_range = range(*(
             cur_page - 4 < 0 and
-                (0, pages >= 10 and 10 or pages)
-                or
-                (cur_page - 4, cur_page + 6 > pages and
-                    cur_page + (pages - 1 - cur_page) or
-                    cur_page + 6)))
+                (0, pages >= 10 and 10 or pages) or
+                (cur_page - 4, cur_page + 6 >= pages and
+                    pages or cur_page + 6)))
         l.extend([''.join([
                 i != cur_page and f.url(1, href=page_url(i)) or '',
                 f.text(str(i+1)),