diff options
author | yp05327 <576951401@qq.com> | 2024-09-02 16:58:18 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-02 07:58:18 +0000 |
commit | cc1520221a9689b4725b0e8668ce58f95e787130 (patch) | |
tree | 36becc1f0f836a7e67ec204a63354ef890c1c7cf | |
parent | b5500cded1e4636f94878705a77510b64167cdd0 (diff) | |
download | gitea-cc1520221a9689b4725b0e8668ce58f95e787130.tar.gz gitea-cc1520221a9689b4725b0e8668ce58f95e787130.zip |
Fix sort order for organization home and user profile page (#31921) (#31922)
Backport #31921
-rw-r--r-- | routers/web/org/home.go | 4 | ||||
-rw-r--r-- | routers/web/user/profile.go | 4 |
2 files changed, 8 insertions, 0 deletions
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 |