Skip to content

Commit

Permalink
Merge pull request #300 from ponzu-cms/ponzu-dev
Browse files Browse the repository at this point in the history
bugfix: admin delete on file uploads
  • Loading branch information
nilslice authored Mar 25, 2019
2 parents 584a064 + 565462a commit 3ef2dc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/ponzu/ponzu.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.9.4"
"version": "0.10.1"
}
5 changes: 3 additions & 2 deletions system/admin/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 := `
Expand All @@ -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 + `" />
Expand Down

0 comments on commit 3ef2dc0

Please sign in to comment.