diff options
author | Elias Norberg <elias@aisle.se> | 2019-04-02 21:54:29 +0200 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-04-02 15:54:29 -0400 |
commit | bf5af87eef8913004df63aef58f71628f9c057d0 (patch) | |
tree | 9f49b1076a95d0ebc961a71a3ebb5d146c5d64c3 /routers/user | |
parent | 09fb036ad625ec5178319c30df47aac313fdbbe3 (diff) | |
download | gitea-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.go | 6 |
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) |