Allow to filter repositories by language in explore, user and organization repositories lists (#18430)
This commit is contained in:
parent
401e5c8174
commit
604ce77628
6 changed files with 43 additions and 11 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue