diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-28 09:16:12 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-28 09:16:12 -0400 |
commit | 63dae435f9d99a58b5e6c034dd2e405239f8480d (patch) | |
tree | 25e981cb58298200856daa2f58e0af9140748342 /routers/repo | |
parent | 76b864234857ec01613db78ed19868a91795e99b (diff) | |
download | gitea-63dae435f9d99a58b5e6c034dd2e405239f8480d.tar.gz gitea-63dae435f9d99a58b5e6c034dd2e405239f8480d.zip |
Bug fix
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/issue.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 77e35bbae6..c3d1a0d960 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -40,9 +40,7 @@ func Issues(ctx *middleware.Context) { ctx.Redirect("/user/login/", 302) return } - posterId = ctx.User.Id ctx.Data["ViewType"] = "created_by" - ctx.Data["IssueCreatedCount"] = models.GetUserIssueCount(posterId, ctx.Repo.Repository.Id) } // Get issues. @@ -53,6 +51,11 @@ func Issues(ctx *middleware.Context) { return } + if ctx.IsSigned { + posterId = ctx.User.Id + } + var createdByCount int + // Get posters. for i := range issues { u, err := models.GetUserById(issues[i].PosterId) @@ -61,12 +64,16 @@ func Issues(ctx *middleware.Context) { return } issues[i].Poster = u + if u.Id == posterId { + createdByCount++ + } } ctx.Data["Issues"] = issues ctx.Data["IssueCount"] = ctx.Repo.Repository.NumIssues ctx.Data["OpenCount"] = ctx.Repo.Repository.NumIssues - ctx.Repo.Repository.NumClosedIssues ctx.Data["ClosedCount"] = ctx.Repo.Repository.NumClosedIssues + ctx.Data["IssueCreatedCount"] = createdByCount ctx.Data["IsShowClosed"] = ctx.Query("state") == "closed" ctx.HTML(200, "issue/list") } |