filebrowser/templates/frontmatter.tmpl

16 lines
659 B
Cheetah
Raw Normal View History

2015-09-14 13:00:12 +00:00
{{ define "frontmatter" }}
{{ range $key, $value := . }}
2015-09-15 10:59:48 +00:00
{{ if or (eq $value.Type "object") (eq $value.Type "array") }}
<fieldset name="{{ $value.Name }}" type="{{ $value.Type }}">
2015-09-15 18:26:18 +00:00
<h3>{{ splitCapitalize $value.Name }} <button class="add"><i class="fa fa-plus"></i></button></h3>
2015-09-14 17:18:26 +00:00
{{ template "frontmatter" $value.Content }}
</fieldset>
2015-09-15 10:59:48 +00:00
{{ else }}
{{ if not (eq $value.Parent "array") }}
2015-09-14 17:18:26 +00:00
<label for="{{ $value.Name }}">{{ splitCapitalize $value.Name }}</label>
2015-09-15 10:59:48 +00:00
{{ end }}
2015-09-14 17:18:26 +00:00
<input name="{{ $value.Name }}" id="{{ $value.Name }}" value="{{ $value.Content }}"></input><br>
2015-09-14 13:00:12 +00:00
{{ end }}
{{ end }}
{{ end }}