mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
(refs #488)Add service.IssuesService.IssueInfo
This commit is contained in:
@@ -116,7 +116,7 @@ trait IssuesService {
|
||||
*/
|
||||
def searchIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
|
||||
offset: Int, limit: Int, repos: (String, String)*)
|
||||
(implicit s: Session): List[(Issue, List[Label], Option[String], Int)] = {
|
||||
(implicit s: Session): List[IssueInfo] = {
|
||||
|
||||
// get issues and comment count and labels
|
||||
searchIssueQuery(repos, condition, filterUser, onlyPullRequest)
|
||||
@@ -148,7 +148,7 @@ trait IssuesService {
|
||||
}
|
||||
.map { issues => issues.head match {
|
||||
case (issue, commentCount, _, _, _, milestone) =>
|
||||
(issue,
|
||||
IssueInfo(issue,
|
||||
issues.flatMap { t => t._3.map (
|
||||
Label(issue.userName, issue.repositoryName, _, t._4.get, t._5.get)
|
||||
)} toList,
|
||||
@@ -385,4 +385,6 @@ object IssuesService {
|
||||
}
|
||||
}
|
||||
|
||||
case class IssueInfo(issue: Issue, labels: List[Label], milestone: Option[String], commentCount: Int)
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
|
||||
@(issues: List[service.IssuesService.IssueInfo],
|
||||
page: Int,
|
||||
openCount: Int,
|
||||
closedCount: Int,
|
||||
@@ -10,7 +10,7 @@
|
||||
hasWritePermission: Boolean = false)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
|
||||
@import service.IssuesService.IssueInfo
|
||||
<div class="span9">
|
||||
@if(condition.labels.nonEmpty || condition.milestoneId.isDefined){
|
||||
<a href="@condition.copy(labels = Set.empty, milestoneId = None).toURL" id="clear-filter">
|
||||
@@ -135,7 +135,7 @@
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
@issues.map { case (issue, labels, milestone, commentCount) =>
|
||||
@issues.map { case IssueInfo(issue, labels, milestone, commentCount) =>
|
||||
<tr>
|
||||
<td>
|
||||
@if(hasWritePermission){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
|
||||
@(issues: List[service.IssuesService.IssueInfo],
|
||||
page: Int,
|
||||
openCount: Int,
|
||||
closedCount: Int,
|
||||
@@ -7,6 +7,7 @@
|
||||
hasWritePermission: Boolean)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@import service.IssuesService.IssueInfo
|
||||
<div class="span9">
|
||||
@repository.map { repository =>
|
||||
@if(hasWritePermission){
|
||||
@@ -71,7 +72,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@issues.map { case (issue, labels, milestone, commentCount) =>
|
||||
@issues.map { case IssueInfo(issue, labels, milestone, commentCount) =>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
|
||||
@(issues: List[service.IssuesService.IssueInfo],
|
||||
page: Int,
|
||||
collaborators: List[String],
|
||||
milestones: List[model.Milestone],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
|
||||
@(issues: List[service.IssuesService.IssueInfo],
|
||||
page: Int,
|
||||
openCount: Int,
|
||||
closedCount: Int,
|
||||
@@ -10,7 +10,7 @@
|
||||
hasWritePermission: Boolean = false)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
|
||||
@import service.IssuesService.IssueInfo
|
||||
<div class="span12">
|
||||
@*
|
||||
@if(condition.labels.nonEmpty || condition.milestoneId.isDefined){
|
||||
@@ -146,7 +146,7 @@
|
||||
}
|
||||
*@
|
||||
}
|
||||
@issues.map { case (issue, labels, milestone, commentCount) =>
|
||||
@issues.map { case IssueInfo(issue, labels, milestone, commentCount) =>
|
||||
<tr>
|
||||
<td style="padding-top: 15px; padding-bottom: 15px;">
|
||||
@if(hasWritePermission){
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<li@if(active == "issues" ){ class="active"}><a href="@url(repository)/issues">Issues</a></li>
|
||||
<li@if(active == "pulls" ){ class="active"}><a href="@url(repository)/pulls">Pull requests</a></li>
|
||||
<li@if(active == "labels" ){ class="active"}><a href="@url(repository)/labels">Labels</a></li>
|
||||
<li@if(active == "milestones"){ class="active"}><a href="@url(repository)/milestones">Milestones</a></li>
|
||||
<li@if(active == "milestones"){ class="active"}><a href="@url(repository)/issues/milestones">Milestones</a></li>
|
||||
@if(loginAccount.isDefined){
|
||||
<li class="pull-right">
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
|
||||
@(issues: List[service.IssuesService.IssueInfo],
|
||||
counts: List[service.PullRequestService.PullRequestCount],
|
||||
filter: Option[String],
|
||||
page: Int,
|
||||
@@ -10,6 +10,7 @@
|
||||
hasWritePermission: Boolean)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@import service.IssuesService.IssueInfo
|
||||
@html.main(s"Pull Requests - ${repository.owner}/${repository.name}", Some(repository)){
|
||||
@html.menu("pulls", repository){
|
||||
<div class="row-fluid">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
|
||||
@(issues: List[service.IssuesService.IssueInfo],
|
||||
page: Int,
|
||||
openCount: Int,
|
||||
closedCount: Int,
|
||||
@@ -7,6 +7,7 @@
|
||||
hasWritePermission: Boolean)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@import service.IssuesService.IssueInfo
|
||||
<div class="span9">
|
||||
@repository.map { repository =>
|
||||
@if(hasWritePermission){
|
||||
@@ -71,7 +72,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@issues.map { case (issue, labels, milestone, commentCount) =>
|
||||
@issues.map { case IssueInfo(issue, labels, milestone, commentCount) =>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/>
|
||||
|
||||
Reference in New Issue
Block a user