summaryrefslogtreecommitdiffstats
path: root/routers/admin/notice.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-25 12:58:39 -0400
committerUnknwon <u@gogs.io>2015-09-25 12:58:39 -0400
commit0d5e57e4aeaaafcb9ddcaac095a4f187d2eaabb4 (patch)
tree25cd4fea2d4831d3e00140f8db7c8aa6f9c98712 /routers/admin/notice.go
parent1c35380c2c476e8eb5022078262e8cadade4d4c7 (diff)
downloadgitea-0d5e57e4aeaaafcb9ddcaac095a4f187d2eaabb4.tar.gz
gitea-0d5e57e4aeaaafcb9ddcaac095a4f187d2eaabb4.zip
#1689 minor fixes and update locale
Diffstat (limited to 'routers/admin/notice.go')
-rw-r--r--routers/admin/notice.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/admin/notice.go b/routers/admin/notice.go
index 164badda7b..512c3f5993 100644
--- a/routers/admin/notice.go
+++ b/routers/admin/notice.go
@@ -5,7 +5,6 @@
package admin
import (
- "github.com/Unknwon/com"
"github.com/Unknwon/paginater"
"github.com/gogits/gogs/models"
@@ -24,25 +23,26 @@ func Notices(ctx *middleware.Context) {
ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminNotices"] = true
- total := models.CountNotices()
+ total := models.CountNotices()
page := ctx.QueryInt("page")
if page <= 1 {
page = 1
}
ctx.Data["Page"] = paginater.New(int(total), setting.AdminNoticePagingNum, page, 5)
-
- notices, err := models.Notices(page, setting.AdminNoticePagingNum)
+
+ notices, err := models.Notices(page, setting.AdminNoticePagingNum)
if err != nil {
ctx.Handle(500, "Notices", err)
return
}
ctx.Data["Notices"] = notices
+
ctx.Data["Total"] = total
ctx.HTML(200, NOTICES)
}
func DeleteNotice(ctx *middleware.Context) {
- id := com.StrTo(ctx.Params(":id")).MustInt64()
+ id := ctx.ParamsInt64(":id")
if err := models.DeleteNotice(id); err != nil {
ctx.Handle(500, "DeleteNotice", err)
return