]> source.dussan.org Git - gitea.git/commitdiff
Fix `recentupdate` sorting bugs (#32505)
authorZettat123 <zettat123@gmail.com>
Fri, 15 Nov 2024 04:36:22 +0000 (12:36 +0800)
committerGitHub <noreply@github.com>
Fri, 15 Nov 2024 04:36:22 +0000 (04:36 +0000)
Fix #32499

- Add the missing `recentupdate` to `OrderByFlatMap`
- Assign default value(`recentupdate`) to `EXPLORE_PAGING_DEFAULT_SORT`

models/repo/search.go
modules/setting/ui.go

index a73d9fc21536e412f5e06a17538d372c58291a7a..ffb8e26745ab52c069729d2397df576e86aec128 100644 (file)
@@ -36,6 +36,7 @@ var OrderByMap = map[string]map[string]db.SearchOrderBy{
 var OrderByFlatMap = map[string]db.SearchOrderBy{
        "newest":                OrderByMap["desc"]["created"],
        "oldest":                OrderByMap["asc"]["created"],
+       "recentupdate":          OrderByMap["desc"]["updated"],
        "leastupdate":           OrderByMap["asc"]["updated"],
        "reversealphabetically": OrderByMap["desc"]["alpha"],
        "alphabetically":        OrderByMap["asc"]["alpha"],
index a8dc11d09713c59cb476b1848341754cd2b01892..db0fe9ef79ac0106ed1f7dcb69051096b3e662dc 100644 (file)
@@ -86,6 +86,7 @@ var UI = struct {
        Reactions:               []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`},
        CustomEmojis:            []string{`git`, `gitea`, `codeberg`, `gitlab`, `github`, `gogs`},
        CustomEmojisMap:         map[string]string{"git": ":git:", "gitea": ":gitea:", "codeberg": ":codeberg:", "gitlab": ":gitlab:", "github": ":github:", "gogs": ":gogs:"},
+       ExploreDefaultSort:      "recentupdate",
        PreferredTimestampTense: "mixed",
 
        AmbiguousUnicodeDetection: true,