diff options
author | Steve <nilslice@gmail.com> | 2016-10-31 00:59:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-31 00:59:57 -0700 |
commit | 645cfa39a92a9f732629f1e3206ca468ff329138 (patch) | |
tree | 89fc417b79394fb4fc58de997194b9730acfefc1 /content/post.go | |
parent | 96ebcb095797fe4947d647ad1aa7572d84609fc0 (diff) | |
parent | 682cc2b6d9e3524209fbe3d2773fa31e8de9b88d (diff) |
Merge pull request #11 from bosssauce/ponzu-dev
[core] Enable content to be submitted from external clients
Diffstat (limited to 'content/post.go')
-rw-r--r-- | content/post.go | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/content/post.go b/content/post.go index d121ed7..dcdfeff 100644 --- a/content/post.go +++ b/content/post.go @@ -19,25 +19,6 @@ type Post struct { Theme string `json:"theme"` } -func init() { - Types["Post"] = func() interface{} { return new(Post) } -} - -// SetContentID partially implements editor.Editable -func (p *Post) SetContentID(id int) { p.ID = id } - -// ContentID partially implements editor.Editable -func (p *Post) ContentID() int { return p.ID } - -// ContentName partially implements editor.Editable -func (p *Post) ContentName() string { return p.Title } - -// SetSlug partially implements editor.Editable -func (p *Post) SetSlug(slug string) { p.Slug = slug } - -// Editor partially implements editor.Editable -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.Form(p, @@ -88,3 +69,22 @@ func (p *Post) MarshalEditor() ([]byte, error) { return view, nil } + +func init() { + Types["Post"] = func() interface{} { return new(Post) } +} + +// SetContentID partially implements editor.Editable +func (p *Post) SetContentID(id int) { p.ID = id } + +// ContentID partially implements editor.Editable +func (p *Post) ContentID() int { return p.ID } + +// ContentName partially implements editor.Editable +func (p *Post) ContentName() string { return p.Title } + +// SetSlug partially implements editor.Editable +func (p *Post) SetSlug(slug string) { p.Slug = slug } + +// Editor partially implements editor.Editable +func (p *Post) Editor() *editor.Editor { return &p.editor } |