(refs #488)Add link to clear search condition

This commit is contained in:
Naoki Takezoe
2014-09-22 10:18:26 +09:00
parent 90487eb7b7
commit cb512cd98d
2 changed files with 10 additions and 0 deletions

View File

@@ -341,6 +341,13 @@ object IssuesService {
sort: String = "created", sort: String = "created",
direction: String = "desc"){ direction: String = "desc"){
def isEmpty: Boolean = {
labels.isEmpty && milestoneId.isEmpty && author.isEmpty && assigned.isEmpty &&
state == "open" && sort == "created" && direction == "desc"
}
def nonEmpty: Boolean = !isEmpty
def toURL: String = def toURL: String =
"?" + List( "?" + List(
if(labels.isEmpty) None else Some("labels=" + urlEncode(labels.mkString(","))), if(labels.isEmpty) None else Some("labels=" + urlEncode(labels.mkString(","))),

View File

@@ -74,6 +74,9 @@
</li> </li>
} }
*@ *@
@if(condition.nonEmpty){
<a href="@service.IssuesService.IssueSearchCondition().toURL">Clear current search query, filters, and sorts</a>
}
<table class="table table-bordered table-hover table-issues"> <table class="table table-bordered table-hover table-issues">
<tr> <tr>
<th style="background-color: #eee;"> <th style="background-color: #eee;">