From 57d0482d520b73d03085ccd236098dd1dfb39669 Mon Sep 17 00:00:00 2001 From: Andrea Fazzi Date: Fri, 6 Dec 2019 08:39:36 +0100 Subject: [PATCH] Add otherAttrs option to input template --- renderer/funcmap.go | 2 ++ templates/layout/input.html.tpl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/renderer/funcmap.go b/renderer/funcmap.go index 619a0cd9..0cf52c0e 100644 --- a/renderer/funcmap.go +++ b/renderer/funcmap.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "html/template" + "log" "net/url" "reflect" "strings" @@ -154,6 +155,7 @@ func yaml(content string) (interface{}, error) { if err != nil { return nil, err } + log.Println(result) return result, nil } diff --git a/templates/layout/input.html.tpl b/templates/layout/input.html.tpl index a1f541e1..d1ed457f 100644 --- a/templates/layout/input.html.tpl +++ b/templates/layout/input.html.tpl @@ -5,7 +5,7 @@ name="{{.options.name}}" class="{{if .options.inputClass}}{{.options.inputClass}}{{else}}form-control{{end}}" id="{{.options.id}}" - placeholder="{{.options.placeholder}}" {{if .update}}value="{{.value}}"{{end}} {{if .options.otherAttrs}}{{.options.otherAttrs}}{{end}} {{if .options.required}}required{{end}}> + placeholder="{{.options.placeholder}}" {{if .update}}value="{{.value}}"{{end}} {{if .options.otherAttrs}}{{.options.otherAttrs|html}}{{end}} {{if .options.required}}required{{end}}> {{if .options.help}}{{.options.help}}{{end}} {{end}}