diff options
Diffstat (limited to 'content/post.go')
-rw-r--r-- | content/post.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/content/post.go b/content/post.go index 4690f41..b12eb1d 100644 --- a/content/post.go +++ b/content/post.go @@ -21,18 +21,32 @@ 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.New(p, + view, err := editor.Form(p, + editor.Field{ + View: editor.Input("Slug", p, map[string]string{ + "label": "URL Path", + "type": "text", + "disabled": "true", + "placeholder": "Will be set automatically", + }), + }, editor.Field{ View: editor.Input("Title", p, map[string]string{ "label": "Post Title", |