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 /system/admin/handlers.go | |
parent | 1b76c6ae8bf65def5d3e0e042cb7087b5f13bca9 (diff) |
adjusting style to quick-delete-post button and adding JS form control
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r-- | system/admin/handlers.go | 15 |
1 files changed, 14 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 { |