summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/ponzu/options.go9
-rw-r--r--content/post.go5
-rw-r--r--management/editor/elements.go2
3 files changed, 11 insertions, 5 deletions
diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go
index 8f33a78..19b61bb 100644
--- a/cmd/ponzu/options.go
+++ b/cmd/ponzu/options.go
@@ -75,6 +75,7 @@ type {{ .name }} struct {
Title string ` + "`json:" + `"title"` + "`" + `
Content string ` + "`json:" + `"content"` + "`" + `
Author string ` + "`json:" + `"author"` + "`" + `
+ Picture string ` + "`json:" + `"picture"` + "`" + `
Category []string ` + "`json:" + `"category"` + "`" + `
ThemeStyle string ` + "`json:" + `"theme"` + "`" + `
}
@@ -113,7 +114,7 @@ func ({{ .initial }} *{{ .name }}) MarshalEditor() ([]byte, error) {
}),
},
editor.Field{
- View: editor.Textarea("Content", {{ .initial }}, map[string]string{
+ View: editor.Richtext("Content", {{ .initial }}, map[string]string{
"label": "Content",
"placeholder": "Add the content of your {{ .name }} here",
}),
@@ -126,6 +127,12 @@ func ({{ .initial }} *{{ .name }}) MarshalEditor() ([]byte, error) {
}),
},
editor.Field{
+ View: editor.File("Picture", {{ .initial }}, map[string]string{
+ "label": "Author Photo",
+ "placeholder": "Upload a profile picture for the author",
+ }),
+ },
+ editor.Field{
View: editor.Checkbox("Category", {{ .initial }}, map[string]string{
"label": "{{ .name }} Category",
}, map[string]string{
diff --git a/content/post.go b/content/post.go
index e08106c..7dc99c1 100644
--- a/content/post.go
+++ b/content/post.go
@@ -55,10 +55,9 @@ func (p *Post) MarshalEditor() ([]byte, error) {
}),
},
editor.Field{
- View: editor.File("Photo", p, map[string]string{
+ View: editor.File("Picture", p, map[string]string{
"label": "Author Photo",
- "type": "file",
- "placeholder": "Select a file to upload.",
+ "placeholder": "Upload a profile picture for the author",
}),
},
editor.Field{
diff --git a/management/editor/elements.go b/management/editor/elements.go
index 5667faa..e8a2fab 100644
--- a/management/editor/elements.go
+++ b/management/editor/elements.go
@@ -52,7 +52,7 @@ func File(fieldName string, p interface{}, attrs map[string]string) []byte {
<input class="upload" type="file">
</div>
<div class="file-path-wrapper">
- <input class="file-path validate" type="text">
+ <input class="file-path validate" placeholder="` + attrs["label"] + `" type="text">
</div>
</div>
<div class="preview"><div class="img-clip"></div></div>