Пример #1
0
func Repositories(ctx *middleware.Context) {
	ctx.Data["Title"] = "Repository Management"
	ctx.Data["PageIsRepos"] = true

	var err error
	ctx.Data["Repos"], err = models.GetRepositoriesWithUsers(200, 0)
	if err != nil {
		ctx.Handle(500, "admin.Repositories", err)
		return
	}
	ctx.HTML(200, REPOS)
}
Пример #2
0
func Repositories(ctx *middleware.Context) {
	ctx.Data["Title"] = ctx.Tr("admin.repositories")
	ctx.Data["PageIsAdmin"] = true
	ctx.Data["PageIsAdminRepositories"] = true

	pageNum := 50
	p := pagination(ctx, models.CountRepositories(), pageNum)

	var err error
	ctx.Data["Repos"], err = models.GetRepositoriesWithUsers(pageNum, (p-1)*pageNum)
	if err != nil {
		ctx.Handle(500, "GetRepositoriesWithUsers", err)
		return
	}
	ctx.HTML(200, REPOS)
}