summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2019-03-25 13:08:09 -0600
committerGitHub <noreply@github.com>2019-03-25 13:08:09 -0600
commit3ef2dc0da5d39686da48ac90e8a8a2c6b861e549 (patch)
treee655eb4752cae7086ce212d60b0338f5091e46b6
parent584a06456960231eed5171948dcc604980289e42 (diff)
parent565462ac1fd7b94caada20cb25baca77c659cf79 (diff)
Merge pull request #300 from ponzu-cms/ponzu-dev
bugfix: admin delete on file uploads
-rw-r--r--cmd/ponzu/ponzu.json2
-rw-r--r--system/admin/handlers.go5
2 files changed, 4 insertions, 3 deletions
diff --git a/cmd/ponzu/ponzu.json b/cmd/ponzu/ponzu.json
index 676f2c1..7f38ce4 100644
--- a/cmd/ponzu/ponzu.json
+++ b/cmd/ponzu/ponzu.json
@@ -1,3 +1,3 @@
{
- "version": "0.9.4"
+ "version": "0.10.1"
}
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index bc46b5c..d0818ec 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -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 + `" />