Fix issue search box

This commit is contained in:
Naoki Takezoe
2015-12-08 02:26:11 +09:00
parent 2aa71ed217
commit 54bef6505f
5 changed files with 38 additions and 40 deletions

View File

@@ -7,8 +7,7 @@
@import gitbucket.core.view.helpers._ @import gitbucket.core.view.helpers._
@helper.html.dropdown( @helper.html.dropdown(
value = if(branch.length == 40) branch.substring(0, 10) else branch, value = if(branch.length == 40) branch.substring(0, 10) else branch,
prefix = if(branch.length == 40) "tree" else if(repository.branchList.contains(branch)) "branch" else "tree", prefix = if(branch.length == 40) "tree" else if(repository.branchList.contains(branch)) "branch" else "tree"
mini = false
) { ) {
<li><div id="branch-control-title">Switch branches<button id="branch-control-close" class="pull-right">&times</button></div></li> <li><div id="branch-control-title">Switch branches<button id="branch-control-close" class="pull-right">&times</button></div></li>
<li><input id="branch-control-input" type="text" placeholder="Find or create branch ..."/></li> <li><input id="branch-control-input" type="text" placeholder="Find or create branch ..."/></li>

View File

@@ -1,13 +1,12 @@
@(value : String = "", @(value : String = "",
prefix: String = "", prefix: String = "",
mini : Boolean = true,
style : String = "", style : String = "",
right : Boolean = false, right : Boolean = false,
flat : Boolean = false)(body: Html) flat : Boolean = false)(body: Html)
<div class="btn-group" @if(style.nonEmpty){style="@style"}> <div class="btn-group" @if(style.nonEmpty){style="@style"}>
<button <button
@if(flat){style="border: none; background-color: #eee;"} @if(flat){style="border: none; background-color: #eee;"}
class="dropdown-toggle @if(!flat){btn btn-default} else {flat} @if(mini){btn-xs} else {btn-sm}" data-toggle="dropdown"> class="dropdown-toggle @if(!flat){btn btn-default} else {flat} btn-sm" data-toggle="dropdown">
@if(value.isEmpty){ @if(value.isEmpty){
<i class="octicon octicon-gear"></i> <i class="octicon octicon-gear"></i>
} else { } else {

View File

@@ -7,8 +7,6 @@
@import gitbucket.core.view.helpers._ @import gitbucket.core.view.helpers._
@html.main(s"New Issue - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"New Issue - ${repository.owner}/${repository.name}", Some(repository)){
@html.menu("issues", repository){ @html.menu("issues", repository){
@navigation("issues", false, repository)
<br/><br/><hr style="margin-bottom: 10px;">
<form action="@url(repository)/issues/new" method="POST" validate="true" class="form-group"> <form action="@url(repository)/issues/new" method="POST" validate="true" class="form-group">
<div class="row"> <div class="row">
<div class="col-md-10"> <div class="col-md-10">

View File

@@ -10,48 +10,48 @@
<li class="@if(active == "labels" ){active}"><a href="@url(repository)/issues/labels">Labels</a></li> <li class="@if(active == "labels" ){active}"><a href="@url(repository)/issues/labels">Labels</a></li>
<li class="@if(active == "milestones"){active} last"><a href="@url(repository)/issues/milestones">Milestones</a></li> <li class="@if(active == "milestones"){active} last"><a href="@url(repository)/issues/milestones">Milestones</a></li>
<li class="pull-right"> <li class="pull-right">
<form method="GET" id="search-filter-form" style="margin-bottom: 0px;" class="form-group"> <form method="GET" id="search-filter-form" style="margin-bottom: 0px;" class="form-inline">
@condition.map { condition => @condition.map { condition =>
@if(loginAccount.isDefined){ @if(loginAccount.isDefined){
<div class="input-prepend" style="margin-bottom: 0px;"> <div class="form-group" style="width: 300px">
<div class="btn-group"> <div class="input-group" style="margin-bottom: 0px;">
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" style="height: 34px;"> <div class="input-group-btn">
Filter <button type="button" class="btn btn-default btn-lg dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span> Filter
</button> <span class="caret"></span>
<ul class="dropdown-menu"> </button>
<li><a href="?q=is:open">Open issues and pull requests</a></li> <ul class="dropdown-menu">
<li><a href="?q=is:open+is:issue+author:@urlEncode(loginAccount.get.userName)">Your issues</a></li> <li><a href="?q=is:open">Open issues and pull requests</a></li>
<li><a href="?q=is:open+is:pr+author:@urlEncode(loginAccount.get.userName)">Your pull requests</a></li> <li><a href="?q=is:open+is:issue+author:@urlEncode(loginAccount.get.userName)">Your issues</a></li>
<li><a href="?q=is:open+assignee:@urlEncode(loginAccount.get.userName)">Everything assigned to you</a></li> <li><a href="?q=is:open+is:pr+author:@urlEncode(loginAccount.get.userName)">Your pull requests</a></li>
@* <li><a href="?q=is:open+assignee:@urlEncode(loginAccount.get.userName)">Everything assigned to you</a></li>
<li><a href="?q=is:open+mentions:@urlEncode(loginAccount.get.userName)">Everything mentioning you</a></li> @*
*@ <li><a href="?q=is:open+mentions:@urlEncode(loginAccount.get.userName)">Everything mentioning you</a></li>
</ul> *@
</ul>
</div>
<input type="text" id="search-filter-box" class="form-control input-lg" size="40" name="q" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
</div> </div>
<input type="text" id="search-filter-box" class="form-control input-lg" size="40" name="q" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
</div> </div>
} else { } else {
<input type="text" id="search-filter-box" class="form-control input-lg" size="40" name="q" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/> <input type="text" id="search-filter-box" class="form-control input-lg" size="40" name="q" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
} }
} }
@if(loginAccount.isDefined){ @if(loginAccount.isDefined){
<div class="btn-group"> @if(newButton){
@if(newButton){ @if(active == "issues"){
@if(active == "issues"){ <a class="btn btn-success btn-lg" href="@url(repository)/issues/new">New issue</a>
<a class="btn btn-success" href="@url(repository)/issues/new" style="height: 24px;">New issue</a>
}
@if(active == "pulls"){
<a class="btn btn-success" href="@url(repository)/compare" style="height: 24px;">New pull request</a>
}
@if(active == "labels"){
<a class="btn btn-success" href="javascript:void(0);" id="new-label-button" style="height: 24px;">New label</a>
}
@if(active == "milestones"){
<a class="btn btn-success" href="@url(repository)/issues/milestones/new" style="height: 24px;">New milestone</a>
}
} }
</div> @if(active == "pulls"){
<a class="btn btn-success btn-lg" href="@url(repository)/compare">New pull request</a>
}
@if(active == "labels"){
<a class="btn btn-success btn-lg" href="javascript:void(0);" id="new-label-button">New label</a>
}
@if(active == "milestones"){
<a class="btn btn-success btn-lg" href="@url(repository)/issues/milestones/new">New milestone</a>
}
}
} }
</form> </form>
</li> </li>

View File

@@ -86,12 +86,14 @@ blockquote p {
} }
.table-bordered > thead > tr:first-child > th:nth-of-type(1), .table-bordered > thead > tr:first-child > th:nth-of-type(1),
.table-bordered > tbody > tr:first-child > th:nth-of-type(1) { .table-bordered > tbody > tr:first-child > th:nth-of-type(1),
.table-bordered > tbody > tr:first-child > td:nth-of-type(1) {
border-top-left-radius: 4px; border-top-left-radius: 4px;
} }
.table-bordered > thead > tr:first-child > th:nth-last-of-type(1), .table-bordered > thead > tr:first-child > th:nth-last-of-type(1),
.table-bordered > tbody > tr:first-child > th:nth-last-of-type(1) { .table-bordered > tbody > tr:first-child > th:nth-last-of-type(1),
.table-bordered > tbody > tr:first-child > td:nth-last-of-type(1) {
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }