filebrowser/templates/frontmatter.tmpl

20 lines
839 B
Cheetah
Raw Normal View History

2015-09-19 21:17:38 +00:00
{{ define "frontmatter" }} {{ range $key, $value := . }} {{ if or (eq $value.Type "object") (eq $value.Type "array") }}
2015-09-20 12:04:33 +00:00
<fieldset id="{{ $value.Name }}" data-type="{{ $value.Type }}">
2015-09-20 08:15:21 +00:00
<h3>{{ SplitCapitalize $value.Title }}
2015-09-19 21:17:38 +00:00
<span class="actions">
<button class="add"><i class="fa fa-plus"></i></button>
2015-09-20 12:04:33 +00:00
<button class="delete"><i class="fa fa-minus"></i></button>
2015-09-19 21:17:38 +00:00
</span>
</h3>
{{ template "frontmatter" $value.Content }}
</fieldset>
{{ else }} {{ if not (eq $value.Parent.Type "array") }}
2015-09-20 08:15:21 +00:00
<label for="{{ $value.Name }}">{{ SplitCapitalize $value.Title }}
2015-09-19 21:17:38 +00:00
<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 21:17:38 +00:00
<input name="{{ $value.Name }}:{{ $value.Type }}" id="{{ $value.Name }}" value="{{ $value.Content }}"></input>
{{ end }} {{ end }} {{ end }}