transmet/templates/pages/categories.html

48 lines
1.2 KiB
HTML
Raw Normal View History

{{define "body"}}
<h2 class="form-categories-heading">Categories</h2>
{{template "flashes" .}}
<div class="row">
{{range $category := .categories}}
{{template "row-category" $category}}
{{end}}
</div>
{{end}}
{{define "row-category"}}
{{if .Parent.Valid }}
{{with .Depth}}
<div class="col-xs-{{.}} child-depth"></div>
<div class="col-xs-{{minus 12 .}} category-row">
{{end}}
{{else}}
<div class="col-xs-12 category-row">
{{end}}
2015-05-22 05:55:59 +00:00
{{.Name}} <a href="/categories/delete?id={{.Id}}">delete</a>
<select class="form-control category-change-parent" name="category-change-parent-{{.Id}}" >
<option value="-1" {{if not .Parent.Valid}} selected="true"{{end}}>-- None --</option>
{{range $category := .categories}}
{{template "option-category" $category }}
{{end}}
</select>
</div>
{{range $child := .Children}}
{{template "row-category" $child}}
{{end}}
2015-05-22 05:55:59 +00:00
{{end}}
{{define "option-category"}}
<option value="{{.Id}}">{{.ToString}}</option>
{{range $child := .Children}}
{{template "option-category" $child}}
{{end}}
=======
>>>>>>> fea21c9d10d89f90b71988dcb41722527b947f60
{{end}}