diff --git a/models/repo_list.go b/models/repo_list.go index 5bf0ecf03..253cc968c 100755 --- a/models/repo_list.go +++ b/models/repo_list.go @@ -221,6 +221,7 @@ const ( SearchOrderByHot SearchOrderBy = "(num_watches + num_stars + num_forks + clone_cnt) DESC" SearchOrderByActive SearchOrderBy = "(num_issues + num_pulls + num_commit) DESC" SearchOrderByWatches SearchOrderBy = "num_watches DESC" + SearchOrderByDefault SearchOrderBy = "recommend desc,num_stars DESC,updated_unix DESC" ) // SearchRepositoryCondition creates a query condition according search repository options diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 1ae488026..ca16093a6 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1392,6 +1392,7 @@ issues.filter_type.assigned_to_you = Assigned to you issues.filter_type.created_by_you = Created by you issues.filter_type.mentioning_you = Mentioning you issues.filter_sort = Sort +issues.filter_sort.default = Default issues.filter_sort.latest = Newest issues.filter_sort.oldest = Oldest issues.filter_sort.recentupdate = Recently updated diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 95e36c602..474b96c3f 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1377,7 +1377,7 @@ issues.remove_milestone_at=`%[2]s 删除了里程碑 %[1]s` issues.add_branch_at=` %[2]s 添加了分支 %[1]s` issues.add_tag_at =` %[2]s 添加了标签 %[1]s` -issues.change_branch_tag_at=`%[3]s 修改了标签/分支从 %[1]s%[2]s` +issues.change_branch_tag_at=`%[3]s 修改了分支/标签从 %[1]s%[2]s` issues.remove_branch_at=`%[2]s 删除了分支 %[1]s` issues.remove_tag_at=`%[2]s 删除了标签 %[1]s` @@ -1404,6 +1404,7 @@ issues.filter_type.assigned_to_you=指派给您的 issues.filter_type.created_by_you=由您创建的 issues.filter_type.mentioning_you=提及您的 issues.filter_sort=排序 +issues.filter_sort.default=默认排序 issues.filter_sort.latest=最新创建 issues.filter_sort.oldest=最早创建 issues.filter_sort.recentupdate=最近更新 diff --git a/routers/home.go b/routers/home.go index 5dec05ebe..500ffbbd6 100755 --- a/routers/home.go +++ b/routers/home.go @@ -309,9 +309,11 @@ func ExploreDatasets(ctx *context.Context) { orderBy = models.SearchOrderByStarsReverse case "feweststars": orderBy = models.SearchOrderByStars + case "default": + orderBy = models.SearchOrderByDefault default: - ctx.Data["SortType"] = "recentupdate" - orderBy = models.SearchOrderByRecentUpdated + ctx.Data["SortType"] = "default" + orderBy = models.SearchOrderByDefault } keyword := strings.Trim(ctx.Query("q"), " ") diff --git a/templates/explore/datasets.tmpl b/templates/explore/datasets.tmpl index 7b2577900..6c995c800 100644 --- a/templates/explore/datasets.tmpl +++ b/templates/explore/datasets.tmpl @@ -121,6 +121,7 @@