Skip to content
Permalink
Browse files

fix action target for uploads deletes

  • Loading branch information...
olliephillips authored and nilslice committed Mar 25, 2019
1 parent 5ad601f commit 53c809c7ad73c324bf2a399b4e25c1f6bf64e60e
Showing with 3 additions and 2 deletions.
  1. +3 −2 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 + `" />

0 comments on commit 53c809c

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