diff options
author | James Moger <james.moger@gitblit.com> | 2012-03-19 22:15:31 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-03-19 22:15:31 -0400 |
commit | 22a8a61991c4364632dd4faafa21edc33b06c257 (patch) | |
tree | 0461b9c8b697ab2961838c7ad2dc7532abaa58c9 | |
parent | 4e1930a8d9a4e1e90dadf36641f491fdda09f216 (diff) | |
download | gitblit-22a8a61991c4364632dd4faafa21edc33b06c257.tar.gz gitblit-22a8a61991c4364632dd4faafa21edc33b06c257.zip |
Indicate 0 search results
-rw-r--r-- | src/com/gitblit/wicket/pages/LuceneSearchPage.java | 9 |
1 files changed, 7 insertions, 2 deletions
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)",
|