filebrowser/templates/frontmatter.tmpl

20 lines
839 B
Cheetah

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