{{define "body"}}

Categories

{{template "flashes" .}} {{range $category := .categories}} {{template "row-category" dict "category" $category "categories" $.categories}} {{end}}
{{template "select-category" dict "categories" .categories "id" -1}}
{{end}} {{define "row-category"}}
{{stringTimes .category.Depth "- "}} {{.category.Name}}
delete
{{if $.category.Parent.Valid }} {{template "select-category" dict "categories" .categories "id" $.category.Parent.Value}} {{else}} {{template "select-category" dict "categories" .categories "id" -1}} {{end}}
{{range $child := .category.Children}} {{template "row-category" dict "category" $child "categories" $.categories}} {{end}} {{end}} {{define "select-category"}} {{end}} {{define "option-category"}} {{range $child := .category.Children}} {{template "option-category" dict "category" $child "id" $.id}} {{end}} {{end}}