aboutsummaryrefslogtreecommitdiffstats
path: root/routers/admin
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-01 23:33:08 -0500
committerUnknwon <u@gogs.io>2015-12-01 23:33:08 -0500
commit0be8b1b1a1bc828d0c64f5dbf6e642232590de46 (patch)
treeed24a34e71212cf190dfac764cee0b88ad12f35a /routers/admin
parent834d38a8fbb4fc87b8f3914d5e2aab07a4d7e809 (diff)
downloadgitea-0be8b1b1a1bc828d0c64f5dbf6e642232590de46.tar.gz
gitea-0be8b1b1a1bc828d0c64f5dbf6e642232590de46.zip
#2052 Ability to batch delete system notices
Diffstat (limited to 'routers/admin')
-rw-r--r--routers/admin/notice.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/routers/admin/notice.go b/routers/admin/notice.go
index b076994d01..30e3aa6755 100644
--- a/routers/admin/notice.go
+++ b/routers/admin/notice.go
@@ -47,7 +47,18 @@ func DeleteNotice(ctx *middleware.Context) {
ctx.Handle(500, "DeleteNotice", err)
return
}
- log.Trace("System notice deleted by admin(%s): %d", ctx.User.Name, id)
+ log.Trace("System notice deleted by admin (%s): %d", ctx.User.Name, id)
+ ctx.Flash.Success(ctx.Tr("admin.notices.delete_success"))
+ ctx.Redirect(setting.AppSubUrl + "/admin/notices")
+}
+
+func EmptyNotices(ctx *middleware.Context) {
+ if err := models.DeleteNotices(0, 0); err != nil {
+ ctx.Handle(500, "DeleteNotices", err)
+ return
+ }
+
+ log.Trace("System notices deleted by admin (%s): [start: %d]", ctx.User.Name, 0)
ctx.Flash.Success(ctx.Tr("admin.notices.delete_success"))
ctx.Redirect(setting.AppSubUrl + "/admin/notices")
}