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:
@@ -232,6 +232,10 @@ func Profile(ctx *context.Context) {
|
||||
|
||||
keyword := ctx.FormTrim("q")
|
||||
ctx.Data["Keyword"] = keyword
|
||||
|
||||
language := ctx.FormTrim("language")
|
||||
ctx.Data["Language"] = language
|
||||
|
||||
switch tab {
|
||||
case "followers":
|
||||
items, err := user_model.GetUserFollowers(ctxUser, db.ListOptions{
|
||||
@@ -283,6 +287,7 @@ func Profile(ctx *context.Context) {
|
||||
StarredByID: ctxUser.ID,
|
||||
Collaborate: util.OptionalBoolFalse,
|
||||
TopicOnly: topicOnly,
|
||||
Language: language,
|
||||
IncludeDescription: setting.UI.SearchRepoDescription,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -314,6 +319,7 @@ func Profile(ctx *context.Context) {
|
||||
WatchedByID: ctxUser.ID,
|
||||
Collaborate: util.OptionalBoolFalse,
|
||||
TopicOnly: topicOnly,
|
||||
Language: language,
|
||||
IncludeDescription: setting.UI.SearchRepoDescription,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -335,6 +341,7 @@ func Profile(ctx *context.Context) {
|
||||
Private: ctx.IsSigned,
|
||||
Collaborate: util.OptionalBoolFalse,
|
||||
TopicOnly: topicOnly,
|
||||
Language: language,
|
||||
IncludeDescription: setting.UI.SearchRepoDescription,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -349,6 +356,9 @@ func Profile(ctx *context.Context) {
|
||||
|
||||
pager := context.NewPagination(total, setting.UI.User.RepoPagingNum, page, 5)
|
||||
pager.SetDefaultParams(ctx)
|
||||
if tab != "followers" && tab != "following" && tab != "activity" && tab != "projects" {
|
||||
pager.AddParam(ctx, "language", "Language")
|
||||
}
|
||||
ctx.Data["Page"] = pager
|
||||
|
||||
ctx.Data["ShowUserEmail"] = len(ctxUser.Email) > 0 && ctx.IsSigned && (!ctxUser.KeepEmailPrivate || ctxUser.ID == ctx.User.ID)
|
||||
|
Reference in New Issue
Block a user