From 43c77865f82fefffbb89ccfb599dfa1e9c6c8f31 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Fri, 30 Sep 2016 20:11:28 -0400 Subject: updating generated content types to include more built-in input function examples (+ Select, Checkbox) --- content/post.go | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'content') diff --git a/content/post.go b/content/post.go index b12eb1d..5b98253 100644 --- a/content/post.go +++ b/content/post.go @@ -11,10 +11,12 @@ type Post struct { Item editor editor.Editor - Title string `json:"title"` - Content string `json:"content"` - Author string `json:"author"` - Timestamp string `json:"timestamp"` + Title string `json:"title"` + Content string `json:"content"` + Author string `json:"author"` + Category []string `json:"category"` + ThemeStyle string `json:"theme"` + Timestamp string `json:"timestamp"` } func init() { @@ -67,6 +69,23 @@ func (p *Post) MarshalEditor() ([]byte, error) { "placeholder": "Enter the author name here", }), }, + editor.Field{ + View: editor.Checkbox("Category", p, map[string]string{ + "label": "Post Category", + }, map[string]string{ + "important": "Important", + "active": "Active", + "unplanned": "Unplanned", + }), + }, + editor.Field{ + View: editor.Select("ThemeStyle", p, map[string]string{ + "label": "Theme Style", + }, map[string]string{ + "dark": "Dark", + "light": "Light", + }), + }, editor.Field{ View: editor.Input("Timestamp", p, map[string]string{ "label": "Publish Date", -- cgit v1.2.3