Skip to content

Commit

Permalink
fix action target for uploads deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ollie Phillips authored and nilslice committed Mar 25, 2019
1 parent 5ad601f commit 53c809c
Showing 1 changed file with 3 additions and 2 deletions.
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 53c809c

Please sign in to comment.