From: James Moger Date: Tue, 20 Mar 2012 02:15:31 +0000 (-0400) Subject: Indicate 0 search results X-Git-Tag: v0.9.0~46 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=22a8a61991c4364632dd4faafa21edc33b06c257;p=gitblit.git Indicate 0 search results --- diff --git a/src/com/gitblit/wicket/pages/LuceneSearchPage.java b/src/com/gitblit/wicket/pages/LuceneSearchPage.java index 8e09a340..69fb9203 100644 --- a/src/com/gitblit/wicket/pages/LuceneSearchPage.java +++ b/src/com/gitblit/wicket/pages/LuceneSearchPage.java @@ -156,8 +156,13 @@ public class LuceneSearchPage extends RootPage { // results header if (results.size() == 0) { - add(new Label("resultsHeader").setVisible(false)); - add(new Label("resultsCount").setVisible(false)); + if (!ArrayUtils.isEmpty(searchRepositories) && !StringUtils.isEmpty(query)) { + add(new Label("resultsHeader", query).setRenderBodyOnly(true)); + add(new Label("resultsCount", "0 hits").setRenderBodyOnly(true)); + } else { + add(new Label("resultsHeader").setVisible(false)); + add(new Label("resultsCount").setVisible(false)); + } } else { add(new Label("resultsHeader", query).setRenderBodyOnly(true)); add(new Label("resultsCount", MessageFormat.format("results {0} - {1} ({2} hits)",