fix(code-search): fix broken pagination. (#9000)

Missing parameters for:
- repo: path and mode
- user: mode
- explore: mode

resolves forgejo/forgejo!8997 and codeberg/community!2098

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9000): <!--number 9000 --><!--line 0 --><!--description Zml4KGNvZGUtc2VhcmNoKTogZml4IGJyb2tlbiBwYWdpbmF0aW9uLg==-->fix(code-search): fix broken pagination.<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9000
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
This commit is contained in:
Shiny Nematoda 2025-08-23 13:06:41 +02:00 committed by Earl Warren
commit ecda48307d
4 changed files with 44 additions and 2 deletions

View file

@ -147,6 +147,7 @@ func Code(ctx *context.Context) {
pager := context.NewPagination(total, setting.UI.RepoSearchPagingNum, page, 5)
pager.SetDefaultParams(ctx)
pager.AddParam(ctx, "l", "Language")
pager.AddParam(ctx, "mode", "CodeSearchMode")
ctx.Data["Page"] = pager
ctx.HTML(http.StatusOK, tplExploreCode)

View file

@ -165,6 +165,8 @@ func Search(ctx *context.Context) {
pager := context.NewPagination(total, setting.UI.RepoSearchPagingNum, page, 5)
pager.SetDefaultParams(ctx)
pager.AddParam(ctx, "l", "Language")
pager.AddParam(ctx, "mode", "CodeSearchMode")
pager.AddParam(ctx, "path", "CodeSearchPath")
ctx.Data["Page"] = pager
ctx.HTML(http.StatusOK, tplSearch)

View file

@ -131,6 +131,7 @@ func CodeSearch(ctx *context.Context) {
pager := context.NewPagination(total, setting.UI.RepoSearchPagingNum, page, 5)
pager.SetDefaultParams(ctx)
pager.AddParam(ctx, "l", "Language")
pager.AddParam(ctx, "mode", "CodeSearchMode")
ctx.Data["Page"] = pager
ctx.HTML(http.StatusOK, tplUserCode)