summaryrefslogtreecommitdiffstats
path: root/routers/admin
diff options
context:
space:
mode:
authorMario Lubenka <mario.lubenka@googlemail.com>2019-04-20 06:15:19 +0200
committertechknowlogick <matti@mdranta.net>2019-04-20 00:15:19 -0400
commitfcbac38d6fd8c91be0da5e7f37e7bc69b071253a (patch)
treecdf7c901df75d0d2f26567d1090ed0e3c1af138d /routers/admin
parent40dc458bb69f9827e804e2fe51c9f42caf3d3ddc (diff)
downloadgitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.tar.gz
gitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.zip
Unifies pagination template usage (#6531) (#6533)
Diffstat (limited to 'routers/admin')
-rw-r--r--routers/admin/notice.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/routers/admin/notice.go b/routers/admin/notice.go
index 5892d88e58..d2c067c143 100644
--- a/routers/admin/notice.go
+++ b/routers/admin/notice.go
@@ -1,18 +1,18 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
+// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package admin
import (
- "github.com/Unknwon/com"
- "github.com/Unknwon/paginater"
-
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
+
+ "github.com/Unknwon/com"
)
const (
@@ -30,7 +30,6 @@ func Notices(ctx *context.Context) {
if page <= 1 {
page = 1
}
- ctx.Data["Page"] = paginater.New(int(total), setting.UI.Admin.NoticePagingNum, page, 5)
notices, err := models.Notices(page, setting.UI.Admin.NoticePagingNum)
if err != nil {
@@ -40,6 +39,9 @@ func Notices(ctx *context.Context) {
ctx.Data["Notices"] = notices
ctx.Data["Total"] = total
+
+ ctx.Data["Page"] = context.NewPagination(int(total), setting.UI.Admin.NoticePagingNum, page, 5)
+
ctx.HTML(200, tplNotices)
}