changeset 1489:cd788728a7ec

Show hint to consider full-text search if using titlesearch
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Fri, 25 Aug 2006 13:25:31 +0200
parents 2178a0153213
children 1660b71d2316
files MoinMoin/action/fullsearch.py wiki/htdocs/modern/css/common.css
diffstat 2 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/fullsearch.py	Fri Aug 25 12:44:26 2006 +0200
+++ b/MoinMoin/action/fullsearch.py	Fri Aug 25 13:25:31 2006 +0200
@@ -154,7 +154,6 @@
         Page(request, pagename).send_page(request, msg=err)
         return
 
-
     request.emit_http_headers()
 
     # This action generate data using the user language
@@ -166,7 +165,27 @@
     # Start content (important for RTL support)
     request.write(request.formatter.startContent("content"))
 
-    # First search stats
+    # Hint if using titlesearch
+    f = request.formatter
+    if titlesearch:
+        querydict = wikiutil.parseQueryString(request.query_string)
+        querydict.update({'titlesearch': 0})
+
+        request.write(''.join([
+            f.paragraph(1, attr={'class': 'searchhint'}),
+            _('(!) You\'re conducting a title search so your search '
+                'results might not contain all information available for '
+                'your search query in this wiki.'),
+            ' ',
+            f.url(1, href=request.page.url(request, querydict, escape=0,
+                relative=False)),
+            f.text(_('Click here to perform a full-text search with your '
+                'search terms!')),
+            f.url(0),
+            f.paragraph(0)
+        ]))
+
+    # Search stats
     request.write(results.stats(request, request.formatter, hitsFrom))
 
     # Then search results
--- a/wiki/htdocs/modern/css/common.css	Fri Aug 25 12:44:26 2006 +0200
+++ b/wiki/htdocs/modern/css/common.css	Fri Aug 25 13:25:31 2006 +0200
@@ -385,6 +385,12 @@
     padding: 2px;
 }
 
+p.searchhint {
+    background-color: #E6EAF0;
+    border: 1px solid #9088DC;
+    padding: 2px;
+}
+
 .searchpages {
     margin-left: auto;
     margin-right: auto;