From 474b7ec155c47acfd3a49bef5317b278ebfc764c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 28 Jan 2023 17:11:52 +0800 Subject: [PATCH 1/8] Fix issues list page project assign to org/user level projects and fix bug which only list open/closed projects --- routers/web/repo/issue.go | 14 +++----------- templates/repo/issue/list.tmpl | 30 +++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index edd9821ac783f..b6d575927e93d 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -362,17 +362,9 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti return 0 } - if ctx.Repo.CanWriteIssuesOrPulls(ctx.Params(":type") == "pulls") { - projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{ - RepoID: repo.ID, - Type: project_model.TypeRepository, - IsClosed: util.OptionalBoolOf(isShowClosed), - }) - if err != nil { - ctx.ServerError("GetProjects", err) - return - } - ctx.Data["Projects"] = projects + retrieveProjects(ctx, repo) + if ctx.Written() { + return } ctx.Data["IssueStats"] = issueStats diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index ad0ce50ec15fb..2e195a8c36b97 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -205,18 +205,38 @@ -