Change default sort order (#2647)

* sort repositories by `updated_unix` in Explore

* Fix UI problem

* Added missing sort order "newest"

* Change default sort order

* fmt
This commit is contained in:
Kazuki Sawada 2017-10-05 14:02:43 +09:00 committed by Lauris BH
parent aa962deec0
commit 43253202e9
3 changed files with 11 additions and 10 deletions

View file

@ -126,12 +126,7 @@ func Profile(ctx *context.Context) {
orderBy = models.SearchOrderByAlphabetically
default:
ctx.Data["SortType"] = "recentupdate"
orderBy = models.SearchOrderByNewest
}
// set default sort value if sort is empty.
if ctx.Query("sort") == "" {
ctx.Data["SortType"] = "recentupdate"
orderBy = models.SearchOrderByRecentUpdated
}
keyword := strings.Trim(ctx.Query("q"), " ")