summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorElias Norberg <elias@aisle.se>2019-04-02 21:54:29 +0200
committertechknowlogick <matti@mdranta.net>2019-04-02 15:54:29 -0400
commitbf5af87eef8913004df63aef58f71628f9c057d0 (patch)
tree9f49b1076a95d0ebc961a71a3ebb5d146c5d64c3 /routers/user
parent09fb036ad625ec5178319c30df47aac313fdbbe3 (diff)
downloadgitea-bf5af87eef8913004df63aef58f71628f9c057d0.tar.gz
gitea-bf5af87eef8913004df63aef58f71628f9c057d0.zip
Show last commit status in pull request lists (#6465)
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/home.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index c4e169befd..740a9edc4e 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -319,8 +319,13 @@ func Issues(ctx *context.Context) {
return
}
+ var commitStatus = make(map[int64]*models.CommitStatus, len(issues))
for _, issue := range issues {
issue.Repo = showReposMap[issue.RepoID]
+
+ if isPullList {
+ commitStatus[issue.PullRequest.ID], _ = issue.PullRequest.GetLastCommitStatus()
+ }
}
issueStats, err := models.GetUserIssueStats(models.UserIssueStatsOptions{
@@ -344,6 +349,7 @@ func Issues(ctx *context.Context) {
}
ctx.Data["Issues"] = issues
+ ctx.Data["CommitStatus"] = commitStatus
ctx.Data["Repos"] = showRepos
ctx.Data["Counts"] = counts
ctx.Data["Page"] = paginater.New(total, setting.UI.IssuePagingNum, page, 5)