diff --git a/models/repo_list.go b/models/repo_list.go old mode 100644 new mode 100755 index 3e580a722..cbc67da54 --- a/models/repo_list.go +++ b/models/repo_list.go @@ -197,6 +197,7 @@ const ( SearchOrderByStarsReverse SearchOrderBy = "num_stars DESC" SearchOrderByForks SearchOrderBy = "num_forks ASC" SearchOrderByForksReverse SearchOrderBy = "num_forks DESC" + SearchOrderByDownloadTimes SearchOrderBy = "download_times DESC" ) // SearchRepositoryCondition creates a query condition according search repository options diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini old mode 100644 new mode 100755 index 2a899a0ea..e683b92a6 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1000,6 +1000,7 @@ issues.filter_sort.moststars=点赞由多到少 issues.filter_sort.feweststars=点赞由少到多 issues.filter_sort.mostforks=派生由多到少 issues.filter_sort.fewestforks=派生由少到多 +issues.filter_sort.downloadtimes=下载次数 issues.action_open=开启 issues.action_close=关闭 issues.action_label=标签 diff --git a/routers/home.go b/routers/home.go old mode 100644 new mode 100755 index 7a892e619..f97e3bf10 --- a/routers/home.go +++ b/routers/home.go @@ -222,6 +222,8 @@ func ExploreDatasets(ctx *context.Context) { orderBy = models.SearchOrderByAlphabetically case "reversesize": orderBy = models.SearchOrderBySizeReverse + case "downloadtimes": + orderBy = models.SearchOrderByDownloadTimes default: ctx.Data["SortType"] = "recentupdate" orderBy = models.SearchOrderByRecentUpdated diff --git a/templates/explore/dataset_list.tmpl b/templates/explore/dataset_list.tmpl old mode 100644 new mode 100755 index b26a86ecd..5f4720fec --- a/templates/explore/dataset_list.tmpl +++ b/templates/explore/dataset_list.tmpl @@ -13,6 +13,7 @@ {{.i18n.Tr "repo.issues.filter_sort.oldest"}} {{.i18n.Tr "repo.issues.filter_sort.recentupdate"}} {{.i18n.Tr "repo.issues.filter_sort.leastupdate"}} + {{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}