mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-22 08:59:55 +08:00
Respect UI.ExploreDefaultSort setting again (#32357)
fix regression of https://github.com/go-gitea/gitea/pull/29430 --- *Sponsored by Kithara Software GmbH*
This commit is contained in:
parent
ce4d909bd6
commit
58eb16eda7
|
@ -9,6 +9,7 @@ import (
|
||||||
"code.gitea.io/gitea/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/structs"
|
"code.gitea.io/gitea/modules/structs"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
"code.gitea.io/gitea/services/context"
|
"code.gitea.io/gitea/services/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ func Organizations(ctx *context.Context) {
|
||||||
)
|
)
|
||||||
sortOrder := ctx.FormString("sort")
|
sortOrder := ctx.FormString("sort")
|
||||||
if sortOrder == "" {
|
if sortOrder == "" {
|
||||||
sortOrder = "newest"
|
sortOrder = util.Iif(supportedSortOrders.Contains(setting.UI.ExploreDefaultSort), setting.UI.ExploreDefaultSort, "newest")
|
||||||
ctx.SetFormString("sort", sortOrder)
|
ctx.SetFormString("sort", sortOrder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import (
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/sitemap"
|
"code.gitea.io/gitea/modules/sitemap"
|
||||||
"code.gitea.io/gitea/modules/structs"
|
"code.gitea.io/gitea/modules/structs"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
"code.gitea.io/gitea/services/context"
|
"code.gitea.io/gitea/services/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -149,7 +150,7 @@ func Users(ctx *context.Context) {
|
||||||
)
|
)
|
||||||
sortOrder := ctx.FormString("sort")
|
sortOrder := ctx.FormString("sort")
|
||||||
if sortOrder == "" {
|
if sortOrder == "" {
|
||||||
sortOrder = "newest"
|
sortOrder = util.Iif(supportedSortOrders.Contains(setting.UI.ExploreDefaultSort), setting.UI.ExploreDefaultSort, "newest")
|
||||||
ctx.SetFormString("sort", sortOrder)
|
ctx.SetFormString("sort", sortOrder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user