Merge remote-tracking branch 'upstream/main' into limit-repo-size

This commit is contained in:
DmitryFrolovTri committed 2023-12-02 08:38:29 +00:00
commit e1267d5624
550 files changed
+3490 -2005

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ func Organizations(ctx *context.Context) {
}
if ctx.FormString("sort") == "" {
ctx.SetFormString("sort", UserSearchDefaultSortType)
ctx.SetFormString("sort", setting.UI.ExploreDefaultSort)
}
RenderUserSearch(ctx, &user_model.SearchUserOptions{
+7 -2
View File
@@ -57,8 +57,13 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
orderBy db.SearchOrderBy
)
ctx.Data["SortType"] = ctx.FormString("sort")
switch ctx.FormString("sort") {
sortOrder := ctx.FormString("sort")
if sortOrder == "" {
sortOrder = setting.UI.ExploreDefaultSort
}
ctx.Data["SortType"] = sortOrder
switch sortOrder {
case "newest":
orderBy = db.SearchOrderByNewest
case "oldest":
+8 -9
View File
@@ -23,12 +23,6 @@ const (
tplExploreUsers base.TplName = "explore/users"
)
// UserSearchDefaultSortType is the default sort type for user search
const (
UserSearchDefaultSortType = "recentupdate"
UserSearchDefaultAdminSort = "alphabetically"
)
var nullByte = []byte{0x00}
func isKeywordValid(keyword string) bool {
@@ -60,8 +54,13 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions,
// we can not set orderBy to `models.SearchOrderByXxx`, because there may be a JOIN in the statement, different tables may have the same name columns
ctx.Data["SortType"] = ctx.FormString("sort")
switch ctx.FormString("sort") {
sortOrder := ctx.FormString("sort")
if sortOrder == "" {
sortOrder = setting.UI.ExploreDefaultSort
}
ctx.Data["SortType"] = sortOrder
switch sortOrder {
case "newest":
orderBy = "`user`.id DESC"
case "oldest":
@@ -134,7 +133,7 @@ func Users(ctx *context.Context) {
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
if ctx.FormString("sort") == "" {
ctx.SetFormString("sort", UserSearchDefaultSortType)
ctx.SetFormString("sort", setting.UI.ExploreDefaultSort)
}
RenderUserSearch(ctx, &user_model.SearchUserOptions{