summaryrefslogtreecommitdiff
path: root/content/post.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-09-20 00:24:31 -0700
committerSteve Manuel <nilslice@gmail.com>2016-09-20 00:24:31 -0700
commitcb545173a6f33aff050a1855dcb87184d50b79a6 (patch)
treea2293c3712af16d5d3b31dd5bb40ae5501e9b7e9 /content/post.go
parent3bbfb755411768fe8557b1e36ec10d65a351793f (diff)
adding support for boltdb storage, updating and inserting content, some reorganization
Diffstat (limited to 'content/post.go')
-rw-r--r--content/post.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/content/post.go b/content/post.go
index 1dfb8fb..7bb36f6 100644
--- a/content/post.go
+++ b/content/post.go
@@ -18,7 +18,7 @@ type Post struct {
}
func init() {
- Types["Post"] = &Post{}
+ Types["Post"] = func() interface{} { return new(Post) }
}
// ContentID partially implements editor.Editable
@@ -28,30 +28,30 @@ func (p *Post) ContentID() int { return p.ID }
func (p *Post) Editor() *editor.Editor { return &p.editor }
// MarshalEditor writes a buffer of html to edit a Post and partially implements editor.Editable
-func (p Post) MarshalEditor() ([]byte, error) {
- view, err := editor.New(&p,
+func (p *Post) MarshalEditor() ([]byte, error) {
+ view, err := editor.New(p,
editor.Field{
- View: editor.Input("Title", &p, map[string]string{
+ View: editor.Input("Title", p, map[string]string{
"label": "Post Title",
"type": "text",
"placeholder": "Enter your Post Title here",
}),
},
editor.Field{
- View: editor.Textarea("Content", &p, map[string]string{
+ View: editor.Textarea("Content", p, map[string]string{
"label": "Content",
"placeholder": "Add the content of your post here",
}),
},
editor.Field{
- View: editor.Input("Author", &p, map[string]string{
+ View: editor.Input("Author", p, map[string]string{
"label": "Author",
"type": "text",
"placeholder": "Enter the author name here",
}),
},
editor.Field{
- View: editor.Input("Timestamp", &p, map[string]string{
+ View: editor.Input("Timestamp", p, map[string]string{
"label": "Publish Date",
"type": "date",
}),