1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Allow to filter repositories by language in explore, user and organization repositories lists (#18430)

This commit is contained in:
Lauris BH
2022-01-28 13:29:04 +02:00
committed by GitHub
parent 401e5c8174
commit 604ce77628
6 changed files with 43 additions and 11 deletions

View File

@@ -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)