1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

go lint fixed for routers/admin

This commit is contained in:
Lunny Xiao
2016-11-21 11:21:24 +08:00
parent bd13c81684
commit 659bc2814c
6 changed files with 73 additions and 51 deletions

View File

@@ -16,9 +16,10 @@ import (
)
const (
NOTICES base.TplName = "admin/notice"
tplNotices base.TplName = "admin/notice"
)
// Notices show notices for admin
func Notices(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("admin.notices")
ctx.Data["PageIsAdmin"] = true
@@ -39,9 +40,10 @@ func Notices(ctx *context.Context) {
ctx.Data["Notices"] = notices
ctx.Data["Total"] = total
ctx.HTML(200, NOTICES)
ctx.HTML(200, tplNotices)
}
// DeleteNotices delete the specific notices
func DeleteNotices(ctx *context.Context) {
strs := ctx.QueryStrings("ids[]")
ids := make([]int64, 0, len(strs))
@@ -61,6 +63,7 @@ func DeleteNotices(ctx *context.Context) {
}
}
// EmptyNotices delete all the notices
func EmptyNotices(ctx *context.Context) {
if err := models.DeleteNotices(0, 0); err != nil {
ctx.Handle(500, "DeleteNotices", err)