From cc1520221a9689b4725b0e8668ce58f95e787130 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Mon, 2 Sep 2024 16:58:18 +0900 Subject: [PATCH] Fix sort order for organization home and user profile page (#31921) (#31922) Backport #31921 --- routers/web/org/home.go | 4 ++++ routers/web/user/profile.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/routers/web/org/home.go b/routers/web/org/home.go index 1e04b72cbb..1fa732a715 100644 --- a/routers/web/org/home.go +++ b/routers/web/org/home.go @@ -70,6 +70,10 @@ func Home(ctx *context.Context) { orderBy = db.SearchOrderByForksReverse case "fewestforks": orderBy = db.SearchOrderByForks + case "size": + orderBy = db.SearchOrderByGitSize + case "reversesize": + orderBy = db.SearchOrderByGitSizeReverse default: ctx.Data["SortType"] = "recentupdate" orderBy = db.SearchOrderByRecentUpdated diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index 3f91233ee6..b33a814b91 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -132,6 +132,10 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb orderBy = db.SearchOrderByForksReverse case "fewestforks": orderBy = db.SearchOrderByForks + case "size": + orderBy = db.SearchOrderByGitSize + case "reversesize": + orderBy = db.SearchOrderByGitSizeReverse default: ctx.Data["SortType"] = "recentupdate" orderBy = db.SearchOrderByRecentUpdated -- 2.39.5