diff options
author | Lauris BH <lauris@nix.lv> | 2022-01-28 13:29:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 13:29:04 +0200 |
commit | 604ce776287545b31991f0c78b13854b36ed2f59 (patch) | |
tree | 6a3cb4ce33d8b4044548c0841730884384b41881 /routers/web/org/home.go | |
parent | 401e5c817474436218af08602da5135774d2c0eb (diff) | |
download | gitea-604ce776287545b31991f0c78b13854b36ed2f59.tar.gz gitea-604ce776287545b31991f0c78b13854b36ed2f59.zip |
Allow to filter repositories by language in explore, user and organization repositories lists (#18430)
Diffstat (limited to 'routers/web/org/home.go')
-rw-r--r-- | routers/web/org/home.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/web/org/home.go b/routers/web/org/home.go index cf23a1e291..d07e2993b2 100644 --- a/routers/web/org/home.go +++ b/routers/web/org/home.go @@ -83,6 +83,9 @@ func Home(ctx *context.Context) { keyword := ctx.FormTrim("q") ctx.Data["Keyword"] = keyword + language := ctx.FormTrim("language") + ctx.Data["Language"] = language + page := ctx.FormInt("page") if page <= 0 { page = 1 @@ -103,6 +106,7 @@ func Home(ctx *context.Context) { OrderBy: orderBy, Private: ctx.IsSigned, Actor: ctx.User, + Language: language, IncludeDescription: setting.UI.SearchRepoDescription, }) if err != nil { @@ -148,6 +152,7 @@ func Home(ctx *context.Context) { pager := context.NewPagination(int(count), setting.UI.User.RepoPagingNum, page, 5) pager.SetDefaultParams(ctx) + pager.AddParam(ctx, "language", "Language") ctx.Data["Page"] = pager ctx.HTML(http.StatusOK, tplOrgHome) |