diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-05-16 13:45:29 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-05-16 13:45:29 -0700 |
commit | cc0f76554f2bc9bb9fa4f3580c832e4c87b7f44b (patch) | |
tree | 97c38b83d7f9d3a69e8e5b0afa5b48b2effdf8b1 /system | |
parent | f176e7d98f0facbf0ccfac08eb4d7aea03c53c8b (diff) |
adding fix to UI
Diffstat (limited to 'system')
-rw-r--r-- | system/admin/handlers.go | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index a950633..6cd840d 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -2520,22 +2520,40 @@ func searchHandler(res http.ResponseWriter, req *http.Request) { return } + 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(); + } + }); + }); + + // disable link from being clicked if parent is 'disabled' + $(function() { + $('ul.pagination li.disabled a').on('click', function(e) { + e.preventDefault(); + }); + }); + </script> + ` + btn := `<div class="col s3"> - <a href="/admin/edit?type=` + t + `" class="btn new-post waves-effect waves-light"> - New ` + t + ` - </a>` - html = html + b.String() + btn + <a href="/admin/edit?type=` + t + `" class="btn new-post waves-effect waves-light"> + New ` + t + ` + </a>` if _, ok := post.(format.CSVFormattable); ok { - btn = `<br/> + btn += `<br/> <a href="/admin/contents/export?type=` + t + `&format=csv" class="green darken-4 btn export-post waves-effect waves-light"> <i class="material-icons left">system_update_alt</i> CSV </a>` - html = html + b.String() + btn } - html += `</div></div>` + html += b.String() + script + btn + `</div></div>` adminView, err := Admin([]byte(html)) if err != nil { |