diff options
Diffstat (limited to 'routers/home.go')
-rw-r--r-- | routers/home.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/home.go b/routers/home.go index 93b24083c7..0876e3a3d9 100644 --- a/routers/home.go +++ b/routers/home.go @@ -45,7 +45,7 @@ func Home(ctx *context.Context) { } type RepoSearchOptions struct { - Counter func() int64 + Counter func(bool) int64 Ranger func(int, int) ([]*models.Repository, error) Private bool PageSize int @@ -55,7 +55,7 @@ type RepoSearchOptions struct { func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { page := ctx.QueryInt("page") - if page <= 1 { + if page <= 0 { page = 1 } @@ -72,7 +72,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { ctx.Handle(500, "opts.Ranger", err) return } - count = opts.Counter() + count = opts.Counter(opts.Private) } else { repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{ Keyword: keyword, @@ -107,7 +107,7 @@ func ExploreRepos(ctx *context.Context) { ctx.Data["PageIsExploreRepositories"] = true RenderRepoSearch(ctx, &RepoSearchOptions{ - Counter: models.CountPublicRepositories, + Counter: models.CountRepositories, Ranger: models.GetRecentUpdatedRepositories, PageSize: setting.UI.ExplorePagingNum, OrderBy: "updated_unix DESC", |