]> source.dussan.org Git - gitblit.git/commitdiff
Indicate 0 search results
authorJames Moger <james.moger@gitblit.com>
Tue, 20 Mar 2012 02:15:31 +0000 (22:15 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 20 Mar 2012 02:15:31 +0000 (22:15 -0400)
src/com/gitblit/wicket/pages/LuceneSearchPage.java

index 8e09a340c355ce9ade5c43b4fa566eba2cf119e4..69fb920385bb7a8ca7cb8b35acd40eaa604b66da 100644 (file)
@@ -156,8 +156,13 @@ public class LuceneSearchPage extends RootPage {
                \r
                // results header\r
                if (results.size() == 0) {\r
-                       add(new Label("resultsHeader").setVisible(false));\r
-                       add(new Label("resultsCount").setVisible(false));\r
+                       if (!ArrayUtils.isEmpty(searchRepositories) && !StringUtils.isEmpty(query)) {\r
+                               add(new Label("resultsHeader", query).setRenderBodyOnly(true));\r
+                               add(new Label("resultsCount", "0 hits").setRenderBodyOnly(true));\r
+                       } else {\r
+                               add(new Label("resultsHeader").setVisible(false));\r
+                               add(new Label("resultsCount").setVisible(false));\r
+                       }\r
                } else {\r
                        add(new Label("resultsHeader", query).setRenderBodyOnly(true));\r
                        add(new Label("resultsCount", MessageFormat.format("results {0} - {1} ({2} hits)",\r