mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-12-26 18:29:53 +01:00
Display "Closed" label on the search result of issues and pull requests
This commit is contained in:
@@ -675,11 +675,12 @@ trait IssuesService {
|
||||
}
|
||||
.filter {
|
||||
case ((t1, t2), t3) =>
|
||||
keywords
|
||||
.map { query =>
|
||||
t1.content.toLowerCase like (s"%${likeEncode(query)}%", '^')
|
||||
}
|
||||
.reduceLeft(_ && _)
|
||||
t2.pullRequest === pullRequest.bind &&
|
||||
keywords
|
||||
.map { query =>
|
||||
t1.content.toLowerCase like (s"%${likeEncode(query)}%", '^')
|
||||
}
|
||||
.reduceLeft(_ && _)
|
||||
}
|
||||
.map {
|
||||
case ((t1, t2), t3) =>
|
||||
@@ -690,7 +691,7 @@ trait IssuesService {
|
||||
.union(comments)
|
||||
.sortBy {
|
||||
case (issue, commentId, _, _) =>
|
||||
issue.issueId -> commentId
|
||||
issue.issueId.desc -> commentId
|
||||
}
|
||||
.list
|
||||
.splitWith {
|
||||
|
||||
@@ -28,6 +28,7 @@ trait RepositorySearchService { self: IssuesService =>
|
||||
issue.issueId,
|
||||
issue.isPullRequest,
|
||||
issue.title,
|
||||
issue.closed,
|
||||
issue.openedUserName,
|
||||
issue.registeredDate,
|
||||
commentCount,
|
||||
@@ -144,6 +145,7 @@ object RepositorySearchService {
|
||||
issueId: Int,
|
||||
isPullRequest: Boolean,
|
||||
title: String,
|
||||
isClosed: Boolean,
|
||||
openedUserName: String,
|
||||
registeredDate: java.util.Date,
|
||||
commentCount: Int,
|
||||
|
||||
@@ -16,7 +16,12 @@
|
||||
}
|
||||
@issues.drop((page - 1) * RepositorySearchService.IssueLimit).take(RepositorySearchService.IssueLimit).map { issue =>
|
||||
<div class="block">
|
||||
<div class="pull-right muted">#@issue.issueId</div>
|
||||
<div class="pull-right muted">
|
||||
@if(issue.isClosed){
|
||||
<span class="label label-danger">Closed</span>
|
||||
}
|
||||
#@issue.issueId
|
||||
</div>
|
||||
<h4 style="margin-top: 0px;"><a href="@helpers.url(repository)/@if(issue.isPullRequest){pull} else {issues}/@issue.issueId">@issue.title</a></h4>
|
||||
@if(issue.highlightText.nonEmpty){
|
||||
<pre>@Html(issue.highlightText)</pre>
|
||||
|
||||
Reference in New Issue
Block a user