Mercurial > moin > 1.9
changeset 2943:fa428b3c7d64
introduced hitsInfo keyword for results.pageList (default is 0). Action fullsearch does set it to 1. So the macro FullSearch does not show the hits info.
author | Reimar Bauer <rb.proj AT googlemail DOT com> |
---|---|
date | Thu, 08 Nov 2007 21:40:58 +0100 |
parents | 1906e0e91f0c |
children | 862edffe5d7c |
files | MoinMoin/action/fullsearch.py MoinMoin/search/results.py |
diffstat | 2 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/action/fullsearch.py Wed Nov 07 19:19:43 2007 +0100 +++ b/MoinMoin/action/fullsearch.py Thu Nov 08 21:40:58 2007 +0100 @@ -56,7 +56,7 @@ ]) -def execute(pagename, request, fieldname='value', titlesearch=0): +def execute(pagename, request, fieldname='value', titlesearch=0, statistic=0): _ = request.getText titlesearch = checkTitleSearch(request) if titlesearch < 0: @@ -263,10 +263,10 @@ info = not titlesearch if context: output = results.pageListWithContext(request, request.formatter, - info=info, context=context, hitsFrom=hitsFrom) + info=info, context=context, hitsFrom=hitsFrom, hitsInfo=1) else: output = results.pageList(request, request.formatter, info=info, - hitsFrom=hitsFrom) + hitsFrom=hitsFrom, hitsInfo=1) request.write(output)
--- a/MoinMoin/search/results.py Wed Nov 07 19:19:43 2007 +0100 +++ b/MoinMoin/search/results.py Thu Nov 08 21:40:58 2007 +0100 @@ -295,7 +295,7 @@ return ''.join(output) def pageList(self, request, formatter, info=0, numbered=1, - paging=True, hitsFrom=0): + paging=True, hitsFrom=0, hitsInfo=0): """ Format a list of found pages @param request: current request @@ -346,13 +346,18 @@ matchInfo = '' if info: matchInfo = self.formatInfo(f, page) + + info_for_hits = u'' + if hitsInfo: + info_for_hits = self.formatHitInfoBar(page) + item = [ f.listitem(1), f.pagelink(1, page.page_name, querystr=querystr), self.formatTitle(page), f.pagelink(0, page.page_name), matchInfo, - self.formatHitInfoBar(page), + info_for_hits, f.listitem(0), ] write(''.join(item))