filebrowser/templates/frontmatter.tmpl

17 lines
671 B
Cheetah

{{ define "frontmatter" }}
{{ range $key, $value := . }}
{{ if or (eq $value.Type "object") (eq $value.Type "array") }}
<fieldset name="{{ $value.Name }}" type="{{ $value.Type }}">
<legend>{{ splitCapitalize $value.Name }}</legend>
{{ template "frontmatter" $value.Content }}
<button><i class="fa fa-plus"></i> Add field</button>
</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 }}