loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix the route for pull-request's authors (#26016)

Close #25906

![image](https://github.com/go-gitea/gitea/assets/2114189/e689f3e1-9a90-46c0-89f4-2d61394d34d3)


Succeeded logs:

```
[I] router: completed GET /root/test/issues/posters?&q=%20&_=1689853025011 for [::1]:59271, 200 OK in 127.7ms @ repo/issue.go:3505(repo.IssuePosters)


[I] router: completed GET /root/test/pulls/posters?&q=%20&_=1689853968204 for [::1]:59269, 200 OK in 94.3ms @ repo/issue.go:3509(repo.PullPosters)
```

authored by

wxiaoguang and committed by
GitHub
af22f33a ec227d66

+11 -5
+8 -1
routers/web/repo/issue.go
··· 3503 3503 3504 3504 // IssuePosters get posters for current repo's issues/pull requests 3505 3505 func IssuePosters(ctx *context.Context) { 3506 + issuePosters(ctx, false) 3507 + } 3508 + 3509 + func PullPosters(ctx *context.Context) { 3510 + issuePosters(ctx, true) 3511 + } 3512 + 3513 + func issuePosters(ctx *context.Context, isPullList bool) { 3506 3514 repo := ctx.Repo.Repository 3507 - isPullList := ctx.Params(":type") == "pulls" 3508 3515 search := strings.TrimSpace(ctx.FormString("q")) 3509 3516 posters, err := repo_model.GetIssuePostersWithSearch(ctx, repo, isPullList, search, setting.UI.DefaultShowFullName) 3510 3517 if err != nil {
+3 -4
routers/web/web.go
··· 1151 1151 1152 1152 m.Group("/{username}/{reponame}", func() { 1153 1153 m.Group("", func() { 1154 - m.Group("/{type:issues|pulls}", func() { 1155 - m.Get("", repo.Issues) 1156 - m.Get("/posters", repo.IssuePosters) 1157 - }) 1154 + m.Get("/issues/posters", repo.IssuePosters) // it can't use {type:issues|pulls} because other routes like "/pulls/{index}" has higher priority 1155 + m.Get("/{type:issues|pulls}", repo.Issues) 1158 1156 m.Get("/{type:issues|pulls}/{index}", repo.ViewIssue) 1159 1157 m.Group("/{type:issues|pulls}/{index}/content-history", func() { 1160 1158 m.Get("/overview", repo.GetContentHistoryOverview) ··· 1276 1274 return cancel 1277 1275 }) 1278 1276 1277 + m.Get("/pulls/posters", repo.PullPosters) 1279 1278 m.Group("/pulls/{index}", func() { 1280 1279 m.Get("", repo.SetWhitespaceBehavior, repo.GetPullDiffStats, repo.ViewIssue) 1281 1280 m.Get(".diff", repo.DownloadPullDiff)