mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-25 03:00:04 +02:00
#697 disable captcha and new admin create user UI
This commit is contained in:
parent
e2d6b0116e
commit
8e0a69f86a
19 changed files with 228 additions and 179 deletions
|
@ -5,6 +5,8 @@
|
|||
package admin
|
||||
|
||||
import (
|
||||
"math"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
|
@ -14,6 +16,23 @@ const (
|
|||
REPOS base.TplName = "admin/repo/list"
|
||||
)
|
||||
|
||||
func pagination(ctx *middleware.Context, count int64, pageNum int) int {
|
||||
p := ctx.QueryInt("p")
|
||||
if p < 1 {
|
||||
p = 1
|
||||
}
|
||||
curCount := int64((p-1)*pageNum + pageNum)
|
||||
if curCount >= count {
|
||||
p = int(math.Ceil(float64(count) / float64(pageNum)))
|
||||
} else {
|
||||
ctx.Data["NextPageNum"] = p + 1
|
||||
}
|
||||
if p > 1 {
|
||||
ctx.Data["LastPageNum"] = p - 1
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
func Repositories(ctx *middleware.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.repositories")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue