import org.apache.wicket.Response;\r
import org.apache.wicket.Session;\r
import org.apache.wicket.protocol.http.WebApplication;\r
-import org.apache.wicket.protocol.http.request.urlcompressing.UrlCompressingWebRequestProcessor;\r
-import org.apache.wicket.request.IRequestCycleProcessor;\r
import org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy;\r
\r
import com.gitblit.GitBlit;\r
return new GitBlitWebSession(request);\r
}\r
\r
- @Override\r
- protected final IRequestCycleProcessor newRequestCycleProcessor() {\r
- return new UrlCompressingWebRequestProcessor();\r
- }\r
-\r
@Override\r
public final String getConfigurationType() {\r
if (GitBlit.self().isDebugMode())\r
lang="en"> \r
\r
<wicket:panel>\r
- <!-- page nav links --> \r
- <div class="page_nav">\r
- <a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>\r
+ <!-- floating search form on right -->\r
+ <form wicket:id="searchForm">\r
+ <div class="search">\r
+ <select wicket:id="searchType"/>\r
+ <wicket:message key="gb.search"></wicket:message>:\r
+ <input type="text" id="searchBox" wicket:id="searchBox" value=""/>\r
+ </div>\r
+ </form>\r
+ \r
+ <!-- page nav links -->\r
+ <div class="page_nav"> \r
+ <div>\r
+ <a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>\r
+ </div>\r
</div> \r
</wicket:panel>\r
</html>
\ No newline at end of file
\r
import java.text.MessageFormat;\r
import java.util.ArrayList;\r
+import java.util.Arrays;\r
import java.util.HashMap;\r
import java.util.List;\r
import java.util.Map;\r
\r
import org.apache.wicket.Component;\r
import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.form.DropDownChoice;\r
+import org.apache.wicket.markup.html.form.StatelessForm;\r
+import org.apache.wicket.markup.html.form.TextField;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.html.panel.Panel;\r
import org.apache.wicket.markup.repeater.Item;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
+import org.apache.wicket.model.IModel;\r
+import org.apache.wicket.model.Model;\r
import org.eclipse.jgit.lib.Repository;\r
\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.utils.JGitUtils.SearchType;\r
import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.pages.BranchesPage;\r
import com.gitblit.wicket.pages.LogPage;\r
+import com.gitblit.wicket.pages.SearchPage;\r
import com.gitblit.wicket.pages.SummaryPage;\r
import com.gitblit.wicket.pages.TagsPage;\r
import com.gitblit.wicket.pages.TicketsPage;\r
}\r
};\r
add(extrasView);\r
+\r
+ add(new SearchForm("searchForm", repositoryName));\r
}\r
\r
public void disablePageLink(String pageName) {\r
}\r
}\r
}\r
+\r
+ class SearchForm extends StatelessForm<Void> {\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ private final String repositoryName;\r
+\r
+ private final IModel<String> searchBoxModel = new Model<String>("");\r
+ \r
+ private final IModel<SearchType> searchTypeModel = new Model<SearchType>(SearchType.COMMIT);\r
+\r
+ public SearchForm(String id, String repositoryName) {\r
+ super(id);\r
+ this.repositoryName = repositoryName;\r
+ DropDownChoice<SearchType> searchType = new DropDownChoice<SearchType>("searchType", Arrays.asList(SearchType.values()));\r
+ searchType.setModel(searchTypeModel);\r
+ add(searchType);\r
+ add(new TextField<String>("searchBox", searchBoxModel));\r
+ }\r
+\r
+ @Override\r
+ public void onSubmit() {\r
+ SearchType searchType = searchTypeModel.getObject();\r
+ String searchString = searchBoxModel.getObject();\r
+ setResponsePage(SearchPage.class, WicketUtils.newSearchParameter(repositoryName, null, searchString, searchType));\r
+ }\r
+ }\r
}
\ No newline at end of file