forked from forgejo/forgejo
minor fixes on #1551
This commit is contained in:
parent
67f07e21f5
commit
7714e792a4
10 changed files with 322 additions and 734 deletions
|
@ -7,6 +7,8 @@ package routers
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/Unknwon/paginater"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
|
@ -50,7 +52,14 @@ func Explore(ctx *middleware.Context) {
|
|||
ctx.Data["Title"] = ctx.Tr("explore")
|
||||
ctx.Data["PageIsExploreRepositories"] = true
|
||||
|
||||
repos, err := models.GetRecentUpdatedRepositories(20)
|
||||
page := ctx.QueryInt("page")
|
||||
if page <= 1 {
|
||||
page = 1
|
||||
}
|
||||
|
||||
ctx.Data["Page"] = paginater.New(int(models.CountRepositories()), setting.ExplorePagingNum, page, 5)
|
||||
|
||||
repos, err := models.GetRecentUpdatedRepositories(page)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetRecentUpdatedRepositories", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue