summaryrefslogtreecommitdiff
path: root/management
diff options
context:
space:
mode:
Diffstat (limited to 'management')
-rw-r--r--management/editor/editor.go4
-rw-r--r--management/manager/manager.go9
2 files changed, 11 insertions, 2 deletions
diff --git a/management/editor/editor.go b/management/editor/editor.go
index fb60c99..25819e5 100644
--- a/management/editor/editor.go
+++ b/management/editor/editor.go
@@ -5,7 +5,7 @@ package editor
import (
"bytes"
- "github.com/bosssauce/ponzu/system/api"
+ "github.com/bosssauce/ponzu/management/manager"
)
// Editable ensures data is editable
@@ -109,7 +109,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.(api.Mergeable)
+ m, ok := post.(manager.Mergeable)
if ok {
submit +=
`
diff --git a/management/manager/manager.go b/management/manager/manager.go
index 2830ba4..9a0ed19 100644
--- a/management/manager/manager.go
+++ b/management/manager/manager.go
@@ -4,10 +4,19 @@ import (
"bytes"
"fmt"
"html/template"
+ "net/http"
"github.com/bosssauce/ponzu/management/editor"
)
+// 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
+}
+
const managerHTML = `
<div class="card editor">
<form method="post" action="/admin/edit" enctype="multipart/form-data">