summaryrefslogtreecommitdiff
path: root/management/editor/editor.go
diff options
context:
space:
mode:
Diffstat (limited to 'management/editor/editor.go')
-rw-r--r--management/editor/editor.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/management/editor/editor.go b/management/editor/editor.go
index a591804..3d8e9c6 100644
--- a/management/editor/editor.go
+++ b/management/editor/editor.go
@@ -4,8 +4,7 @@ package editor
import (
"bytes"
-
- "github.com/bosssauce/ponzu/content"
+ "net/http"
)
// Editable ensures data is editable
@@ -22,6 +21,14 @@ type Sortable interface {
ItemID() int
}
+// Mergeable allows external post content to be approved and published through
+// the public-facing API
+type Mergeable interface {
+ // Approve copies an external post to the internal collection and triggers
+ // a re-sort of its content type posts
+ Approve(req *http.Request) error
+}
+
// Editor is a view containing fields to manage content
type Editor struct {
ViewBuf *bytes.Buffer
@@ -109,7 +116,7 @@ func Form(post Editable, fields ...Field) ([]byte, error) {
<button class="right waves-effect waves-light btn red delete-post" type="submit">Delete</button>
</div>
`
- m, ok := post.(content.Mergeable)
+ m, ok := post.(Mergeable)
if ok {
submit +=
`