diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-18 23:15:07 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-18 23:15:07 -0700 |
commit | f8a734b9c0fc844fb1af94a4c0c02c548c3e6f63 (patch) | |
tree | b021cbec7a687a08a51b1dbd4d17864a236f6b32 | |
parent | 71ce4cff96a22625d81604fdb2a3507018811187 (diff) |
adding delete button [quick-delete-post]
-rw-r--r-- | system/admin/handlers.go | 9 | ||||
-rw-r--r-- | system/admin/static/dashboard/css/admin.css | 12 |
2 files changed, 20 insertions, 1 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index ecb96b4..1dea5c1 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -431,10 +431,17 @@ func adminPostListItem(p editor.Editable, t string) []byte { updatedTime := upTime.Format("01/02/06 03:04 PM") publishTime := tsTime.Format("01/02/06") + cid := fmt.Sprintf("%d", p.ContentID()) + post := ` <li class="col s12"> - <a href="/admin/edit?type=` + t + `&id=` + fmt.Sprintf("%d", p.ContentID()) + `">` + p.ContentName() + `</a> + <a href="/admin/edit?type=` + t + `&id=` + cid + `">` + p.ContentName() + `</a> <span class="post-detail">Updated: ` + updatedTime + `</span> + <form class="quick-delete-post __ponzu" action="/admin/edit/delete"> + <i class="small material-icons red">delete</i> + <input type="hidden" name="id" value="` + cid + `" /> + <input type="hidden" name="type" value="` + t + `" /> + </form> <span class="right">` + publishTime + `</span> </li>` diff --git a/system/admin/static/dashboard/css/admin.css b/system/admin/static/dashboard/css/admin.css index d678fdc..89fb047 100644 --- a/system/admin/static/dashboard/css/admin.css +++ b/system/admin/static/dashboard/css/admin.css @@ -164,6 +164,18 @@ span.post-detail { font-style: italic; } +.quick-delete-post { + display: none; +} + +li:hover .quick-delete-post { + display: block; +} + +.quick-delete-post i { + cursor: pointer; +} + /* OVERRIDE Bootstrap + Materialize conflicts */ .iso-texteditor.input-field label { |