filebrowser/templates/frontmatter.tmpl
2015-09-15 19:26:18 +01:00

16 lines
659 B
Cheetah

{{ define "frontmatter" }}
{{ range $key, $value := . }}
{{ if or (eq $value.Type "object") (eq $value.Type "array") }}
<fieldset name="{{ $value.Name }}" type="{{ $value.Type }}">
<h3>{{ splitCapitalize $value.Name }} <button class="add"><i class="fa fa-plus"></i></button></h3>
{{ template "frontmatter" $value.Content }}
</fieldset>
{{ else }}
{{ if not (eq $value.Parent "array") }}
<label for="{{ $value.Name }}">{{ splitCapitalize $value.Name }}</label>
{{ end }}
<input name="{{ $value.Name }}" id="{{ $value.Name }}" value="{{ $value.Content }}"></input><br>
{{ end }}
{{ end }}
{{ end }}