diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-18 23:42:07 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-18 23:42:07 -0700 |
commit | 47a7faf58825b828d2e4d8f386da327448e44f2d (patch) | |
tree | 16766baf8d7018ca15a5f762176f775e11f24c33 | |
parent | 1b76c6ae8bf65def5d3e0e042cb7087b5f13bca9 (diff) |
adjusting style to quick-delete-post button and adding JS form control
-rw-r--r-- | system/admin/handlers.go | 15 | ||||
-rw-r--r-- | system/admin/static/dashboard/css/admin.css | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 0cac28f..069871f 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -401,8 +401,21 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { b.Write([]byte(`</ul></div></div>`)) + script := ` + <script> + $(function() { + var del = $('.quick-delete-post.__ponzu span'); + del.on('click', function(e) { + if (confirm("[Ponzu] Please confirm:\n\nAre you sure you want to delete this post?\nThis cannot be undone.")) { + $(e.target).parent().submit(); + } + }); + }); + </script> + ` + btn := `<div class="col s3"><a href="/admin/edit?type=` + t + `" class="btn new-post waves-effect waves-light">New ` + t + `</a></div></div>` - html = html + b.String() + btn + html = html + b.String() + script + btn adminView, err := Admin([]byte(html)) if err != nil { diff --git a/system/admin/static/dashboard/css/admin.css b/system/admin/static/dashboard/css/admin.css index 4d1275f..e23658e 100644 --- a/system/admin/static/dashboard/css/admin.css +++ b/system/admin/static/dashboard/css/admin.css @@ -178,6 +178,7 @@ li:hover .quick-delete-post { text-transform: uppercase; font-size: 11px; font-weight: bold; + margin-right: 20px; } |