31 lines
548 B
HTML
31 lines
548 B
HTML
|
|
{{define "attrs"}}
|
|
placeholder="{{.Placeholder}}"
|
|
aria-invalid="{{.Valid}}"
|
|
{{if .Error}}
|
|
aria-describedby="{{.Name}}-error"
|
|
{{end}}
|
|
{{end}}
|
|
|
|
<form action="{{.Action}}" method="{{.Method}}">
|
|
{{range .Fields}}
|
|
<label>
|
|
{{.Label}}
|
|
{{if eq .Type "textarea"}}
|
|
<textarea
|
|
{{template "attrs" .}}
|
|
>{{.Value}}</textarea>
|
|
{{else}}
|
|
<input
|
|
type="{{.Type}}"
|
|
value="{{.Value}}"
|
|
{{template "attrs" .}}
|
|
>
|
|
{{end}}
|
|
</label>
|
|
{{if .Error}}
|
|
<small id="{{.Name}}-error">{{.Error}}</small>
|
|
{{end}}
|
|
{{end}}
|
|
</form>
|