summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-04-01 11:55:03 -0700
committerSteve Manuel <nilslice@gmail.com>2017-04-01 11:55:03 -0700
commit012951fbf297d56e287e8a6b3ad813c03fab9f2e (patch)
treebf4a9fbf04c6e17dcc7f887db6782c8cee6b77f6 /cmd
parent8c671874801f3ea133b5f93c59543e06b0d98185 (diff)
add warning message to console, new custom and hidden templates
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ponzu/generate.go2
-rw-r--r--cmd/ponzu/templates/gen-custom.tmpl6
-rw-r--r--cmd/ponzu/templates/gen-hidden.tmpl3
3 files changed, 11 insertions, 0 deletions
diff --git a/cmd/ponzu/generate.go b/cmd/ponzu/generate.go
index adbf093..2b189a8 100644
--- a/cmd/ponzu/generate.go
+++ b/cmd/ponzu/generate.go
@@ -166,6 +166,8 @@ func setFieldView(field *generateField, viewType string) error {
case "tags":
case "custom":
default:
+ msg := fmt.Sprintf("'%s' is not a recognized view type. Using 'input' instead.")
+ fmt.Println(msg)
tmpl, err = tmplFrom("gen-input.tmpl")
}
diff --git a/cmd/ponzu/templates/gen-custom.tmpl b/cmd/ponzu/templates/gen-custom.tmpl
new file mode 100644
index 0000000..a578d18
--- /dev/null
+++ b/cmd/ponzu/templates/gen-custom.tmpl
@@ -0,0 +1,6 @@
+View: []byte(`
+ <div class="input-field col s12">
+ <label class="active">{{ .Name }}</label>
+ <!-- Add your custom editor field view here. -->
+ </div>
+`), \ No newline at end of file
diff --git a/cmd/ponzu/templates/gen-hidden.tmpl b/cmd/ponzu/templates/gen-hidden.tmpl
new file mode 100644
index 0000000..4b00456
--- /dev/null
+++ b/cmd/ponzu/templates/gen-hidden.tmpl
@@ -0,0 +1,3 @@
+View: editor.Input("{{ .Name }}", {{ .Initial }}, map[string]string{
+ "type": "hidden",
+}), \ No newline at end of file