(refs #488)Displays the milestone on the issue list.

This commit is contained in:
Naoki Takezoe
2014-09-20 03:02:52 +09:00
parent f4e4506517
commit 3b1367dd8e
7 changed files with 19 additions and 16 deletions

View File

@@ -116,7 +116,7 @@ trait IssuesService {
*/ */
def searchIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean, def searchIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
offset: Int, limit: Int, repos: (String, String)*) offset: Int, limit: Int, repos: (String, String)*)
(implicit s: Session): List[(Issue, List[Label], Int)] = { (implicit s: Session): List[(Issue, List[Label], Option[String], Int)] = {
// get issues and comment count and labels // get issues and comment count and labels
searchIssueQuery(repos, condition, filterUser, onlyPullRequest) searchIssueQuery(repos, condition, filterUser, onlyPullRequest)
@@ -136,21 +136,23 @@ trait IssuesService {
.drop(offset).take(limit) .drop(offset).take(limit)
.leftJoin (IssueLabels) .on { case ((t1, t2), t3) => t1.byIssue(t3.userName, t3.repositoryName, t3.issueId) } .leftJoin (IssueLabels) .on { case ((t1, t2), t3) => t1.byIssue(t3.userName, t3.repositoryName, t3.issueId) }
.leftJoin (Labels) .on { case (((t1, t2), t3), t4) => t3.byLabel(t4.userName, t4.repositoryName, t4.labelId) } .leftJoin (Labels) .on { case (((t1, t2), t3), t4) => t3.byLabel(t4.userName, t4.repositoryName, t4.labelId) }
.map { case (((t1, t2), t3), t4) => .leftJoin (Milestones) .on { case ((((t1, t2), t3), t4), t5) => t1.byMilestone(t5.userName, t5.repositoryName, t5.milestoneId) }
(t1, t2.commentCount, t4.labelId.?, t4.labelName.?, t4.color.?) .map { case ((((t1, t2), t3), t4), t5) =>
(t1, t2.commentCount, t4.labelId.?, t4.labelName.?, t4.color.?, t5.title.?)
} }
.list .list
.splitWith { (c1, c2) => .splitWith { (c1, c2) =>
c1._1.userName == c2._1.userName && c1._1.userName == c2._1.userName &&
c1._1.repositoryName == c2._1.repositoryName && c1._1.repositoryName == c2._1.repositoryName &&
c1._1.issueId == c2._1.issueId c1._1.issueId == c2._1.issueId
} }
.map { issues => issues.head match { .map { issues => issues.head match {
case (issue, commentCount, _,_,_) => case (issue, commentCount, _, _, _, milestone) =>
(issue, (issue,
issues.flatMap { t => t._3.map ( issues.flatMap { t => t._3.map (
Label(issue.userName, issue.repositoryName, _, t._4.get, t._5.get) Label(issue.userName, issue.repositoryName, _, t._4.get, t._5.get)
)} toList, )} toList,
milestone,
commentCount) commentCount)
}} toList }} toList
} }

View File

@@ -1,4 +1,4 @@
@(issues: List[(model.Issue, List[model.Label], Int)], @(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
page: Int, page: Int,
openCount: Int, openCount: Int,
closedCount: Int, closedCount: Int,
@@ -135,7 +135,7 @@
</tr> </tr>
} }
} }
@issues.map { case (issue, labels, commentCount) => @issues.map { case (issue, labels, milestone, commentCount) =>
<tr> <tr>
<td> <td>
@if(hasWritePermission){ @if(hasWritePermission){

View File

@@ -1,4 +1,4 @@
@(issues: List[(model.Issue, List[model.Label], Int)], @(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
page: Int, page: Int,
openCount: Int, openCount: Int,
closedCount: Int, closedCount: Int,
@@ -71,7 +71,7 @@
</td> </td>
</tr> </tr>
} }
@issues.map { case (issue, labels, commentCount) => @issues.map { case (issue, labels, milestone, commentCount) =>
<tr> <tr>
<td> <td>
<img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/> <img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/>

View File

@@ -1,4 +1,4 @@
@(issues: List[(model.Issue, List[model.Label], Int)], @(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
page: Int, page: Int,
collaborators: List[String], collaborators: List[String],
milestones: List[model.Milestone], milestones: List[model.Milestone],

View File

@@ -1,4 +1,4 @@
@(issues: List[(model.Issue, List[model.Label], Int)], @(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
page: Int, page: Int,
openCount: Int, openCount: Int,
closedCount: Int, closedCount: Int,
@@ -146,7 +146,7 @@
} }
*@ *@
} }
@issues.map { case (issue, labels, commentCount) => @issues.map { case (issue, labels, milestone, commentCount) =>
<tr> <tr>
<td style="padding-top: 15px; padding-bottom: 15px;"> <td style="padding-top: 15px; padding-bottom: 15px;">
@if(hasWritePermission){ @if(hasWritePermission){
@@ -177,6 +177,7 @@
</span> </span>
<div class="small muted" style="margin-left: 40px; margin-top: 5px;"> <div class="small muted" style="margin-left: 40px; margin-top: 5px;">
#@issue.issueId opened by @user(issue.openedUserName, styleClass="username") @datetime(issue.registeredDate) #@issue.issueId opened by @user(issue.openedUserName, styleClass="username") @datetime(issue.registeredDate)
<span style="margin: 20px;"><a href="@condition.copy(milestoneId = Some(Some(1))).toURL" class="username">@milestone</a></span>
</div> </div>
@if(hasWritePermission){ @if(hasWritePermission){
</label> </label>

View File

@@ -1,4 +1,4 @@
@(issues: List[(model.Issue, List[model.Label], Int)], @(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
counts: List[service.PullRequestService.PullRequestCount], counts: List[service.PullRequestService.PullRequestCount],
filter: Option[String], filter: Option[String],
page: Int, page: Int,

View File

@@ -1,4 +1,4 @@
@(issues: List[(model.Issue, List[model.Label], Int)], @(issues: List[(model.Issue, List[model.Label], Option[String], Int)],
page: Int, page: Int,
openCount: Int, openCount: Int,
closedCount: Int, closedCount: Int,
@@ -71,7 +71,7 @@
</td> </td>
</tr> </tr>
} }
@issues.map { case (issue, labels, commentCount) => @issues.map { case (issue, labels, milestone, commentCount) =>
<tr> <tr>
<td> <td>
<img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/> <img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/>