Replace the search tabs with the select box

This commit is contained in:
Naoki Takezoe
2016-12-12 13:59:01 +09:00
parent 9d69cc9d45
commit f0872d410c
4 changed files with 9 additions and 27 deletions

View File

@@ -6,9 +6,7 @@
@import gitbucket.core.service.RepositorySearchService @import gitbucket.core.service.RepositorySearchService
@gitbucket.core.html.main("Search Results", Some(repository)){ @gitbucket.core.html.main("Search Results", Some(repository)){
@gitbucket.core.search.html.menu("code", query, repository){ @gitbucket.core.search.html.menu("code", query, repository){
@if(query.isEmpty) { @if(query.nonEmpty) {
<h4>Input the search keyword</h4>
} else {
@if(files.isEmpty) { @if(files.isEmpty) {
<h4>We couldn't find any code matching '@query'</h4> <h4>We couldn't find any code matching '@query'</h4>
} else { } else {

View File

@@ -6,9 +6,7 @@
@import gitbucket.core.service.RepositorySearchService @import gitbucket.core.service.RepositorySearchService
@gitbucket.core.html.main("Search Results", Some(repository)){ @gitbucket.core.html.main("Search Results", Some(repository)){
@gitbucket.core.search.html.menu("issue", query, repository){ @gitbucket.core.search.html.menu("issue", query, repository){
@if(query.isEmpty){ @if(query.nonEmpty) {
<h4>Input the search keyword</h4>
} else {
@if(issues.isEmpty) { @if(issues.isEmpty) {
<h4>We couldn't find any code matching '@query'</h4> <h4>We couldn't find any code matching '@query'</h4>
} else { } else {

View File

@@ -2,25 +2,13 @@
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(body: Html)(implicit context: gitbucket.core.controller.Context) repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(body: Html)(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers @import gitbucket.core.view.helpers
@gitbucket.core.html.menu("", repository){ @gitbucket.core.html.menu("", repository){
<ul class="nav nav-tabs" style="margin-bottom: 20px;">
<li@if(active=="code"){ class="active"}>
<a href="@helpers.url(repository)/search?q=@helpers.urlEncode(query)&type=code">
Files
</a>
</li>
<li@if(active=="issue"){ class="active"}>
<a href="@helpers.url(repository)/search?q=@helpers.urlEncode(query)&type=issue">
Issues
</a>
</li>
<li@if(active=="wiki"){ class="active"}>
<a href="@helpers.url(repository)/search?q=@helpers.urlEncode(query)&type=wiki">
Wiki
</a>
</li>
</ul>
<form action="@helpers.url(repository)/search" method="GET" class="form-inline"> <form action="@helpers.url(repository)/search" method="GET" class="form-inline">
<input type="text" name="q" value="@query" class="form-control" style="width: 400px; margin-bottom: 0px;"/> <select class="form-control" name="type">
<option value="code" @if(active=="code" ){ selected }>Files</option>
<option value="issue" @if(active=="issue"){ selected }>Issues</option>
<option value="wiki" @if(active=="wiki" ){ selected }>Wiki</option>
</select>
<input type="text" name="q" value="@query" class="form-control" style="width: 250px; margin-bottom: 0px;"/>
<input type="submit" value="Search" class="btn btn-default"/> <input type="submit" value="Search" class="btn btn-default"/>
<input type="hidden" name="type" value="@active"/> <input type="hidden" name="type" value="@active"/>
</form> </form>

View File

@@ -6,9 +6,7 @@
@import gitbucket.core.service.RepositorySearchService @import gitbucket.core.service.RepositorySearchService
@gitbucket.core.html.main("Search Results", Some(repository)){ @gitbucket.core.html.main("Search Results", Some(repository)){
@gitbucket.core.search.html.menu("wiki", query, repository){ @gitbucket.core.search.html.menu("wiki", query, repository){
@if(query.isEmpty){ @if(query.nonEmpty) {
<h4>Input the search keyword</h4>
} else {
@if(wikis.isEmpty) { @if(wikis.isEmpty) {
<h4>We couldn't find any code matching '@query'</h4> <h4>We couldn't find any code matching '@query'</h4>
} else { } else {