diff options
author | John Olheiser <john.olheiser@gmail.com> | 2020-02-26 11:14:37 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 11:14:37 -0600 |
commit | e9061a537cddcff893683a3fcc4f98e3e659324b (patch) | |
tree | 4b14c38821978a4340fc177e8fe229210b66d0c4 | |
parent | ed664a9e1dae4d4660e60c981173bbc5102e69ea (diff) | |
download | gitea-e9061a537cddcff893683a3fcc4f98e3e659324b.tar.gz gitea-e9061a537cddcff893683a3fcc4f98e3e659324b.zip |
Fix admin notices (#10480) (#10483)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
-rw-r--r-- | routers/routes/routes.go | 2 | ||||
-rw-r--r-- | templates/admin/notice.tmpl | 5 | ||||
-rw-r--r-- | web_src/less/_admin.less | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 455c0b16e7..454c2495ca 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -470,7 +470,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/notices", func() { m.Get("", admin.Notices) m.Post("/delete", admin.DeleteNotices) - m.Get("/empty", admin.EmptyNotices) + m.Post("/empty", admin.EmptyNotices) }) }, adminReq) // ***** END: Admin ***** diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index 93fc8ccc2e..8e56713ece 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -40,7 +40,10 @@ <th></th> <th colspan="5"> <div class="ui right"> - <a class="ui red small button" href="{{AppSubUrl}}/admin/notices/empty">{{.i18n.Tr "admin.notices.delete_all"}}</a> + <form method="post" action="{{AppSubUrl}}/admin/notices/empty"> + {{.CsrfTokenHtml}} + <button type="submit" class="ui red small button">{{.i18n.Tr "admin.notices.delete_all"}}</button> + </form> </div> <div class="ui floating upward dropdown small button"> <span class="text">{{.i18n.Tr "admin.notices.actions"}}</span> diff --git a/web_src/less/_admin.less b/web_src/less/_admin.less index 15781cf77a..3652fafb42 100644 --- a/web_src/less/_admin.less +++ b/web_src/less/_admin.less @@ -29,7 +29,7 @@ } } - form button[type='submit'] { + form tbody button[type='submit'] { padding: 5px 8px; } } |