filebrowser/templates/frontmatter.tmpl

16 lines
842 B
Cheetah
Raw Normal View History

2015-09-14 13:00:12 +00:00
{{ define "frontmatter" }}
2015-09-16 20:48:08 +00:00
{{ range $key, $value := . }}
{{ if or (eq $value.Type "object") (eq $value.Type "array") }}
2015-09-19 18:53:01 +00:00
<fieldset id="{{ $value.Name }}" data-name="{{ $value.Name }}" data-type="{{ $value.Type }}">
<h3>{{ splitCapitalize $value.Title }} <span class="actions"><button class="delete"><i class="fa fa-minus"></i></button> <button class="add"><i class="fa fa-plus"></i></button></span></h3>
2015-09-17 10:32:27 +00:00
{{ template "frontmatter" $value.Content }}
</fieldset>
2015-09-16 20:48:08 +00:00
{{ else }}
2015-09-17 10:32:27 +00:00
{{ if not (eq $value.Parent.Type "array") }}
2015-09-19 18:26:51 +00:00
<label for="{{ $value.Name }}">{{ splitCapitalize $value.Title }} <span class="actions"><button class="delete"><i class="fa fa-minus"></i></button></span></label>
2015-09-14 13:00:12 +00:00
{{ end }}
2015-09-19 18:53:01 +00:00
<input name="{{ $value.Name }}:auto" id="{{ $value.Name }}" value="{{ $value.Content }}"></input>
2015-09-16 20:48:08 +00:00
{{ end }}
{{ end }}
2015-09-14 13:00:12 +00:00
{{ end }}