changeset 1485:2f3ab9872a40

bump number of pagelinks if there are no prev/next links
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Fri, 25 Aug 2006 11:37:48 +0200
parents 499517b99c5f
children 5d30213ee39b
files MoinMoin/search/results.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/results.py	Thu Aug 24 19:39:49 2006 +0200
+++ b/MoinMoin/search/results.py	Fri Aug 25 11:37:48 2006 +0200
@@ -369,7 +369,7 @@
                 write(''.join(item))
             write(list(0))
             if paging:
-                write(self.formatPrevNextPageLinks(hitsFrom=hitsFrom,
+                write(self.formatPageLinks(hitsFrom=hitsFrom,
                     hitsPerPage=request.cfg.search_results_per_page,
                     hitsNum=len(self.hits)))
 
@@ -451,7 +451,7 @@
                 write(''.join(item))
             write(f.definition_list(0))
             if paging:
-                write(self.formatPrevNextPageLinks(hitsFrom=hitsFrom,
+                write(self.formatPageLinks(hitsFrom=hitsFrom,
                     hitsPerPage=request.cfg.search_results_per_page,
                     hitsNum=len(self.hits)))
         
@@ -661,7 +661,7 @@
             return ''.join(output)
         return ''
 
-    def formatPrevNextPageLinks(self, hitsFrom, hitsPerPage, hitsNum):
+    def formatPageLinks(self, hitsFrom, hitsPerPage, hitsNum):
         """ Format previous and next page links in page
 
         @param hitsFrom: current position in the hits
@@ -697,9 +697,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 - 5 < 0 and
+                (0, pages > 10 and 10 or pages) or
+                (cur_page - 5, 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 '',