minor fixes on #1551

This commit is contained in:
Unknwon 2015-09-01 07:04:35 -04:00
parent 67f07e21f5
commit 7714e792a4
10 changed files with 322 additions and 734 deletions

View file

@ -1105,9 +1105,9 @@ func GetRepositories(uid int64, private bool) ([]*Repository, error) {
}
// GetRecentUpdatedRepositories returns the list of repositories that are recently updated.
func GetRecentUpdatedRepositories(num int) (repos []*Repository, err error) {
err = x.Where("is_private=?", false).Limit(num).Desc("updated").Find(&repos)
return repos, err
func GetRecentUpdatedRepositories(page int) (repos []*Repository, err error) {
return repos, x.Limit(setting.ExplorePagingNum, (page-1)*setting.ExplorePagingNum).
Where("is_private=?", false).Limit(setting.ExplorePagingNum).Desc("updated").Find(&repos)
}
// GetRepositoryCount returns the total number of repositories of user.