mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
(refs #488)Merge user filter into IssueSearchCondition
This commit is contained in:
@@ -50,20 +50,20 @@ trait DashboardControllerBase extends ControllerBase {
|
|||||||
|
|
||||||
val userName = context.loginAccount.get.userName
|
val userName = context.loginAccount.get.userName
|
||||||
val userRepos = getUserRepositories(userName, context.baseUrl, true).map(repo => repo.owner -> repo.name)
|
val userRepos = getUserRepositories(userName, context.baseUrl, true).map(repo => repo.owner -> repo.name)
|
||||||
val filterUser = Map(filter -> userName)
|
//val filterUser = Map(filter -> userName)
|
||||||
val page = IssueSearchCondition.page(request)
|
val page = IssueSearchCondition.page(request)
|
||||||
|
|
||||||
dashboard.html.issues(
|
dashboard.html.issues(
|
||||||
dashboard.html.issueslist(
|
dashboard.html.issueslist(
|
||||||
searchIssue(condition, filterUser, false, (page - 1) * IssueLimit, IssueLimit, userRepos: _*),
|
searchIssue(condition, false, (page - 1) * IssueLimit, IssueLimit, userRepos: _*),
|
||||||
page,
|
page,
|
||||||
countIssue(condition.copy(state = "open" ), filterUser, false, userRepos: _*),
|
countIssue(condition.copy(state = "open" ), false, userRepos: _*),
|
||||||
countIssue(condition.copy(state = "closed"), filterUser, false, userRepos: _*),
|
countIssue(condition.copy(state = "closed"), false, userRepos: _*),
|
||||||
condition),
|
condition),
|
||||||
countIssue(condition, Map.empty, false, userRepos: _*),
|
countIssue(condition.copy(assigned = None, author = None), false, userRepos: _*),
|
||||||
countIssue(condition, Map("assigned" -> userName), false, userRepos: _*),
|
countIssue(condition.copy(assigned = Some(userName), author = None), false, userRepos: _*),
|
||||||
countIssue(condition, Map("created_by" -> userName), false, userRepos: _*),
|
countIssue(condition.copy(assigned = None, author = Some(userName)), false, userRepos: _*),
|
||||||
countIssueGroupByRepository(condition, filterUser, false, userRepos: _*),
|
countIssueGroupByRepository(condition, false, userRepos: _*),
|
||||||
condition,
|
condition,
|
||||||
filter)
|
filter)
|
||||||
|
|
||||||
@@ -86,14 +86,14 @@ trait DashboardControllerBase extends ControllerBase {
|
|||||||
val page = IssueSearchCondition.page(request)
|
val page = IssueSearchCondition.page(request)
|
||||||
|
|
||||||
val counts = countIssueGroupByRepository(
|
val counts = countIssueGroupByRepository(
|
||||||
IssueSearchCondition().copy(state = condition.state), Map.empty, true, userRepos: _*)
|
IssueSearchCondition().copy(state = condition.state), true, userRepos: _*)
|
||||||
|
|
||||||
dashboard.html.pulls(
|
dashboard.html.pulls(
|
||||||
dashboard.html.pullslist(
|
dashboard.html.pullslist(
|
||||||
searchIssue(condition, filterUser, true, (page - 1) * PullRequestLimit, PullRequestLimit, allRepos: _*),
|
searchIssue(condition, true, (page - 1) * PullRequestLimit, PullRequestLimit, allRepos: _*),
|
||||||
page,
|
page,
|
||||||
countIssue(condition.copy(state = "open" ), filterUser, true, allRepos: _*),
|
countIssue(condition.copy(state = "open" ), true, allRepos: _*),
|
||||||
countIssue(condition.copy(state = "closed"), filterUser, true, allRepos: _*),
|
countIssue(condition.copy(state = "closed"), true, allRepos: _*),
|
||||||
condition,
|
condition,
|
||||||
None,
|
None,
|
||||||
false),
|
false),
|
||||||
|
|||||||
@@ -48,16 +48,8 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
"content" -> trim(optional(text()))
|
"content" -> trim(optional(text()))
|
||||||
)(IssueStateForm.apply)
|
)(IssueStateForm.apply)
|
||||||
|
|
||||||
get("/:owner/:repository/issues")(referrersOnly {
|
get("/:owner/:repository/issues")(referrersOnly { repository =>
|
||||||
searchIssues("all", _)
|
searchIssues(repository)
|
||||||
})
|
|
||||||
|
|
||||||
get("/:owner/:repository/issues/assigned/:userName")(referrersOnly {
|
|
||||||
searchIssues("assigned", _)
|
|
||||||
})
|
|
||||||
|
|
||||||
get("/:owner/:repository/issues/created_by/:userName")(referrersOnly {
|
|
||||||
searchIssues("created_by", _)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
get("/:owner/:repository/issues/:id")(referrersOnly { repository =>
|
get("/:owner/:repository/issues/:id")(referrersOnly { repository =>
|
||||||
@@ -370,9 +362,8 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private def searchIssues(filter: String, repository: RepositoryService.RepositoryInfo) = {
|
private def searchIssues(repository: RepositoryService.RepositoryInfo) = {
|
||||||
defining(repository.owner, repository.name){ case (owner, repoName) =>
|
defining(repository.owner, repository.name){ case (owner, repoName) =>
|
||||||
val filterUser = Map(filter -> params.getOrElse("userName", ""))
|
|
||||||
val page = IssueSearchCondition.page(request)
|
val page = IssueSearchCondition.page(request)
|
||||||
val sessionKey = Keys.Session.Issues(owner, repoName)
|
val sessionKey = Keys.Session.Issues(owner, repoName)
|
||||||
|
|
||||||
@@ -383,19 +374,18 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
)
|
)
|
||||||
|
|
||||||
issues.html.list(
|
issues.html.list(
|
||||||
searchIssue(condition, filterUser, false, (page - 1) * IssueLimit, IssueLimit, owner -> repoName),
|
searchIssue(condition, false, (page - 1) * IssueLimit, IssueLimit, owner -> repoName),
|
||||||
page,
|
page,
|
||||||
(getCollaborators(owner, repoName) :+ owner).sorted,
|
(getCollaborators(owner, repoName) :+ owner).sorted,
|
||||||
getMilestones(owner, repoName),
|
getMilestones(owner, repoName),
|
||||||
getLabels(owner, repoName),
|
getLabels(owner, repoName),
|
||||||
countIssue(condition.copy(state = "open"), filterUser, false, owner -> repoName),
|
countIssue(condition.copy(state = "open"), false, owner -> repoName),
|
||||||
countIssue(condition.copy(state = "closed"), filterUser, false, owner -> repoName),
|
countIssue(condition.copy(state = "closed"), false, owner -> repoName),
|
||||||
countIssue(condition, Map.empty, false, owner -> repoName),
|
countIssue(condition.copy(assigned = None, author = None), false, owner -> repoName),
|
||||||
context.loginAccount.map(x => countIssue(condition, Map("assigned" -> x.userName), false, owner -> repoName)),
|
context.loginAccount.map(x => countIssue(condition.copy(assigned = Some(x.userName), author = None), false, owner -> repoName)),
|
||||||
context.loginAccount.map(x => countIssue(condition, Map("created_by" -> x.userName), false, owner -> repoName)),
|
context.loginAccount.map(x => countIssue(condition.copy(assigned = None, author = Some(x.userName)), false, owner -> repoName)),
|
||||||
countIssueGroupByLabels(owner, repoName, condition, filterUser),
|
countIssueGroupByLabels(owner, repoName, condition),
|
||||||
condition,
|
condition,
|
||||||
filter,
|
|
||||||
repository,
|
repository,
|
||||||
hasWritePermission(owner, repoName, context.loginAccount))
|
hasWritePermission(owner, repoName, context.loginAccount))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -464,13 +464,13 @@ trait PullRequestsControllerBase extends ControllerBase {
|
|||||||
)
|
)
|
||||||
|
|
||||||
pulls.html.list(
|
pulls.html.list(
|
||||||
searchIssue(condition, filterUser, true, (page - 1) * PullRequestLimit, PullRequestLimit, owner -> repoName),
|
searchIssue(condition, true, (page - 1) * PullRequestLimit, PullRequestLimit, owner -> repoName),
|
||||||
getPullRequestCountGroupByUser(condition.state == "closed", Some(owner), Some(repoName)),
|
getPullRequestCountGroupByUser(condition.state == "closed", Some(owner), Some(repoName)),
|
||||||
userName,
|
userName,
|
||||||
page,
|
page,
|
||||||
countIssue(condition.copy(state = "open" ), filterUser, true, owner -> repoName),
|
countIssue(condition.copy(state = "open" ), true, owner -> repoName),
|
||||||
countIssue(condition.copy(state = "closed"), filterUser, true, owner -> repoName),
|
countIssue(condition.copy(state = "closed"), true, owner -> repoName),
|
||||||
countIssue(condition, Map.empty, true, owner -> repoName),
|
countIssue(condition.copy(assigned = None, author = None), true, owner -> repoName),
|
||||||
condition,
|
condition,
|
||||||
repository,
|
repository,
|
||||||
hasWritePermission(owner, repoName, context.loginAccount))
|
hasWritePermission(owner, repoName, context.loginAccount))
|
||||||
|
|||||||
@@ -43,14 +43,13 @@ trait IssuesService {
|
|||||||
* Returns the count of the search result against issues.
|
* Returns the count of the search result against issues.
|
||||||
*
|
*
|
||||||
* @param condition the search condition
|
* @param condition the search condition
|
||||||
* @param filterUser the filter user name (key is "all", "assigned" or "created_by", value is the user name)
|
|
||||||
* @param onlyPullRequest if true then counts only pull request, false then counts both of issue and pull request.
|
* @param onlyPullRequest if true then counts only pull request, false then counts both of issue and pull request.
|
||||||
* @param repos Tuple of the repository owner and the repository name
|
* @param repos Tuple of the repository owner and the repository name
|
||||||
* @return the count of the search result
|
* @return the count of the search result
|
||||||
*/
|
*/
|
||||||
def countIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
|
def countIssue(condition: IssueSearchCondition, onlyPullRequest: Boolean, repos: (String, String)*)
|
||||||
repos: (String, String)*)(implicit s: Session): Int =
|
(implicit s: Session): Int =
|
||||||
Query(searchIssueQuery(repos, condition, filterUser, onlyPullRequest).length).first
|
Query(searchIssueQuery(repos, condition, onlyPullRequest).length).first
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Map which contains issue count for each labels.
|
* Returns the Map which contains issue count for each labels.
|
||||||
@@ -58,13 +57,12 @@ trait IssuesService {
|
|||||||
* @param owner the repository owner
|
* @param owner the repository owner
|
||||||
* @param repository the repository name
|
* @param repository the repository name
|
||||||
* @param condition the search condition
|
* @param condition the search condition
|
||||||
* @param filterUser the filter user name (key is "all", "assigned" or "created_by", value is the user name)
|
|
||||||
* @return the Map which contains issue count for each labels (key is label name, value is issue count)
|
* @return the Map which contains issue count for each labels (key is label name, value is issue count)
|
||||||
*/
|
*/
|
||||||
def countIssueGroupByLabels(owner: String, repository: String, condition: IssueSearchCondition,
|
def countIssueGroupByLabels(owner: String, repository: String,
|
||||||
filterUser: Map[String, String])(implicit s: Session): Map[String, Int] = {
|
condition: IssueSearchCondition)(implicit s: Session): Map[String, Int] = {
|
||||||
|
|
||||||
searchIssueQuery(Seq(owner -> repository), condition.copy(labels = Set.empty), filterUser, false)
|
searchIssueQuery(Seq(owner -> repository), condition.copy(labels = Set.empty), false)
|
||||||
.innerJoin(IssueLabels).on { (t1, t2) =>
|
.innerJoin(IssueLabels).on { (t1, t2) =>
|
||||||
t1.byIssue(t2.userName, t2.repositoryName, t2.issueId)
|
t1.byIssue(t2.userName, t2.repositoryName, t2.issueId)
|
||||||
}
|
}
|
||||||
@@ -84,15 +82,14 @@ trait IssuesService {
|
|||||||
* If the issue does not exist, its repository is not included in the result.
|
* If the issue does not exist, its repository is not included in the result.
|
||||||
*
|
*
|
||||||
* @param condition the search condition
|
* @param condition the search condition
|
||||||
* @param filterUser the filter user name (key is "all", "assigned" or "created_by", value is the user name)
|
|
||||||
* @param onlyPullRequest if true then returns only pull request, false then returns both of issue and pull request.
|
* @param onlyPullRequest if true then returns only pull request, false then returns both of issue and pull request.
|
||||||
* @param repos Tuple of the repository owner and the repository name
|
* @param repos Tuple of the repository owner and the repository name
|
||||||
* @return list which contains issue count for each repository
|
* @return list which contains issue count for each repository
|
||||||
*/
|
*/
|
||||||
def countIssueGroupByRepository(
|
def countIssueGroupByRepository(
|
||||||
condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
|
condition: IssueSearchCondition, onlyPullRequest: Boolean,
|
||||||
repos: (String, String)*)(implicit s: Session): List[(String, String, Int)] = {
|
repos: (String, String)*)(implicit s: Session): List[(String, String, Int)] = {
|
||||||
searchIssueQuery(repos, condition.copy(repo = None), filterUser, onlyPullRequest)
|
searchIssueQuery(repos, condition.copy(repo = None), onlyPullRequest)
|
||||||
.groupBy { t =>
|
.groupBy { t =>
|
||||||
t.userName -> t.repositoryName
|
t.userName -> t.repositoryName
|
||||||
}
|
}
|
||||||
@@ -107,19 +104,18 @@ trait IssuesService {
|
|||||||
* Returns the search result against issues.
|
* Returns the search result against issues.
|
||||||
*
|
*
|
||||||
* @param condition the search condition
|
* @param condition the search condition
|
||||||
* @param filterUser the filter user name (key is "all", "assigned", "created_by" or "not_created_by", value is the user name)
|
|
||||||
* @param onlyPullRequest if true then returns only pull request, false then returns both of issue and pull request.
|
* @param onlyPullRequest if true then returns only pull request, false then returns both of issue and pull request.
|
||||||
* @param offset the offset for pagination
|
* @param offset the offset for pagination
|
||||||
* @param limit the limit for pagination
|
* @param limit the limit for pagination
|
||||||
* @param repos Tuple of the repository owner and the repository name
|
* @param repos Tuple of the repository owner and the repository name
|
||||||
* @return the search result (list of tuples which contain issue, labels and comment count)
|
* @return the search result (list of tuples which contain issue, labels and comment count)
|
||||||
*/
|
*/
|
||||||
def searchIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
|
def searchIssue(condition: IssueSearchCondition, onlyPullRequest: Boolean,
|
||||||
offset: Int, limit: Int, repos: (String, String)*)
|
offset: Int, limit: Int, repos: (String, String)*)
|
||||||
(implicit s: Session): List[IssueInfo] = {
|
(implicit s: Session): List[IssueInfo] = {
|
||||||
|
|
||||||
// get issues and comment count and labels
|
// get issues and comment count and labels
|
||||||
searchIssueQuery(repos, condition, filterUser, onlyPullRequest)
|
searchIssueQuery(repos, condition, onlyPullRequest)
|
||||||
.innerJoin(IssueOutline).on { (t1, t2) => t1.byIssue(t2.userName, t2.repositoryName, t2.issueId) }
|
.innerJoin(IssueOutline).on { (t1, t2) => t1.byIssue(t2.userName, t2.repositoryName, t2.issueId) }
|
||||||
.sortBy { case (t1, t2) =>
|
.sortBy { case (t1, t2) =>
|
||||||
(condition.sort match {
|
(condition.sort match {
|
||||||
@@ -161,7 +157,7 @@ trait IssuesService {
|
|||||||
* Assembles query for conditional issue searching.
|
* Assembles query for conditional issue searching.
|
||||||
*/
|
*/
|
||||||
private def searchIssueQuery(repos: Seq[(String, String)], condition: IssueSearchCondition,
|
private def searchIssueQuery(repos: Seq[(String, String)], condition: IssueSearchCondition,
|
||||||
filterUser: Map[String, String], onlyPullRequest: Boolean)(implicit s: Session) =
|
onlyPullRequest: Boolean)(implicit s: Session) =
|
||||||
Issues filter { t1 =>
|
Issues filter { t1 =>
|
||||||
condition.repo
|
condition.repo
|
||||||
.map { _.split('/') match { case array => Seq(array(0) -> array(1)) } }
|
.map { _.split('/') match { case array => Seq(array(0) -> array(1)) } }
|
||||||
@@ -171,9 +167,8 @@ trait IssuesService {
|
|||||||
(t1.closed === (condition.state == "closed").bind) &&
|
(t1.closed === (condition.state == "closed").bind) &&
|
||||||
(t1.milestoneId === condition.milestoneId.get.get.bind, condition.milestoneId.flatten.isDefined) &&
|
(t1.milestoneId === condition.milestoneId.get.get.bind, condition.milestoneId.flatten.isDefined) &&
|
||||||
(t1.milestoneId.? isEmpty, condition.milestoneId == Some(None)) &&
|
(t1.milestoneId.? isEmpty, condition.milestoneId == Some(None)) &&
|
||||||
(t1.assignedUserName === filterUser("assigned").bind, filterUser.get("assigned").isDefined) &&
|
(t1.assignedUserName === condition.assigned.get.bind, condition.assigned.isDefined) &&
|
||||||
(t1.openedUserName === filterUser("created_by").bind, filterUser.get("created_by").isDefined) &&
|
(t1.openedUserName === condition.author.get.bind, condition.author.isDefined) &&
|
||||||
(t1.openedUserName =!= filterUser("not_created_by").bind, filterUser.get("not_created_by").isDefined) &&
|
|
||||||
(t1.pullRequest === true.bind, onlyPullRequest) &&
|
(t1.pullRequest === true.bind, onlyPullRequest) &&
|
||||||
(IssueLabels filter { t2 =>
|
(IssueLabels filter { t2 =>
|
||||||
(t2.byIssue(t1.userName, t1.repositoryName, t1.issueId)) &&
|
(t2.byIssue(t1.userName, t1.repositoryName, t1.issueId)) &&
|
||||||
@@ -339,6 +334,8 @@ object IssuesService {
|
|||||||
case class IssueSearchCondition(
|
case class IssueSearchCondition(
|
||||||
labels: Set[String] = Set.empty,
|
labels: Set[String] = Set.empty,
|
||||||
milestoneId: Option[Option[Int]] = None,
|
milestoneId: Option[Option[Int]] = None,
|
||||||
|
author: Option[String] = None,
|
||||||
|
assigned: Option[String] = None,
|
||||||
repo: Option[String] = None,
|
repo: Option[String] = None,
|
||||||
state: String = "open",
|
state: String = "open",
|
||||||
sort: String = "created",
|
sort: String = "created",
|
||||||
@@ -351,6 +348,8 @@ object IssuesService {
|
|||||||
case Some(x) => x.toString
|
case Some(x) => x.toString
|
||||||
case None => "none"
|
case None => "none"
|
||||||
})},
|
})},
|
||||||
|
author .map(x => "author=" + urlEncode(x)),
|
||||||
|
assigned.map(x => "assigned=" + urlEncode(x)),
|
||||||
repo.map("for=" + urlEncode(_)),
|
repo.map("for=" + urlEncode(_)),
|
||||||
Some("state=" + urlEncode(state)),
|
Some("state=" + urlEncode(state)),
|
||||||
Some("sort=" + urlEncode(sort)),
|
Some("sort=" + urlEncode(sort)),
|
||||||
@@ -372,6 +371,8 @@ object IssuesService {
|
|||||||
case "none" => None
|
case "none" => None
|
||||||
case x => x.toIntOpt
|
case x => x.toIntOpt
|
||||||
},
|
},
|
||||||
|
param(request, "author"),
|
||||||
|
param(request, "assigned"),
|
||||||
param(request, "for"),
|
param(request, "for"),
|
||||||
param(request, "state", Seq("open", "closed")).getOrElse("open"),
|
param(request, "state", Seq("open", "closed")).getOrElse("open"),
|
||||||
param(request, "sort", Seq("created", "comments", "updated")).getOrElse("created"),
|
param(request, "sort", Seq("created", "comments", "updated")).getOrElse("created"),
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ class CommitLogHook(owner: String, repository: String, pusher: String, baseUrl:
|
|||||||
|
|
||||||
// Retrieve all issue count in the repository
|
// Retrieve all issue count in the repository
|
||||||
val issueCount =
|
val issueCount =
|
||||||
countIssue(IssueSearchCondition(state = "open"), Map.empty, false, owner -> repository) +
|
countIssue(IssueSearchCondition(state = "open"), false, owner -> repository) +
|
||||||
countIssue(IssueSearchCondition(state = "closed"), Map.empty, false, owner -> repository)
|
countIssue(IssueSearchCondition(state = "closed"), false, owner -> repository)
|
||||||
|
|
||||||
// Extract new commit and apply issue comment
|
// Extract new commit and apply issue comment
|
||||||
val defaultBranch = getRepository(owner, repository, baseUrl).get.repository.defaultBranch
|
val defaultBranch = getRepository(owner, repository, baseUrl).get.repository.defaultBranch
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
@(value: String = "", prefix: String = "", mini: Boolean = true, style: String = "", right: Boolean = false)(body: Html)
|
@(value : String = "",
|
||||||
|
prefix: String = "",
|
||||||
|
mini : Boolean = true,
|
||||||
|
style : String = "",
|
||||||
|
right : Boolean = false,
|
||||||
|
flat : Boolean = false)(body: Html)
|
||||||
<div class="btn-group"@if(style.nonEmpty){ style="@style"}>
|
<div class="btn-group"@if(style.nonEmpty){ style="@style"}>
|
||||||
<button class="btn dropdown-toggle@if(mini){ btn-mini} else { btn-small}" data-toggle="dropdown">
|
<button
|
||||||
|
@if(flat){style="border: none; background-color: #eee;"}
|
||||||
|
class="dropdown-toggle @if(!flat){btn} @if(mini){btn-mini} else {btn-small}" data-toggle="dropdown">
|
||||||
@if(value.isEmpty){
|
@if(value.isEmpty){
|
||||||
<i class="icon-cog"></i>
|
<i class="icon-cog"></i>
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
createdByCount: Option[Int],
|
createdByCount: Option[Int],
|
||||||
labelCounts: Map[String, Int],
|
labelCounts: Map[String, Int],
|
||||||
condition: service.IssuesService.IssueSearchCondition,
|
condition: service.IssuesService.IssueSearchCondition,
|
||||||
filter: String,
|
|
||||||
repository: service.RepositoryService.RepositoryInfo,
|
repository: service.RepositoryService.RepositoryInfo,
|
||||||
hasWritePermission: Boolean)(implicit context: app.Context)
|
hasWritePermission: Boolean)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
|
|||||||
@@ -76,10 +76,100 @@
|
|||||||
*@
|
*@
|
||||||
<table class="table table-bordered table-hover table-issues">
|
<table class="table table-bordered table-hover table-issues">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="padding-top: 10px; padding-bottom: 10px; background-color: #eee;">
|
<th style="background-color: #eee;">
|
||||||
<input type="checkbox"/>
|
<input type="checkbox"/>
|
||||||
<a class="button-link@if(condition.state == "open" ){ selected}" href="@condition.copy(state = "open" ).toURL">@openCount Open</a>
|
<a class="button-link@if(condition.state == "open" ){ selected}" href="@condition.copy(state = "open" ).toURL">@openCount Open</a>
|
||||||
<a class="button-link@if(condition.state == "closed"){ selected}" href="@condition.copy(state = "closed").toURL">@closedCount Closed</a>
|
<a class="button-link@if(condition.state == "closed"){ selected}" href="@condition.copy(state = "closed").toURL">@closedCount Closed</a>
|
||||||
|
<div class="pull-right">
|
||||||
|
@helper.html.dropdown("Author", flat = true) {
|
||||||
|
@collaborators.map { collaborator =>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(author = (if(condition.author == Some(collaborator)) None else Some(collaborator))).toURL">
|
||||||
|
@helper.html.checkicon(condition.author == Some(collaborator))
|
||||||
|
@avatar(collaborator, 20) @collaborator
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@helper.html.dropdown("Label", flat = true) {
|
||||||
|
@labels.map { label =>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(labels = (if(condition.labels.contains(label.labelName)) condition.labels - label.labelName else condition.labels + label.labelName)).toURL">
|
||||||
|
@helper.html.checkicon(condition.labels.contains(label.labelName))
|
||||||
|
<span style="background-color: #@label.color;" class="label-color"> </span>
|
||||||
|
@label.labelName
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@helper.html.dropdown("Milestone", flat = true) {
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(milestoneId = Some(None)).toURL">
|
||||||
|
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
|
||||||
|
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@helper.html.dropdown("Assignee", flat = true) {
|
||||||
|
@collaborators.map { collaborator =>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(assigned = Some(collaborator)).toURL">
|
||||||
|
@helper.html.checkicon(condition.assigned == Some(collaborator))
|
||||||
|
@avatar(collaborator, 20) @collaborator
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@helper.html.dropdown(
|
||||||
|
value = (condition.sort, condition.direction) match {
|
||||||
|
case ("created" , "desc") => "Newest"
|
||||||
|
case ("created" , "asc" ) => "Oldest"
|
||||||
|
case ("comments", "desc") => "Most commented"
|
||||||
|
case ("comments", "asc" ) => "Least commented"
|
||||||
|
case ("updated" , "desc") => "Recently updated"
|
||||||
|
case ("updated" , "asc" ) => "Least recently updated"
|
||||||
|
},
|
||||||
|
prefix = "Sort",
|
||||||
|
flat = true
|
||||||
|
){
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(sort="created", direction="desc").toURL">
|
||||||
|
@helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(sort="created", direction="asc" ).toURL">
|
||||||
|
@helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(sort="comments", direction="desc").toURL">
|
||||||
|
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(sort="comments", direction="asc" ).toURL">
|
||||||
|
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(sort="updated", direction="desc").toURL">
|
||||||
|
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="@condition.copy(sort="updated", direction="asc" ).toURL">
|
||||||
|
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@if(issues.isEmpty){
|
@if(issues.isEmpty){
|
||||||
|
|||||||
Reference in New Issue
Block a user