]> source.dussan.org Git - gitea.git/commitdiff
Fix admin notices (#10480) (#10483)
authorJohn Olheiser <john.olheiser@gmail.com>
Wed, 26 Feb 2020 17:14:37 +0000 (11:14 -0600)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2020 17:14:37 +0000 (11:14 -0600)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
routers/routes/routes.go
templates/admin/notice.tmpl
web_src/less/_admin.less

index 455c0b16e721a264ba3047703bcac4e2c5e31e5f..454c2495ca61e6064dfb95fe42787959a0e51bac 100644 (file)
@@ -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 *****
index 93fc8ccc2e9b119b8fc300b4f8e6e8b6d3226249..8e56713ecee0e5585485c4b5df2e44455f99a375 100644 (file)
                                                                <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>
index 15781cf77a074700e261284796ebc9d336ac3259..3652fafb42b7e306b113b34a829c57eb9b8abe80 100644 (file)
@@ -29,7 +29,7 @@
             }
         }
 
-        form button[type='submit'] {
+        form tbody button[type='submit'] {
             padding: 5px 8px;
         }
     }