Skip to content
Permalink
Browse files

Merge pull request #300 from ponzu-cms/ponzu-dev

bugfix: admin delete on file uploads
  • Loading branch information...
nilslice committed Mar 25, 2019
2 parents 584a064 + 565462a commit 3ef2dc0da5d39686da48ac90e8a8a2c6b861e549
Showing with 4 additions and 3 deletions.
  1. +1 −1 cmd/ponzu/ponzu.json
  2. +3 −2 system/admin/handlers.go
@@ -1,3 +1,3 @@
{
"version": "0.9.4"
"version": "0.10.1"
}
@@ -1560,10 +1560,11 @@ func adminPostListItem(e editor.Editable, typeName, status string) []byte {
default:
status = "__" + status
}

action := "/admin/edit/delete"
link := `<a href="/admin/edit?type=` + typeName + `&status=` + strings.TrimPrefix(status, "__") + `&id=` + cid + `">` + i.String() + `</a>`
if strings.HasPrefix(typeName, "__") {
link = `<a href="/admin/edit/upload?id=` + cid + `">` + i.String() + `</a>`
action = "/admin/edit/upload/delete"
}

post := `
@@ -1572,7 +1573,7 @@ func adminPostListItem(e editor.Editable, typeName, status string) []byte {
<span class="post-detail">Updated: ` + updatedTime + `</span>
<span class="publish-date right">` + publishTime + `</span>
<form enctype="multipart/form-data" class="quick-delete-post __ponzu right" action="/admin/edit/delete" method="post">
<form enctype="multipart/form-data" class="quick-delete-post __ponzu right" action="` + action + `" method="post">
<span>Delete</span>
<input type="hidden" name="id" value="` + cid + `" />
<input type="hidden" name="type" value="` + typeName + status + `" />

0 comments on commit 3ef2dc0

Please sign in to comment.
You can’t perform that action at this time.